1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-10 00:19:02 +00:00
Commit Graph

12350 Commits

Author SHA1 Message Date
dmiller
28bfe0dfd2 Use checked versions of FD_* macros. Closes #2202 2021-01-07 17:52:24 +00:00
dmiller
3ecec3f4dc Correct to DTD, explicitly show empty output. See #2216
This shouldn't happen, so we'll print a "bug" error message so users
notify us.
2021-01-01 19:25:56 +00:00
dmiller
9a3a8d1593 Check for output before returning. See #2212 2020-12-30 23:31:36 +00:00
dmiller
1943c0a2fc Simplify output_table __index metamethod
From Lua 5.3 docs: "Despite the name, the metamethod for this event can
be either a function or a table. [...] If it is a table, the final
result is the result of indexing this table with key."
2020-12-30 23:31:35 +00:00
dmiller
e7b40571ef Correct the DTD for hosthint element. Fixes #2217 2020-12-30 23:31:35 +00:00
nnposter
77f764fe72 Add script nbns-interfaces. Closes #2201 2020-12-30 03:51:21 +00:00
dmiller
ef2bafb09c Report system error message when fopen fails 2020-12-28 17:51:16 +00:00
nnposter
f6fbb29481 Improve output formatting
- EHLO output no longer has a trailing separator
- Strings "214" and "250" are now removed only from the line beginning
2020-12-27 00:38:53 +00:00
nnposter
eecf225310 Fix word-wrapping 2020-12-27 00:25:40 +00:00
nnposter
9334c9fd5d Ncat certs should last for one year
Old Ncat versions were using one year but during OpenSSL API refresh (r36533),
the duration was accidentally changed to one minute by copying Ncat test code
from ncat/test/test-wildcard.c
Fixes #2167, closes #2168
2020-12-24 00:35:38 +00:00
dmiller
cd63da6ba0 Update DTD and changelog entry for previous change 2020-12-17 22:12:05 +00:00
dmiller
38671f2225 Enhance output to print proto, reason, and port list for ignored ports
Normal output will report count, protocol, and reason for each group of
ports in an ignored state (usually closed or filtered when there are
more than 25 ports in one of those states).

XML output will contain a consolidated list of port numbers as well.
2020-12-17 22:12:04 +00:00
dmiller
19daadfd31 Short-circuit 0-ports-scanned case, which already gets special treatment as 'Skipped port scan' output 2020-12-17 22:12:04 +00:00
dmiller
bad0e61739 Fix grepable output when all scanned ports are ignored
Previous behavior was to output an extra host status line "Status: up"
New behavior outputs an empty "Ports: \t" then the "Ignored State"
field.
2020-12-17 17:34:32 +00:00
dmiller
790beb2419 Simplify: No way to have only 1 scanned port in ignored state. 2020-12-17 17:34:32 +00:00
nnposter
d0cf36c0a7 Fix false positives due to missing start/boot time
SMB field ServerStartTime ['start_time'] of zero should be interpreted
as "no time provided", not as the start of the epoch.
The field is zeroed out in SMB dialect 3.1.1.
2020-12-16 19:19:15 +00:00
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