1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-29 17:49:08 +00:00
Commit Graph

12334 Commits

Author SHA1 Message Date
nnposter
003849f795 Minor code simplification using tableaux.invert 2020-12-16 18:03:08 +00:00
nnposter
1b39988bf9 Correct the return value of smb2.negotiate_v2
As documented, the function should return the negotiated SMB2 dialect,
not just reflect back the dialect override table.
2020-12-16 17:54:15 +00:00
dmiller
57b7e56a68 Fix a couple isIgnoredState calls to the new prototype. 2020-12-15 22:16:36 +00:00
dmiller
1566da56f8 Reduce/cache calls to getStateCounts 2020-12-15 21:45:56 +00:00
nnposter
27b9a90f3e Document Nmap option --noninteractive. See #1152 2020-12-07 00:52:53 +00:00
nnposter
a0172dff48 MS SQL build map true-up 2020-12-04 03:16:33 +00:00
nnposter
15e529c64f Clarify default script behavior 2020-12-04 01:16:08 +00:00
nnposter
1293291ac8 Skip lease time in DHCP client packets by default
The old behavior (of using the default time of 1s) did not allow constructing
packets without this option, which in turn resulted in (1) DHCPINFORM packets
being non-compliant with RFC 2131 and (2) DHCP discovery scripts potentially
receiving non-default IP lease information. Fixes #2197
2020-12-04 00:38:12 +00:00
dmiller
d1b39a6003 Use unsigned format specifier for unsigned value (was showing negative hosts scanned) 2020-12-02 15:30:24 +00:00
dmiller
6f57df02be Don't strip leading 0s in stdnse.tobinary
Every place this function is used, the result is padded with 0s anyway,
so may as well not strip them here. Didn't remove the padding code since
this could return only 4 chars, and most padding is to 8-char width.
2020-11-30 23:22:07 +00:00
dmiller
86deb87187 Use local functions instead of anonymous functions for gsub (less GC overhead) 2020-11-30 23:22:06 +00:00
dmiller
c8fdcd80b5 Precalc/reuse some tables and values 2020-11-30 17:59:18 +00:00
nnposter
d3ef26b229 Silence GCC warning about string truncation. Fixes #2186 2020-11-26 02:29:39 +00:00
nnposter
c00f054d3c Fix crashes when decoding codepoints larger than 255. Fixes #2192
These codepoint references are now left intact. If necessary, it would be
a trivial change to replace them with corresponding UTF sequences.

Note that the previous code was decoding the character references recursively,
which was probably not the intent.
2020-11-25 02:14:03 +00:00
dmiller
169d7e5a92 Restore call to post_connect in non-ssl case. Fixes #2149 2020-11-19 17:34:24 +00:00
dmiller
f4fb91912d New script port-states expands hidden port state summaries 2020-11-16 21:41:46 +00:00
dmiller
0de714e8d3 New option --unique to prevent scanning same address twice. See #2180 2020-11-15 04:57:44 +00:00
nnposter
7400723efa Improvements to script hostmap-crtsh
* Avoids accepting identities not representing hostnames as new targets
* Identity representing a wildcard certificate is reduced to its static portion
* Replaces custom crt.sh response parsing with JSON parser
* Adds more error-checking code
* Splits SANs into individual names (closes #2174)
2020-11-15 01:37:45 +00:00
nnposter
f4e19b17ea Change PJL command termination from LF to CR/LF
The PJL specification (HP publication 5021-0380) makes the CR optional
but apparently it is required by some implementations. Fixes #2182
2020-11-14 23:29:05 +00:00
dmiller
eb029afd7c Minor performance tweaks to core NSE functions. 2020-11-10 00:08:38 +00:00
dmiller
4c28124b77 Fix #2175: NSE script output now tagged to Target obj, not IP or targetname 2020-11-09 18:49:17 +00:00
dmiller
a877e2cb9b Use string unpack instead of string.byte 2020-11-06 21:48:33 +00:00
dmiller
8eebe86ee9 http.lua: Reuse constant objects instead of creating them 2020-11-06 21:48:32 +00:00
dmiller
5eced2c1a5 Reuse constant objects instead of creating them for frequently-used functions 2020-11-06 21:48:31 +00:00
dmiller
041838d986 Clean up packet.lua, add a few unit tests. 2020-11-04 22:26:58 +00:00
dmiller
82be54a353 Convert exception to string first; Fixes #2157 2020-11-01 03:24:17 +00:00
dmiller
74296582e2 Hide a minor warning behind -v. Fixes #2166 2020-10-30 14:07:02 +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
c3f8620f1a Use finer-tuned pcap filters for various scans for efficiency 2020-10-23 03:42:27 +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
78751f8668 Ensure host_timeout is initialized 2020-10-22 19:02:05 +00:00
dmiller
19286e796d Fix ICMP Time Exceeded handling. See #110, #2153
We attempted to fix this twice already, so this change reverses r36709
(which simply ignored all Time Exceeded messages for host discovery,
leading to long scan times when the TTL is insufficient) and r34557
(which used incorrect logic to match ICMP responses, resulting in
ignoring all ICMP error messages in response to ICMP probes, e.g. Time
Exceeded for Echo Request).

Instead, we'll correctly verify that the ICMP ID of the *encapsulated
datagram* matches the one for the probe we are attempting to match.
2020-10-21 20:51:15 +00:00
dmiller
532d5a555e Add openflow-info.nse. Closes #711 2020-10-19 17:13:23 +00:00
dmiller
72ff06d02b Avoid testing invalid usernames 2020-10-19 17:13:22 +00:00
dmiller
81bc933118 Return correct error ID 2020-10-19 17:13:21 +00:00
nnposter
f6b40614e4 Fix a Unix domain socket crash. Fixes #2154 2020-10-16 02:54:52 +00:00
dmiller
06b9904228 Updates to nmap-payloads. Closes #1895. Closes #1279 2020-10-16 00:16:45 +00:00
dmiller
88b96c4052 [ci skip] Remove done tasks and existing issues in our tracker from the todo file 2020-10-15 20:03:33 +00:00
dmiller
6f335b8fc9 Avoid assertion failure when match capture at end of text is empty.
First reported here: https://seclists.org/nmap-dev/2014/q2/105

We handle empty strings just fine, so treat it like that instead of
asserting that the capture must start before the end of the string.
2020-10-15 20:03:33 +00:00
dmiller
922b8cbbc4 Remove constant comparisons for values that cannot exceed the max 2020-10-15 18:51:20 +00:00
dmiller
c4cfe174be Remove a redundant condition (this branch is always res>0) 2020-10-15 18:19:06 +00:00
dmiller
9faf70fc78 Remove always-true condition, but be clear that n does not change in this function 2020-10-15 18:10:14 +00:00
fyodor
608d866fb7 fix typo: it's -> its 2020-10-15 18:06:31 +00:00
dmiller
3c5b7107d5 Avoid warnings about signedness in comparisons. See 2150 2020-10-15 17:45:48 +00:00
dmiller
f48d12a591 Avoid importing *, possibly polluting namespace 2020-10-15 17:17:34 +00:00
fyodor
e7188d653f Tiny reordering 2020-10-14 18:17:14 +00:00
dmiller
a5cca6f6a3 Remove replacement strlcat (unused) from libdnet-stripped 2020-10-13 20:13:38 +00:00