mirror of
https://github.com/nmap/nmap.git
synced 2026-01-18 20:29:02 +00:00
520651a9edb5b82ca0994ff3b70e6865757a404d
rpc.Comm.Connect was trying to bind to 424 reserved ports, which is overkill. Since nsock doesn't do an actual bind(2) call until socket:connect for TCP, that meant up to 424 connect calls, each of which is currently leaking a socket. This commit contains 3 fixes: 1. Add nmap.new_socket calls for non-privileged code path that were moved inside the privileged loop to originally address the leak. 2. Check for TIMEOUT on each of the TCP connect calls and abandon the Connect, avoiding many timeouts. 3. Try 10 random reserved ports (from 1 to 1024) instead of 400+. Should be good odds of finding one unused, even when lots of threads are trying (though empirical results would be helpful). Also, this should reduce load since thread n won't need to fail n-1 bind attempts.
Fix a bug in the argparser. When users pass 'random' as an IPv6 address, the randomly generated address never gets stored. This was reported and fixed by Mark Atkinson. More info: http://seclists.org/nmap-dev/2012/q3/950
Here is some documentation for Nmap, but these files are much less comprehensive than what you'll find at the actual Nmap documentation site ( http://nmap.org ).
Description
Languages
C
37.8%
Lua
28.1%
C++
16.7%
Shell
5.8%
Python
4.2%
Other
7.1%