dmiller
42170b067f
Remove unneeded g_has_npcap_loopback
2025-04-16 00:00:05 +00:00
dmiller
6db5c9cb85
Bump copyright date
2025-02-26 17:44:43 +00:00
dmiller
0e3a51c992
Set timeouts for Windows connect scan. Fixes #2113
2024-10-30 19:02:09 +00:00
dmiller
cf718f2071
Avoid a few extra gettimeofday calls
2024-10-28 23:11:52 +00:00
nnposter
cefa051cfc
Fix various typos in comments. Closes #2888
2024-08-16 02:40:23 +00:00
dmiller
1ec9caea3b
Replace nested MAX/MIN macros with box() function
2024-06-27 19:36:05 +00:00
dmiller
f0fab247db
Simplify boostScanDelay to make it clear what limits are in place.
2024-06-27 19:36:03 +00:00
dmiller
eb21ac9ea0
Refactor HSS::nextTimeout for efficiency
...
Avoid function call in macro expansion. Reduce number of struct timeval
assignments.
2024-06-26 21:54:29 +00:00
dmiller
7b20a38099
Minor efficiencies: avoid multiple expansions of function calls in TIMEVAL_* macros
2024-06-26 21:54:28 +00:00
dmiller
8d0a4d9b2a
Optimize processData: Reduce iterations looking for global pings
2024-03-01 19:29:55 +00:00
dmiller
8b380fd505
Optimize processData: reduce calls to probeTimeout() and TIMEVAL_SUBTRACT calcs.
2024-03-01 19:29:55 +00:00
dmiller
44c3b5abc8
Optimize loop check in doAnyOutstandingRetransmits: head of list does not change
2024-03-01 19:29:54 +00:00
dmiller
938c3c7081
Moar const
2024-03-01 19:29:54 +00:00
dmiller
b862961cdb
Shortcut probe search for earliest since they are in order by send time.
2024-02-29 20:18:12 +00:00
dmiller
f999182d0f
Bump date and reapply header templates
2024-02-28 18:46:45 +00:00
dmiller
68c34af819
Minor code simplifications & const
2024-02-26 23:10:52 +00:00
dmiller
c5f3665c4f
Avoid up to 2 portlist lookups when setting port state in ultrascan
2024-02-26 23:10:51 +00:00
dmiller
35939b1175
Minor optimization for probe list iteration
2024-02-26 18:29:11 +00:00
dmiller
3cf82912ce
Use TIMEVAL_BEFORE instead of TIMEVAL_SUBTRACT for clarity and efficiency
2024-02-26 18:29:11 +00:00
dmiller
e7f8cd820b
Use TIMEVAL_FSEC_SUBTRACT for clarity
2024-02-26 18:29:10 +00:00
dmiller
f5634144c6
incompleteHosts is multiset, not list, so size() is constant-time
2024-02-26 18:29:10 +00:00
dmiller
20522e5e5e
Simplify and make assertion clearer
2024-02-26 18:29:08 +00:00
dmiller
9c6daa5b9c
Avoid iterating over probes if caller doesn't ask for mayincrease
2024-02-26 18:29:07 +00:00
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