Commit graph

13332 commits

Author SHA1 Message Date
Rob Cobbins
04ac00dcf9 Fix issue #2848: Support multiple CPEs of the same type
PROBLEM:
When service-probes defines multiple CPE entries of the same part type
(e.g., two application CPEs like Apache and PHP), only the last one was
stored as the CPE loop overwrote the single buffer for each type.

ROOT CAUSE:
- MatchDetails structure used single const char* for cpe_a/h/o
- ServiceNFO class used single char arrays for cpe_*_matched
- CPE processing loop reused the same buffer, overwriting previous values
- Only the last CPE of each type was retained

SOLUTION:
- Changed MatchDetails to use std::vector<const char *> for cpe_a/h/o
- Changed ServiceNFO to use std::vector<char *> for cpe_*_matched
- Updated CPE processing loop to allocate new buffers for each CPE
- Added proper memory management (free in destructors and SSL reset)
- Updated all copying/transfer logic to iterate vectors

VERIFICATION:
Tested against servers with Apache + PHP and confirmed XML output now
shows multiple <cpe> tags as expected:
  <cpe>cpe:/a:apache:http_server:2.4.34</cpe>
  <cpe>cpe:/a:php:php:7.3.20</cpe>

FILES MODIFIED:
- service_scan.h: MatchDetails structure
- service_scan.cc: ServiceNFO class, getVersionStr, testMatch,
  processMatch, processResults, and cleanup code
2025-11-03 12:02:35 -05:00
nnposter
a74125aef5 Add missing cookie attributes 2025-11-01 23:34:30 +00:00
nnposter
f5a3251e97 Use the correct the port range, 512-1023, not 513-1024.
Detect if binding a socket to a given port failed and retry.
Close #3196
2025-11-01 22:52:49 +00:00
nnposter
8d7fa538e3 Properly detect if binding an RPC socket to a given port failed. Close #3194
Testing the return status of socket:bind() and socket:connect() is not enough.
For details, see #1939.
2025-11-01 22:34:51 +00:00
nnposter
8d06576dbb Remove deprecated category "Application". Close #3217 2025-10-28 22:57:18 +00:00
nnposter
d2d591ce0c Avoid a crash when the IP contains a colon but no hextets 2025-10-27 01:19:40 +00:00
nnposter
4f7c92fbac Include operand "ne" in the documentation 2025-10-26 19:54:18 +00:00
nnposter
d2fbcc6cd6 Perform effective socket error checking 2025-10-26 02:23:22 +00:00
nnposter
b4b921c913 Streamline the code by using math.min() 2025-10-26 02:14:47 +00:00
nnposter
81b0568452 Remove redundant code 2025-10-26 01:42:15 +00:00
nnposter
7a989ff957 Remove duplicate of previously defined skip_space() 2025-10-26 01:37:00 +00:00
nnposter
9289bbccee Skip over contiguous linear whitespace in a single step 2025-10-26 01:35:07 +00:00
dmiller
f2548e68a8 Add changelog entry for #2657. Closes #2657 2025-10-24 19:27:53 +00:00
nnposter
eb1ed93540 Skip over empty content encoding placeholders 2025-10-19 19:13:24 +00:00
nnposter
384113e746 Add locations used by the official Python installer 2025-10-19 02:33:20 +00:00
nnposter
77f3edfc8a Make sure that all locations are added, not just the last one 2025-10-19 02:29:36 +00:00
nnposter
a36c660bf2 Delay the expansion to avoid syntax issues. Closes #3177 2025-10-19 02:15:12 +00:00
dmiller
ef6d17eb28 Fix formatting of TCP sequence info in Zenmap topology. Fixes #3189 2025-10-17 18:16:49 +00:00
dmiller
3a39ec6d9b Ignore RTN_UNSPEC, possible with -e and -S. Fixes #2955 2025-10-14 18:43:59 +00:00
nnposter
fcf6f0cb19 Use simpler/cheaper portrule 2025-10-08 23:08:04 +00:00
nnposter
6b7652513e Remove a repeated word 2025-10-04 21:39:16 +00:00
nnposter
83824ff04d Socket timeout must be set before connecting 2025-09-29 22:24:51 +00:00
dmiller
751d5fd58b ensure IPV6 OS engine has a device name to use 2025-09-09 20:46:39 +00:00
dmiller
b4e536f371 Only use eth handle for Ethernet on non-Windows systems. 2025-09-03 17:04:48 +00:00
dmiller
99e396b4a0 Fix various fatal errors around --send-eth 2025-09-03 17:04:47 +00:00
dmiller
5bb82a2ad0 Fix crash in socket_bindtodevice: NULL device is permissible 2025-09-03 17:04:46 +00:00
nnposter
cca10689fe Rectify orphaned or misaligned AC_MSG_RESULT output 2025-08-31 02:59:44 +00:00
nnposter
9e0479b618 Do not include dbus support in own libpcap. See #3165 2025-08-31 02:51:18 +00:00
dmiller
9bd68008df Ensure we don't use --send-eth for localhost 2025-08-28 19:28:41 +00:00
dmiller
72b6830067 Bump version to 7.98SVN 2025-08-21 20:29:59 +00:00
dmiller
58874849d3 Reintegrate Nmap 7.98 release branch 2025-08-21 20:24:37 +00:00
dmiller
e048a3e91d Fix incorrect assertions in Nsock poll engine 2025-08-09 02:52:55 +00:00
dmiller
08cf89313d Update liblua to 5.4.8 2025-08-07 16:20:19 +00:00
dmiller
9373947e60 Use less ambiguous term for stack overflow (NOT buffer overflow) 2025-07-17 20:10:32 +00:00
dmiller
b2cdb23fc0 Cast wider before shifting. 2025-07-15 18:25:09 +00:00
dmiller
117329a5e4 Also check lower bound for attr cast to int 2025-07-15 18:24:40 +00:00
dmiller
c40965039b Check length of format option before accessing 2025-07-15 18:23:47 +00:00
dmiller
d91d876905 Avoid dereferencing freed pointer 2025-07-15 18:22:27 +00:00
dmiller
b6c3989259 Fix incorrect macro definition for eth_handle_close on Windows 2025-07-15 17:48:34 +00:00
dmiller
6637d76846 Use SOA request to get domain name in dns-zone-transfer. Fixes #3014 2025-07-14 19:17:09 +00:00
dmiller
ca0324fc2f Initialize ServiceGroup::busy member 2025-07-13 04:39:09 +00:00
nnposter
12c30c9fb2 Fix capture group overruns. Closes #3149
Last capture group in the pattern was looking for the last attribute
in the response, not the next one, and assumed that the attribute is
a sequence.
2025-07-13 02:41:15 +00:00
dmiller
89f0e62679 Handle immediate write errors in NSE. 2025-07-11 19:47:06 +00:00
dmiller
5d629274a4 Simplify using a local pointer 2025-07-11 17:08:57 +00:00
dmiller
be749705d8 Avoid runaway recursion in service scan, similar to #3130 2025-07-11 17:08:57 +00:00
dmiller
de03f68d7d Ensure DLT_EN10MB before calling arpping. Fixes #3148 2025-07-10 17:38:11 +00:00
dmiller
0945b9bd0b Fix a reported 1-byte overflow 2025-07-05 00:06:58 +00:00
dmiller
459c3c69fe Changelog entry for previous commits 2025-07-05 00:06:57 +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