Nmap Development mailing list archives

Re: nmap hang due to bind failed


From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 15 Jan 2015 22:59:14 -0600

On Thu, Jan 15, 2015 at 8:54 PM, 泰森 <24123782 () qq com> wrote:


Hi, Dan:
     I removed tty_init in nmap.cc a few days ago (because when nmap hang,
strace output something about tty, someone in mailing list said tty_init
can be removed if possible), today I add tty_init() back in nmap.cc,
console can output the backtraces.

NSE Timing: About 96.08% done; ETC: 16:34 (0:00:13 remaining)
NSE: Waiting: 'rpc-grind' (thread: 0x8d42928)
        stack traceback:
                [C]: in function 'condvar'
                /usr/local/share/nmap/scripts/rpc-grind.nse:250: in
function </usr/local/share/nmap/scripts/rpc-grind.nse:223>
                (...tail calls...)
NSE: Waiting: 'rpc-grind' worker (thread: 0x9411858)
        stack traceback:
                [C]: in function 'connect'
                /usr/local/share/nmap/nselib/rpc.lua:173: in function
'Connect'
                /usr/local/share/nmap/scripts/rpc-grind.nse:168: in
function </usr/local/share/nmap/scripts/rpc-grind.nse:158>
Stats: 0:06:22 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE: Active NSE Script Threads: 2 (2 waiting)

NSE Timing: About 96.08% done; ETC: 16:34 (0:00:13 remaining)
NSE: Waiting: 'rpc-grind' (thread: 0x8d42928)
        stack traceback:
                [C]: in function 'condvar'
                /usr/local/share/nmap/scripts/rpc-grind.nse:250: in
function </usr/local/share/nmap/scripts/rpc-grind.nse:223>
                (...tail calls...)
NSE: Waiting: 'rpc-grind' worker (thread: 0x9411858)
        stack traceback:
                [C]: in function 'connect'
                /usr/local/share/nmap/nselib/rpc.lua:173: in function
'Connect'
                /usr/local/share/nmap/scripts/rpc-grind.nse:168: in
function </usr/local/share/nmap/scripts/rpc-grind.nse:158>
Stats: 0:06:22 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE: Active NSE Script Threads: 2 (2 waiting)

NSE Timing: About 96.08% done; ETC: 16:34 (0:00:13 remaining)
‍
Ricky


As I suspected, rpc-grind is going slowly against a service that is not
responsive. We changed the default timeout for RPC connections (which
affects this script) in r33622 from 30 seconds to a timeout based on the
host's round-trip time. If you apply the same changes (which you can see on
Github here:
https://github.com/nmap/nmap/commit/964006b223eec621df15378b4a1be87c7e0d3baa)
you should see a substantial speedup.

There is one unnecessary debug line in that diff that will probably cause
you problems; simply delete the line that contains stdnse.debug1, as it is
unnecessary (and was removed in a later commit).

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

Current thread: