Testing for Conficker with Nmap

The latest nmap release can test Windows machines for Conficker infection. If you are running Linux, nmap may already be installed. You can download the latest nmap for OS X from http://nmap.org/book/inst-macosx.htm. You actually get more more than nmap with the .dmg: it also includes Zenmap (an X11 nmap), Ncat (good old netcat), and Ndiff (compares nmap scans). I briefly fired up Zenmap but used the command line tool for everything you'll see here.

For Linux or OS X you could also compile from source.

You need the very latest version to get the scripts that will check for Conficker. The version I used here was 4.85BETA8.

You will need to disable firewalls and security suites on the Windows machine to be checked. For absolute safety, that would mean disconnecting the machines from any external network as you'd potentially be exposed while this was shut off.

The XP machine I used here had Norton Antivirus installed, which includes an "Internet Worm Protection" component that will cause the Conficker check to fail:


nmap -PN -T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.1.2

Starting Nmap 4.85BETA8 ( http://nmap.org ) at 2009-04-29 16:19 EDT
NSE: Loaded 1 scripts for scanning.
Initiating Connect Scan at 16:19
Scanning 192.168.1.2 [2 ports]
Completed Connect Scan at 16:19, 2.00s elapsed (2 total ports)
NSE: Script scanning 192.168.1.2.
NSE: Script Scanning completed.
Host 192.168.1.2 is up.
Interesting ports on 192.168.1.2:
PORT    STATE    SERVICE
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds

Read data files from: /usr/local/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 2.21 seconds
 

If I scan that machine with a normal "nmap 192.168.1.2", the scan will be detected and the scanning machine will be blocked from all access for 30 minutes. Attempting to run the Conficker script after that will usually just get you a hang.

However, with the Worm protection turned off, the scripts can tell us that this machine is clean:

nmap -PN -T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.1.2

Starting Nmap 4.85BETA8 ( http://nmap.org ) at 2009-04-29 16:38 EDT
NSE: Loaded 1 scripts for scanning.
Initiating Connect Scan at 16:38
Scanning 192.168.1.2 [2 ports]
Discovered open port 445/tcp on 192.168.1.2
Discovered open port 139/tcp on 192.168.1.2
Completed Connect Scan at 16:38, 1.10s elapsed (2 total ports)
NSE: Script scanning 192.168.1.2.
NSE: Starting runlevel 2 scan
Initiating NSE at 16:38
Completed NSE at 16:38, 0.18s elapsed
NSE: Script Scanning completed.
Host 192.168.1.2 is up (0.00042s latency).
Interesting ports on 192.168.1.2:
PORT    STATE SERVICE
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Host script results:
|  smb-check-vulns:  
|  MS08-067: Check disabled (remove 'safe=1' argument to run)
|  Conficker: Likely CLEAN
|_ regsvc DoS: Check disabled (add --script-args=unsafe=1 to run)

Read data files from: /usr/local/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 1.56 seconds
 

If you are going to scan your entire network all at once, see How to use Nmap to scan very large networks for Conficker. However, remember that each of those machines probably has something running to prevent that, so it's not going to be all that easy usually.

Of course I also scanned the entire local network out of idle curiosity. Everything was as I expected except for these two machines:

Interesting ports on IP-STB1.home (192.168.1.100):
Not shown: 999 closed ports
PORT     STATE SERVICE
8082/tcp open  blackice-alerts

Interesting ports on IP-STB3.home (192.168.1.102):
Not shown: 999 closed ports
PORT     STATE SERVICE
8082/tcp open  blackice-alerts
 

Huh? What the heck are those? I had a moment of confusion until I realized that STB stands for "Set Top Box". Those are my Verizon TV boxes. It's interesting that they appear to be running a Black-Ice firewall. I wonder if my scan tripped any alarms?



Got something to add? Send me email.





(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Testing for Conficker with Nmap

7 comments



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence







Wed Apr 29 23:54:34 2009: 6288   drag

gravatar
"""
Huh? What the heck are those? I had a moment of confusion until I realized that STB stands for "Set Top Box". Those are my Verizon TV boxes. It's interesting that they appear to be running a Black-Ice firewall. I wonder if my scan tripped any alarms?
"""

I really doubt that the people that work on those crappy set-top boxes are really up to that level of sophistication.

Point your telnet or browser at that port and see what happens.



Thu Apr 30 00:43:47 2009: 6289   TonyLawrence

gravatar
Well, somewhere somebody has to be concerned about network security.. :-)



Thu Apr 30 14:20:58 2009: 6292   jtimberman

gravatar
While scanning your home network is a great idea, if you're in a company environment, be careful about scanning systems. Make sure you have written permission from someone with authorization to permit such scans. Nmap scans can cause wild things to happen. In some cases, printers will spit out reams of paper or applications will stop responding. You'll need to disclaim liability for that.






Thu Apr 30 15:49:47 2009: 6293   TonyLawrence

gravatar
Yes, good point. There have been times when I really could have used a nmap scan but went without it because I couldn't find the right people to approve it.



Fri Nov 11 22:52:34 2011: 10162   anonymous

gravatar


I ran telnet to port 8082 on a set top box, it connected but didn't accept any commands. The only reason I even tried it was because one of the channels & the Windows XP Pro screen server flashing, instead of a program. I didn't know if XP was the embedded OS or not.



Sat Nov 12 12:38:47 2011: 10165   TonyLawrence

gravatar


8082 is for BlackIce. I have no idea what its protocol is.



Tue Apr 16 01:03:29 2013: 12028   anonymous

gravatar


"8082 is for BlackIce. I have no idea what its protocol is"

BlackIce runs under either TCP or very occasionally UDP protocol depending on how much effort the creator put into implementing the firewall, TCP of course being the stronger choice, and more commonly in use. As a tendency however BlackIce, while having the capability, is rarely configured to detect nmap or any informative scanning technique that is commonly implemented.

BlackIce firewalls are also often used on large scale server gateways that provide network user identification and security to users in places such as library's and corporate offices where the owner of the network desires to prevent those they have not authorized the ability to browse the web, (it provides no protection to a host actually connecting to the network and so will not prevent anyone determined to get online if they have any know how and some time) but where it would be inconvenient to encrypt their router.




------------------------
Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us