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

379 Commits

Author SHA1 Message Date
dmiller
875a51fb0f Be more parallel with ARP discovery
Two essential changes:

1. (ab)Use the ratelimit detection feature to hold off sending retransmissions,
preferring to send new ARP probes. Late responses will still be recorded, but no
longer counted as drops. This also gives each target the longest amount of time
to respond.

2. Send timing pings much more frequently. Since we're not sending any
retransmissions until timeout + ratelimit, we wouldn't otherwise have any data
on drops in order to speed up or slow down.

Results are faster ARP scans with fewer missed targets. See #92.
2020-05-15 18:18:18 +00:00
dmiller
6ed754b438 Add "hosthint" element to XML.
This feature allows programs consuming XML output to know when a target
has been found to be "up" before all scan phases are completed. This is
helpful for allocating storage, communicating scan progress, or
estimating total scan duration. Closes #1858.
2020-01-11 07:05:01 +00:00
dmiller
c978ba14ca Remove some unnecessary unsigned qualifiers (newstate is defined as int in most places) 2020-01-11 07:05:00 +00:00
dmiller
0c2a3776f0 Remove incorrect use of const on return type (not pointer). #1834 2019-12-25 20:01:15 +00:00
dmiller
33f421fd6e Avoid assertion failure when unsolicited ARP response received
We probably want a more explicit handling of the case where we get an
ARP response to a request that we did not send (system's own, or another
Nmap scan running at the same time). In any case, this ought to solve
the crashes reported as #1797 and #1764.
2019-12-03 17:04:13 +00:00
dmiller
d639a53088 Bump copyright date in license headers 2019-05-28 21:36:04 +00:00
dmiller
14705cd417 ultrascan: bail early if there are no probes in the current scan
This shouldn't ever happen, but it currently does for host discovery
scans using -PR where the target is not directly connected. See #1361
2018-10-22 20:12:45 +00:00
dmiller
d8ff55b72e Start timeout clocks closer to first probe, not in batches. Closes #1150 2018-08-13 19:24:06 +00:00
dmiller
6680f5648d Avoid using commonly-spoofed-closed ports as ping/timing ports 2018-03-28 20:17:44 +00:00
fyodor
ff62300249 Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
rewanth
6ee953a5ff Removes trailing spaces in 69 files. Closes #971. 2017-08-23 08:52:40 +00:00
dmiller
9c7ea727a7 Update license terms for 2017 2017-06-07 12:32:38 +00:00
dmiller
ab5e247cee Include netutil.h for IPPROTO_SCTP constant where necessary. Fixes #868 2017-04-26 18:55:16 +00:00
dmiller
e813de759a Reduce use of utils.h for error functions 2017-04-20 22:39:08 +00:00
dmiller
891c3be3b9 remove tcpip.h from other headers' includes 2017-04-19 13:53:57 +00:00
fyodor
4bd67aa2fb Update the Nmap license/header text to reflect latest updates to docs/legal-notices.xml 2016-12-14 00:12:23 +00:00
dmiller
3f1ad0742e New option --defeat-icmp-ratelimit. Closes #353, Fixes #216 2016-12-09 04:19:45 +00:00
tudor
0a7a7e395b Scan iterator fix for compilation under Visual Studio 2010 2016-10-18 15:56:40 +00:00
tudor
9c8a435bbf Fixed scanning the same IP multiple times with a type of scan that is now raw, incompleteHosts and completedHosts are now multisets instead of sets 2016-10-15 22:26:43 +00:00
dmiller
923f1de3e4 Increase const-ness of HssPredicate::operator() to avoid warnings. 2016-08-19 12:38:29 +00:00
tudor
074f99b291 UltraScanInfo::findHost is now faster 2016-08-10 15:39:19 +00:00
tudor
7c0280382e incompleteHosts and completedHosts are now sets, matching a packet to a target is done faster 2016-08-09 06:07:22 +00:00
tudor
5d942ab1bd Fixed a compiler warning 2016-08-07 16:57:32 +00:00
dmiller
8b18e348db Avoid array overrun with -PO when probes time out 2016-07-28 16:19:49 +00:00
dmiller
67fd101b01 Enable Nmap, Nping to use Npcap over Winpcap if available. 2016-06-14 14:16:46 +00:00
dmiller
6e33d6ac3c Bump date in copyright headers 2016-04-04 15:38:44 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
d33tah
b9fb766a4f Move a lot of raw/connect scanning routines. 2014-09-03 14:27:11 +00:00
d33tah
b6b92f6564 Move most (if not all) data structure declarations from scan_engine.cc
to scan_engine.h. Some method definitions remain in the header files and
should be moved to .cc later.
2014-09-03 14:27:04 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
jay
8d5ec9e310 Reapply r33420, r33421. Fix a missing right parenthesis. https://xkcd.com/859/ 2014-08-15 12:09:22 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
df4f23eec0 Change all statements of the form 'return BOOLEAN_EXPRESSION ? false : true;' to 'return !BOOLEAN_EXPRESSION;' 2014-08-03 04:25:18 +00:00
jay
68659157f6 Change all statements of the form 'return BOOLEAN_EXPRESSION ? true : false;' to 'return BOOLEAN_EXPRESSION;' 2014-08-03 04:22:02 +00:00
jay
d4cf544df6 Fix a missing bracket at the end of the IMPORTANT NMAP LICENSE TERMS part in each file 2014-08-02 19:29:50 +00:00
d33tah
6355a1bebe Revert my unfinished refactoring commit I pushed by mistake. 2014-07-23 14:43:12 +00:00
d33tah
308d924415 Remove an unneeded duplicate variable assignment. 2014-07-23 14:37:16 +00:00
dmiller
5ce61b556e Make a more descriptive error when raw sockets fail.
Doesn't happen often, but as the message says, certain Solaris zones can
cause problems here. This message is more informative than the previous
"socket troubles in Init"
2014-07-11 04:00:26 +00:00
dmiller
e603da4a4f Remove some minor changes to timing updates in connect scans
This change restores the control flow of handling connect() return and
error values. This shouldn't result in any real changes, but makes it
simpler to see the differences introduced in r33185.
2014-07-10 14:21:30 +00:00
dmiller
12004b5d41 Detect self-connected TCP connect probes
Recent discussion here: http://seclists.org/nmap-dev/2014/q1/136
2014-07-08 16:09:15 +00:00
dmiller
567e344ad7 Fix assertion failure in do_one_select_round
Since the refactor in r33185, getting a good response for a host during
a ping scan can remove all outstanding probes for that host, since we
already know the host is up. This broke the existing iteration in some
cases. I could force the crash with: nmap -sn -PS80-89 scanme.nmap.org

Now we check explicitly for an empty list each time through the loop.
2014-07-08 15:17:12 +00:00
dmiller
65c50eb695 re-apply r33185
Consolidate connect-scan status and errno checking

    Previously, the return value and socket errors from the connect() call
    were checked in two different places: immediately after the call, and
    then later as the sockets were select()ed over. This led to a divergence
    of logic, so the immediate checking failed to set state reasons or
    contribute to timing. This commit puts all such checking into a single
    function, handleConnectResult, so further improvements will not diverge
    again.
2014-07-08 15:17:10 +00:00
d33tah
2cc8da210a Revert "Consolidate connect-scan status and errno checking". 2014-07-08 14:23:51 +00:00
dmiller
ae4cae1c6e Consolidate connect-scan status and errno checking
Previously, the return value and socket errors from the connect() call
were checked in two different places: immediately after the call, and
then later as the sockets were select()ed over. This led to a divergence
of logic, so the immediate checking failed to set state reasons or
contribute to timing. This commit puts all such checking into a single
function, handleConnectResult, so further improvements will not diverge
again.
2014-07-08 02:59:15 +00:00
dmiller
cfd1c5fe65 Set reasons when connect() comes back immediately
In sendConnectScanProbe, the usual method is to start a non-blocking
connect() and then do select() on the sockets until we get a result. On
some platforms and in some circumstances, connect() either blocks or
comes back immediately. We handled this by setting the port state
appropriately, but we didn't set the reason, yielding results like "Host
is up, received no-response" and "80/tcp  open  http  no-response"
2014-07-02 15:35:12 +00:00
d33tah
a80c90608c sed -i 's/if ( /if (/g' *.cc *.h; sed -i 's/for ( /for (/g' *.cc *.h; sed -i 's/( /(/g' nmap_amigaos.h tcpip.h service_scan.cc
There's still quite a lot of code like this, nse_openssl.cc being most
messy IMHO. Also, I left out "if( something )" syntax.
2014-06-25 15:40:54 +00:00
d33tah
421176fc00 Get rid of double newline at the EOF I accidentally introduced in the
last commit.
2014-06-18 11:30:02 +00:00
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
2014-06-18 10:18:58 +00:00
jay
b6a994ea40 Correct the Target MAC Address in Nmap's ARP discovery to conform to what IP stacks in currently popular operating systems use. 2014-05-31 11:03:44 +00:00
dmiller
b5e53fc1d8 Silence libc++ warnings, via Olli Hauer 2014-04-17 21:58:39 +00:00