Commit graph

206 commits

Author SHA1 Message Date
dmiller
6b9e1aea01 Mark log functions as printf-like 2026-09-23 19:15:29 +00:00
dmiller
bc4346dd87 Use exponential moving average for timing estimates
Some checks failed
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Has been cancelled
Time remaining estimates are now based on a moving average work unit
completion rate instead of percent completion of the entire task. This
better fits tasks that may increase the number of work units as time
goes on (such as increasing the number of retries for any given probe)
2026-07-01 02:06:12 +00:00
dmiller
756d012567 massdns: ensure servers are set in Init so that isMassDnsOK works 2026-06-10 21:39:41 +00:00
dmiller
7ae3835fa5 Move mass_dns from nmap_dns to libnetutil/massdns 2026-06-10 21:39:39 +00:00
dmiller
f752603604 Fix 1-byte read overrun 2026-04-07 13:51:07 +00:00
dmiller
95d380b836 Bump copyright date to 2026 [skip ci] 2026-02-16 22:33:40 +00:00
dmiller
f5c06c948b Send up to current capacity of requests at once. Fixes #3280 2026-01-22 19:47:54 +00:00
dmiller
951eb5fb16 Fix parallel DNS synchronization issues due to reads arriving before writes are done. 2025-07-03 17:32:45 +00:00
dmiller
47ee5c2923 Fix bug in parallel DNS: out-of-bounds read in timeouts 2025-07-03 17:32:45 +00:00
dmiller
3d36f2b005 Hedge against runaway recursion. See #3130 2025-06-30 23:33:31 +00:00
dmiller
f5a9b18a40 Handle Nsock errors in DNS read handler by disconnecting the server. 2025-06-30 23:29:17 +00:00
dmiller
4ed1ce0eee Avoid passing empty string to nsock_pool_set_device
Nsock checks for NULL, but not for empty string. Rather than making
Nsock decide, each app will decide whether to call
nsock_pool_set_device, with all currently skipping the call if device is
an empty string.
2025-06-09 18:38:59 +00:00
dmiller
2216e3856e Handle DNS::NONE requests (ignore) 2025-06-09 17:33:59 +00:00
dmiller
0f48a510eb Windows DNS: only use servers from the chosen device if -e is used 2025-05-23 19:03:02 +00:00
dmiller
d59349fe99 Ensure we can connect to DNS servers with requested source address 2025-05-23 18:05:51 +00:00
dmiller
3a4b053af6 Fix build breakage: MSVC-suggested syntax for enum isn't portable. 2025-05-23 18:05:51 +00:00
dmiller
b72decbcc5 Fix typo in previous commit 2025-05-23 17:29:34 +00:00
dmiller
d72beec963 Use GetAdaptersAddresses, not Registry, for DNS servers
In addition to being simpler, this approach allows us to limit to
adapters that are up and configured. Fixes #3114
2025-05-23 17:13:06 +00:00
dmiller
a55708ba5e Correctly handle DNS server connection failures 2025-05-23 17:13:06 +00:00
dmiller
ec3b1d264b Reintegrate 7.97 changes 2025-05-15 15:42:03 +00:00
dmiller
79d468d7a1 Handle 'localhost' target name in mass_dns 2025-05-09 22:47:08 +00:00
dmiller
a7ca9aba7b Also try system resolver for unqualified (no-dot) DNS names 2025-05-09 22:47:07 +00:00
dmiller
8fc566bf49 Read multiple hostnames for one address from /etc/hosts 2025-05-09 22:47:07 +00:00
dmiller
297a6242c7 mass_dns: map forward lookups to /etc/hosts first 2025-05-09 22:47:06 +00:00
dmiller
0232a370b9 Make /etc/hosts parsing more robust, part 1 2025-05-09 22:47:06 +00:00
dmiller
cf2403e9d7 Fall back to system resolution if we get NXDOMAIN and the name is non-ascii 2025-05-09 22:47:05 +00:00
dmiller
cec0cc6f99 Improve flow in nmap_mass_dns_core() 2025-05-09 22:47:05 +00:00
dmiller
6db5c9cb85 Bump copyright date 2025-02-26 17:44:43 +00:00
dmiller
a751509b0b Use u32 for s_addr; in_addr_t not defined on Windows 2024-10-07 18:31:14 +00:00
dmiller
adc7f02503 Increase DNS timeout times 2024-05-16 19:31:48 +00:00
dmiller
2907002faa mass_dns: Use slow-start logic rather than max-cap when a drop is seen 2024-05-16 19:31:47 +00:00
dmiller
c80bc2efb2 Rate-limit capacity scale-downs to 1 per MIN_DNS_TIMEOUT 2024-05-16 19:31:47 +00:00
dmiller
1e964d30f5 Correctly treat A queries as alt for -6 scans, AAAA alt for -4 2024-05-16 19:31:46 +00:00
dmiller
50ceac5753 mass_dns: only scale back for initial requests
Some requests just take longer; they may have lots of recursion or a
slow authoritative server. That won't change on retransmissions, so if
we treat all requests and retransmissions equally, we get a long tail of
retransmits with smaller and smaller capacity (parallelism). Instead, we
will use the initial-request period to determine server capacity and
then not change it during the retransmit phase.
2024-05-16 19:31:45 +00:00
dmiller
8b8c6fca4e mass_dns: Correctly handle write errors/timeouts 2024-05-16 19:31:45 +00:00
dmiller
7f7996977d mass_dns: keep capacity higher in the case of timeouts 2024-05-14 15:26:36 +00:00
dmiller
4a5d33f502 More aggressive timeouts; favor retries and slowing parallelism instead. 2024-05-14 15:26:36 +00:00
dmiller
16c9d36148 mass_dns: prioritize sending new requests over retransmissions 2024-05-14 15:26:35 +00:00
dmiller
a626407796 mass_dns: Be more aggressive with timeouts but slower to increase capacity. 2024-05-13 14:31:34 +00:00
dmiller
37e0f7f80b Improve string representation of DNS query in debug output 2024-05-13 14:31:34 +00:00
dmiller
e1a2577ffd Reuse DNS query ID for retransmissions 2024-05-13 14:31:33 +00:00
dmiller
5c46b3b9f7 Fix memory leak: clean up alt requests 2024-05-13 14:31:33 +00:00
dmiller
0896ed3f5d Simplify mass_dns for the case of requesting A and AAAA records 2024-05-13 14:31:32 +00:00
dmiller
43e70c09d2 Remove leftover print-debugging statement 2024-05-06 18:20:30 +00:00
dmiller
801ae30dcc Report distinct names, not number of requests (A+AAAA) 2024-05-06 18:20:29 +00:00
dmiller
4ad5e7ca22 Fix memory leak in nmap_dns.cc: call freeaddrinfo after resolve_all() 2024-05-01 22:19:33 +00:00
dmiller
019557382b mass_dns: Allow multiple addresses for each A/AAAA lookup 2024-04-30 16:39:21 +00:00
dmiller
bf2acde232 Handle chained CNAME records 2024-04-26 17:25:41 +00:00
dmiller
3cac585f69 Treat no-answers as NXDOMAIN 2024-04-26 17:25:41 +00:00
dmiller
480803e24a Support forward-DNS in mass_dns (1 addr per name) 2024-04-25 17:12:29 +00:00