probes that will be sent and calculate from that. This makes the 100%
completion match up closely with the end of the scan, as the estimate gets
better as the scan gets closer to finishing. It also works against filtered
hosts. There is still the related problem that the completion time estimate
uses a global average to estimate completion rate, so it tends to
underestimate.
estimates, and don't consider the number of outstanding probes or number of
retries. The old code would overestimate completion, causing a period of 99.99%
completion at the end of a scan (which caused earlier estimates to be too
soon). For a long UDP scan this puts the completion estimate right on after a
little time to allow for convergence. See
http://www.bamsoftware.com/wiki/Nmap/CompletionTimeEstimates.
instead of a custom hash table and an STL list instead of a custom linked list.
The biggest gain comes from using the list.sort method rather than inserting
ports in sorted order (equivalent to insertion sort). The new code passes
Doug's p-switch-tests.
Here are time comparisons, using the old and new services code, and using the
standard nmap-services file and the 65535-port nmap-services-huge. The times
are the duration of the call to nmap_services_init. Three trials were done for
each case, except for the old-code/nmap-services-huge case.
nmap-services:
old code: 0.215 0.201 0.227 (average 0.214 s)
new code: 0.025 0.022 0.023 (average 0.023 s)
nmap-services-huge:
old code: 441.014 (average 441.014 s)
new code: 0.984 0.975 0.978 (average 0.979 s)
the present. This allows the sending rate to temporarily exceed the
maximum to keep from being slowed too much by other delays in the scan
engine. See the discussion at http://seclists.org/nmap-dev/2008/q3/0236.html.
liblua and libm. This is necessary for static builds of Nmap, such as RPM
builds. Before this the error that was caused looked like
SCRIPT ENGINE: error while initializing script rules:
error loading module 'bit' from file '/usr/libexec/nmap/nselib-bin/bit.so':
/usr/libexec/nmap/nselib-bin/bit.so: undefined symbol: lua_pushnumber
stack traceback:
[C]: ?
[C]: in function 'require'
/usr/share/nmap/nselib/packet.lua:12: in main chunk
[C]: in function 'require'
/usr/share/nmap/scripts/rpcinfo.nse:10: in main chunk
[C]: ?
[C]: in function 'Entry'
/usr/share/nmap/scripts/script.db:8: in main chunk
[C]: ?
[C]: ?