Closed
Description
Initially was using -O -sV -sC on a number of hosts, then narrowed it down to the above command as minimal to reproduce a seemingly frozen nmap run.
Running
sudo nmap [ip] -sV -sC -p2121 -dd
eventually results in this looping over and over, many times per second:
NSOCK INFO [30.0650s] nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 5122 [[ip]:2121] (27 bytes): 500 Command unrecognized...
NSOCK INFO [30.0650s] nsock_write(): Write request for 6 bytes to IOD #4 EID 5131 [[ip]:2121]
NSOCK INFO [30.0650s] nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 5131 [[ip]:2121]
NSOCK INFO [30.0650s] nsock_read(): Read request from IOD #4 [[ip]:2121] (timeout: 7000ms) EID 5138
NSOCK INFO [30.0670s] nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 5138 [[ip]:2121] (27 bytes): 500 Command unrecognized...
NSOCK INFO [30.0670s] nsock_write(): Write request for 6 bytes to IOD #4 EID 5147 [[ip]:2121]
NSOCK INFO [30.0670s] nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 5147 [[ip]:2121]
NSOCK INFO [30.0670s] nsock_read(): Read request from IOD #4 [[ip]:2121] (timeout: 7000ms) EID 5154
NSOCK INFO [30.0690s] nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 5154 [[ip]:2121] (27 bytes): 500 Command unrecognized...
NSOCK INFO [30.0690s] nsock_write(): Write request for 6 bytes to IOD #4 EID 5163 [[ip]:2121]
NSOCK INFO [30.0690s] nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 5163 [[ip]:2121]
NSOCK INFO [30.0690s] nsock_read(): Read request from IOD #4 [[ip]:2121] (timeout: 7000ms) EID 5170
Happy to submit the IP privately, if that'll help.
Activity
jfrancos commentedon Feb 16, 2019
Forgot to mention: Nmap 7.70
nnposter commentedon Feb 16, 2019
Most likely there is a specific script that is stuck. Can you try to identify it by hitting a space while it is looping (and everything else has already stopped)?
You should get output similar to the following:
jfrancos commentedon Feb 16, 2019
nnposter commentedon Feb 16, 2019
This is very helpful. Stay tuned.
nnposter commentedon Feb 16, 2019
Could you please apply the following patch to
scripts/ftp-syst.nseand test again?jfrancos commentedon Feb 16, 2019
Yes that is much better! Would you like to know anything other than, nmap finishes normally and gives reasonable-looking results?
nnposter commentedon Feb 16, 2019
If you ran the scan with at least one
-dthen at some point it should have produced the message from the patch:but there is no need to go out of your way to look for it. The stack trace you have provided isolated the issue pretty well. I am confident that this patch is what we should go with. Unless you still see some misbehavior then I am going to commit it.
jfrancos commentedon Feb 17, 2019
Yup:
NSE: [ftp-syst M:7cb82464 [ip]:2121] SYST error: 500 Command unrecognized.Thanks for working on this!
nnposter commentedon Feb 17, 2019
The fix has been committed as r37583. Thank you for reporting the issue and providing the necessary run-time trace.
Prevent endless post-authentication looping when encountering SYST er…