Commit graph

13748 commits

Author SHA1 Message Date
I-am-Krish
fd59ddfd7f Address code review feedback on PR #3448
1. Used C++98 const_iterator for range loop in output.cc
2. Added missing guard condition for empty aliases in output.cc
3. Added is_resolved_address(ss) check in targets.cc to prevent netmask addresses from applying as names
4. Added architectural comment explaining why cross-batch aliases cannot be appended due to streaming XML constraints
2026-08-29 09:28:59 +05:30
I-am-Krish
003949d4ba Fix missing XML hostnames when --unique is used (#3409)
When using the --unique flag, duplicate IPs are skipped to avoid redundant scanning. However, if a user provided multiple aliases for the same IP (e.g. '127.0.0.1 localhost'), the aliases were silently discarded when skipped, resulting in missing '<hostname type="user">' tags in the XML output.
This commit resolves the issue by extending the Target class to support storing multiple aliases. During host generation (HostGroupState::get_next_host), if a named host is skipped due to the --unique flag, its name is now looked up in the current hostbatch and appended to the existing Target's aliases. Finally, output.cc was updated to iterate over and print all collected aliases.
2026-08-29 09:27:21 +05:30
dmiller
4f7743ec45 Don't call fatal() from nsock for pcap errors.
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
2026-08-28 17:15:22 +00:00
dmiller
7361c340be Let -iR notice if all possible addresses are excluded
Some checks are pending
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Waiting to run
2026-08-28 04:03:23 +00:00
dmiller
10f0b683a6 New tests for addrset, addrset_matches_all() 2026-08-28 04:03:22 +00:00
dmiller
26e2993bd6 New addrset trie property: always the most compact form 2026-08-28 04:03:21 +00:00
dmiller
e4e8c97eb7 Better semantics for constants in addrset 2026-08-28 04:03:21 +00:00
dmiller
8ecc9a6729 Enable addrset to update from another addrset 2026-08-28 04:03:20 +00:00
dmiller
66a5cbe7ff Match IPv4 and IPv6 in separate trie structures to avoid ::ffff:0:0/96 problem 2026-08-28 04:03:19 +00:00
dmiller
f6d3e28ffd Prevent -iR from running forever if all addresses are excluded 2026-08-28 04:03:19 +00:00
dmiller
fe777b1d7c Addrset: add ability to test for entire address space exclusion 2026-08-28 04:03:18 +00:00
nnposter
d356e635a4 Cosmetic code cleanup
Some checks are pending
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Waiting to run
2026-08-27 02:31:09 +00:00
nnposter
d233b45684 Implement XML output for script http-config-backup 2026-08-27 02:12:27 +00:00
nnposter
8b408ccb95 Use correct function to sanitize a filename. Close #3456 2026-08-27 02:05:53 +00:00
nnposter
4de0d186ff Fix broken test for htaccess. See #3456 2026-08-27 01:49:50 +00:00
nnposter
4bf77dd693 Remove dead code 2026-08-27 01:46:18 +00:00
nnposter
0c17c3b367 Fix a trivial typo 2026-08-27 01:42:52 +00:00
nnposter
271cabb86a Correct a unit test 2026-08-24 02:56:30 +00:00
nnposter
20c8fe450c Improve IP options parsing. Fix #3447 2026-08-24 02:41:29 +00:00
nnposter
80b687140c Implement XML output for script rsync-list-modules 2026-08-23 02:06:41 +00:00
nnposter
5c84f7f253 Rectify lint findings 2026-08-22 23:52:57 +00:00
nnposter
5f5cdfc629 Remove unnecessary branches and conditionals 2026-08-22 23:37:17 +00:00
nnposter
89391c1c02 Lint cleanup; return the correct error message 2026-08-22 23:26:37 +00:00
nnposter
8c161c6d7f Tolerate trailing data in the rsync version response. Close #3440 2026-08-22 22:15:41 +00:00
dmiller
db4aefddfa Catch a base class of sqlite3 exceptions, not only a specific one. Fixes #3420 2026-08-21 01:33:59 +00:00
dmiller
042376289d Restore correct behavior of socket:get_info() and others
Since Nmap 7.93, requesting certain operations on an unconnected NSE
socket would result in a Lua error being thrown instead of the (nil,
message) return that was expected. vnc-info and the http.lua library
both use socket:get_info() as a check for whether the socket is
connected. This restores the expected behavior. Fixes #3424
2026-08-21 01:29:35 +00:00
dmiller
84420aa300 Try to use the correct sockaddr size when setting source. See #3438 2026-08-21 01:14:28 +00:00
dmiller
3ca969ce85 Fuzzer for various hex-related utility functions 2026-08-21 01:14:27 +00:00
dmiller
23d13f12f7 Note earlier OpenSSL version update 2026-08-20 19:25:01 +00:00
dmiller
1fa2ade748 Make autobuild on Windows use latest Npcap SDK 2026-08-20 17:40:55 +00:00
dmiller
493fa0d530 Revert "Use log_func, not fprintf, in massdns" 2026-08-20 17:40:55 +00:00
dmiller
c1086f1e15 Silence some compiler warnings from the NetBSD build 2026-08-20 17:40:54 +00:00
dmiller
b8032c2d28 Remove dbus as build requirement for NetBSD. Closes #3442 2026-08-20 17:40:53 +00:00
dmiller
6aaada8c53 Make Lua's random more random 2026-08-18 18:14:04 +00:00
dmiller
b426f0d719 don't reject invalid DNS packets for fuzzing. 2026-08-18 16:06:57 +00:00
dmiller
8c1eb1c50e Fuzzer for validatepkt() 2026-08-18 16:06:56 +00:00
dmiller
aa9daeee92 Try harder to pass validation when fuzzing decode_reply() 2026-08-18 16:06:56 +00:00
dmiller
4f83a3bdad Fix traceroute with -sO 2026-08-18 16:06:55 +00:00
dmiller
cd74c02e2f Let late replies count for DNS, but don't clobber results
Enforce invariants and use asserts to be sure requests aren't left
unfinished or double-freed.
2026-08-18 16:06:54 +00:00
dmiller
ed8abf52f4 Don't schedule sends on disconnected servers 2026-08-18 16:06:54 +00:00
dmiller
37a95cb34f Retrieve current server via Nsock, not request 2026-08-18 16:06:53 +00:00
dmiller
6ca4498822 Don't start DNS timeout until write actually happens. 2026-08-18 16:06:52 +00:00
dmiller
38d907e45f keep DNS request ID lookup per-server 2026-08-18 16:06:52 +00:00
dmiller
07785203c9 Consolidate DNS query matching to one place 2026-08-18 16:06:51 +00:00
dmiller
4fa4238789 Use log_func, not fprintf, in massdns 2026-08-18 16:06:50 +00:00
dmiller
27b7951833 Remove function in favor of well-tested one 2026-08-18 16:06:50 +00:00
dmiller
5650f35c6d Use random, not progressive TXID for DNS requests 2026-08-14 19:04:39 +00:00
dmiller
52b1553633 Add a make target for building lua and luac 2026-08-14 17:16:20 +00:00
dmiller
9b62481a67 Simplify putDomainName and add length checks 2026-08-14 17:16:20 +00:00
dmiller
5de629e3dd Modernize autoconf macros for nbase 2026-08-14 17:16:19 +00:00