Nmap Development mailing list archives

NSE Connection Problems on Windows?


From: Rob Nicholls <robert () robnicholls co uk>
Date: Thu, 11 Oct 2012 15:59:18 +0100

I've recently experienced some weird behaviour running NSE scripts using a version of Nmap I've built myself from SVN on Windows. It seems to affect scripts that access the same port (e.g. ntp, snmp), where one or more of them seem to execute properly and then the remaining ones seem to hang (presumably forever). When it happens, Nmap will just say something like:

NSE: Active NSE Script Threads: 3 (3 waiting)

Increasing the debugging suggests that it's getting stuck in parts of the script that are trying to establish a connection:

NSE: Waiting: 'snmp-interfaces' (thread: 037980D8)
        stack traceback:
                [C]: in function 'connect'
C:\Program Files\Nmap/scripts\snmp-interfaces.nse:424: in function <C:\Program Files\Nmap/scripts\snmp-interfaces.nse:391>
                (...tail calls...)

I've tried leaving the scan for a long time and it doesn't appear to do anything. If I kill the scan it sometimes ends with one or more occurrences of:

Socket troubles: No error

If it's any help, I don't think I've seen this happen before September. I can reproduce this hang with a default UDP scan like the following:

nmap xxx.xxx.xxx.xxx -sUCV -n -Pn --reason --version-intensity 0 -p 100-200

UDP scans against a small range of ports, such as 160-170, seem to complete okay, which suggests the scripts themselves aren't causing the hang. Is it possible that this only affects UDP connections (I don't think my TCP scans have been affected in this way)?

For good measure, I've just tried the same scan using an SVN build on Linux and it seems to work fine there. Is it possible this only affects Windows?!

Rob

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: