1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 07:29:01 +00:00
Commit Graph

2789 Commits

Author SHA1 Message Date
david
47aa010d2e Factor out the code that calculates the completion percentage into its own
subroutine. It was present in two places.
2008-08-14 14:19:39 +00:00
david
8e6576f00e Use only the number of completed ports when computing completion time
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.
2008-08-14 07:00:24 +00:00
david
afc805a1ef Add a CHANGELOG entry for r9462, faster nmap-services loading. 2008-08-13 01:50:59 +00:00
fyodor
30e26e481e we generally don't update the xmlversion just for a new attribute. Doing so may cause more trouble than its worth, though I'm open to convincing 2008-08-13 01:30:42 +00:00
david
3a67da3a7e Improve the efficiency of loading the nmap-services file. We now use an STL map
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)
2008-08-13 01:19:09 +00:00
michael
931285f765 Updated DTD, XML version, and anded scanflags attribute to scaninfo element. 2008-08-13 00:59:22 +00:00
bmenrigh
57ffa96d51 Fixed a few typos and improved wording in a few places 2008-08-11 23:35:37 +00:00
david
227adcd664 Remove the code that catches up the --max-rate scheduled send time to
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.
2008-08-11 16:26:17 +00:00
batrick
bbae5a7845 Applied the fix for a script returning more than one result in showSMTPVersion.nse
See Jah's post: http://seclists.org/nmap-dev/2008/q3/0293.html
2008-08-10 00:39:36 +00:00
batrick
ce9d484281 Made nsock functions get the proper environment. (bad use of setfenv earlier).
nsock:connect function gets the global environment.
2008-08-09 23:12:52 +00:00
batrick
cd674d4f6d Cleaned up the nsock:connect function's source to be
passed its upvalues rather than having them given globally.
2008-08-09 22:55:57 +00:00
david
8d44251891 Modify zenmap.xml to remove mention of output redirection, which doesn't happen
any more. Also put replaceable option arguments inside option elements and
change "Zen web page" to "Zenmap web page".
2008-08-07 14:33:24 +00:00
batrick
984bdf65bb Added error message to output for NSE when a script could not be loaded.
See: http://seclists.org/nmap-dev/2008/q3/0265.html
2008-08-07 12:32:39 +00:00
david
213d3a4808 svn:ignore liblua/liblua.a. 2008-08-05 22:54:55 +00:00
david
f6539408af Overhaul Makefile.in and configure.ac to link NSE C modules explicitly with
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]: ?
2008-08-05 21:41:30 +00:00
david
98b796b517 Remove a spurious blank in the output caused by a newline in scripting.xml. 2008-08-05 21:28:36 +00:00
david
c5d4075db5 Oops, move the definition of the now-static function formatScriptOutput to
above where it's used.
2008-08-05 19:58:21 +00:00
david
9621ab338a Make some change to make --without-liblua work again. 2008-08-05 19:28:51 +00:00
david
deeaaf9e77 Remove a mention of pcre.so from scripting.xml. 2008-08-05 16:44:08 +00:00
pgpickering
0062e0e914 fixed bug in base64.lua leading to wrong encoding of data 2008-08-05 14:42:41 +00:00
batrick
6bfd95743f Fixed an incorrect number of arguments being passed to a vararg error function. 2008-08-05 09:29:15 +00:00
david
796dd919ff svn:ignore stuff in libpcre from a static RPM build. 2008-08-05 05:58:50 +00:00
fyodor
eb66c0181e add credit to a couple entries. There is another uncredited one related to the 'c:\nmap' problem where NSE turned the \n into a newline. But I don't remember offhand who fixed it. 2008-08-04 23:18:18 +00:00
pgpickering
5ad22b0c52 fixed two warnings in nse_hash.cc, code cleanup 2008-08-03 00:19:58 +00:00
fyodor
77e750ce6a sorting 2008-08-02 21:21:49 +00:00
batrick
1f7c51a85d Reverted a change made to mutex("running") documentation concerning the
return value (someone changed it to "returns an identification string"
when in fact it returns a thread).
2008-08-02 21:21:33 +00:00
michael
4a7022bf04 Updated as per Davids request. I misinterpreted what David said and made a change, when he really meant for me to suggest the change in the mailing list rather then just committing it. 2008-08-02 20:42:11 +00:00
michael
64219d7e41 Change suggested by Fyodor 2008-08-02 20:05:38 +00:00
michael
aaf2a60970 Fixed typo from previous patch 2008-08-02 19:45:04 +00:00
michael
a4542861a8 Nmaps XML output will now report that an idle scan has occurred in the 'scaninfo' element when applicable. 2008-08-02 19:28:30 +00:00
pgpickering
d6066bb332 fixed bug in snma.lua: fetchResponseValues(): wrong "local" when decoding 2008-08-02 10:40:03 +00:00
pgpickering
7c4db4f2ee silenced signed/unsigned warnings in nse_binlib.cc 2008-08-02 10:35:28 +00:00
kris
910cb5ca48 Moving block_socket() and unblock_socket() from Nmap to Nbase for reuse in
Nsock and Ncat
2008-08-02 03:44:35 +00:00
pgpickering
178a40f281 updated NSEDoc documentation for snmp.lua, pop3.lua, base64.lua 2008-08-01 20:33:56 +00:00
fyodor
9a9523a93d add apt-cacher service 2008-08-01 08:26:35 +00:00
david
6c506e5c5b CHANGELOG entry for IP protocol ping probe fix. 2008-08-01 00:20:29 +00:00
david
901915dfbc Simplify and fix the logic surrounding the handling of host discovery
probes, especially IP protocol probes.

Previously if IP protocol ping (-PO) was used anywhere in a host
discovery scan, any response was treated as a protocol response. (The
handlers for other response types had an explicit check for this.) This
means that if you did

nmap -PS -PO

and got back a SYN/ACK in response to the -PS probe, it would be marked
with a reason of proto-response rather than syn-ack. Now, because the IP
protocol response handler matches so broadly, it is given the last
chance at handling a response, only if no interpretation makes sense.
Now the aforementioned scan will give a reason of syn-ack.

The old behavior was not only misleading with respect to reasons, it had
a minor and subtle bug. Consider the following packet trace:

SENT (2.0990s) TCP 192.168.0.21:42205 > target:25 S ttl=40 id=39342 iplen=44  seq=114128202 win=1024 <mss 1460>
SENT (2.2560s) TCP 192.168.0.21:42205 > target:53 S ttl=40 id=51247 iplen=44  seq=114128202 win=1024 <mss 1460>
SENT (2.3280s) TCP 192.168.0.21:42206 > target:25 S ttl=37 id=31111 iplen=44  seq=114062667 win=2048 <mss 1460>
RCVD (2.3530s) TCP target:53 > 192.168.0.21:42205 SA ttl=51 id=0 iplen=44  seq=4159224453 win=5840 ack=114128203 <mss 1460>
ultrascan_host_probe_update called for machine target state UNKNOWN -> HOST_UP (trynum 1 time: 25123)
Ultrascan DROPPED probe packet to target detected
Changing ping technique for target to tcp to port 25; flags: S

Why is the received packet marked as a drop? And why is the ping
technique change to SYN to port 25 when the response came back from port
53? The reason is that the IP protocol response handler caught the probe
and decided it was in response to one of the sent TCP probes--any of the
TCP probes. It selected the probe to port 25 essentially at random and
used that as the relevant probe. The result is that a drop is wrongly
recorded (slowing down the scan), and a worse than useless ping probe is
used (worse than useless because it will cause another drop any time
it's used).

I found this while trying to emulate PortBunny's default ping scan,
which is
-PS80,25,22,443,21,113,23,53,554,3389,445 -PA3333,11 -PE -PP -PU161,162 -PO51
though not in the same order Nmap uses.
2008-08-01 00:08:47 +00:00
pgpickering
0b542cb755 added brutePOP3.nse 2008-07-31 22:55:28 +00:00
pgpickering
5dc92c3c58 added popcapa.nse 2008-07-31 22:55:05 +00:00
pgpickering
5e44f53b8d added SNMPcommunitybrute.nse 2008-07-31 22:54:40 +00:00
pgpickering
3fae2b9fdd modified SNMPsysdesr.nse to use the SNMP library 2008-07-31 22:54:20 +00:00
pgpickering
88c80f73a3 added pop3.lua 2008-07-31 22:51:45 +00:00
pgpickering
d769960f42 added snmp.lua 2008-07-31 22:51:34 +00:00
pgpickering
a37dfa7f3e added base64.lua 2008-07-31 22:49:39 +00:00
fyodor
90cb66aae4 trivial rewording, typo fixing, etc. 2008-07-31 21:50:15 +00:00
pgpickering
3398e1f94e modified nse_init.cc, added binlib and hashlib to NSE 2008-07-31 14:21:28 +00:00
pgpickering
f07cebb87f modified nmap.vcproj, added binlib and hashlib for NSE 2008-07-31 14:20:45 +00:00
pgpickering
78d3be0968 modified Makefile.in, added binlib and hashlib for nse 2008-07-31 14:20:10 +00:00
pgpickering
177de9e877 added nse_binlib.cc: bin.pack() and bin.unpack() 2008-07-31 14:19:23 +00:00
pgpickering
da51facaa6 added nse_binlib.h 2008-07-31 14:18:21 +00:00