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

407 Commits

Author SHA1 Message Date
dmiller
6f6b2de214 Apply new license templates, bump copyright date 2023-04-14 17:11:46 +00:00
dmiller
7bba5dc625 Fix signedness issue by making a constant a macro 2023-02-09 17:18:10 +00:00
dmiller
117b0e2b2b Move a calculation outside the loop 2022-12-12 21:01:36 +00:00
dmiller
ee059c44fe Big optimization of doAnyOutstandingRetransmits
Retransmitting does not change the set of incomplete hosts, so there's
no need to use a map to store the current position in the outstanding
probes queue. Using a vector is much faster. Additionally, improper use
of std::map::find() and std::map::operator[] meant that the O(logN)
lookup was happening 4 times for a single host for each iteration
through the loop. Complexity for N targets is now O(N), not O(N logN)
2022-11-02 02:12:39 +00:00
dmiller
a2062c2745 Small reduction in work done for nextTimeout 2022-11-02 02:12:38 +00:00
dmiller
1375f44416 Reduce sockaddr comparisons in raw scans 2022-11-02 02:12:38 +00:00
dmiller
d9422b6d05 Enable UDP payloads for -PU, not only -sU 2022-10-31 20:50:19 +00:00
dmiller
b5dd2956dd Check for sd > FD_SETSIZE before it is unrecoverable. Fixes #1857 2022-09-29 00:13:10 +00:00
dmiller
e8271b7070 Prevent system from going to sleep during scans. Fixes #1192 2022-09-21 21:31:14 +00:00
dmiller
dd690b3e0b Bump copyright date and update some links [ci skip] 2022-02-18 17:38:46 +00:00
dmiller
e20093b16d Don't init payloads for non-udp scans 2021-12-12 23:42:37 +00:00
fyodor
3aec3f3a07 Update to latest copyright templates. Main change is that Insecure.Com LLC is now Nmap Software LLC 2021-11-23 16:04:37 +00:00
dmiller
ccfdc64a2c Fix build error on MSVC 2021-08-06 16:16:49 +00:00
dmiller
e93109ef88 Make base_port a member of UltraScanInfo. 2021-08-06 02:47:58 +00:00
dmiller
180c716ca5 Combine tryno and pingseq
UltraProbe's tryno and pingseq attributes were mutually exclusive,
encoded in the same places in packets, and did not need more than 7 bits
to store. This change combines them into a bitfield. This simplifies
some logic, since they do not need to be distinguished from each other.

Additionally, in cases where the tryno is encoded in the source port
number, no further checks or decoding need to happen beyond comparing
the destination port of the response to the source port of the probe.
2021-08-06 02:47:57 +00:00
dmiller
01c1e00b83 Prefer UDP probes with 1 or fewer payloads as ping probes. 2021-08-06 02:47:56 +00:00
dmiller
9c97e008f7 Fix #2293: assertion failed probe->tryno == maxtries
When tying UDP payloads to tryno, we were exceeding the maxtries in
order to send all available payloads, leading to assertion failures.
Currently there are not more than 4 payloads for any given port; most
have none, many have 1, very few have more. So we will send them all at
the same time with the same source port/tryno.
2021-08-06 02:47:55 +00:00
dmiller
bafb7b88ae Code analysis thinks this could be null; assert it 2021-07-21 15:46:38 +00:00
dmiller
1fd272f8dd const all the things! 2021-04-23 20:37:41 +00:00
dmiller
28fde911fe Remove an unused state variable from HostScanStats 2021-04-23 20:37:39 +00:00
dmiller
a20fda6480 Respect --max-retries in UDP scan even when some payloads haven't been sent. 2021-01-19 19:57:37 +00:00
dmiller
6310b7d9e3 Ensure all UDP payloads get sent before giving up on a port. 2021-01-18 22:23:55 +00:00
dmiller
9ac591f9db Better handling for ICMP Host Unreachable 2020-10-29 23:02:30 +00:00
dmiller
15726a0be1 Minor optimization of freshPortsLeft
The actual number only matters for certain debug output, so replaced
this frequently-called function with one that short-circuits to return a
boolean. Mostly only matters for host discovery scans, since all others
were only a few instructions already.
2020-10-26 16:59:06 +00:00
dmiller
e317dfdb8a Avoid a few calls to Target::timedOut, which is not relevant in host discovery 2020-10-26 16:59:06 +00:00
dmiller
4c50296597 Don't count discovery (ping scan) time against host timeout clock. See #1922, #2153 2020-10-23 03:03:26 +00:00
dmiller
2027c0cdc3 Destroy outstanding probes of completed hosts eventually. See #2153, #1922 2020-10-22 19:02:05 +00:00
dmiller
ef8213a36c Reintegrate Nmap 7.90 release branch 2020-10-05 23:00:30 +00:00
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