Previously, we would only request IPv4 addresses by default, or only
IPv6 when scanning with -6. Now, we'll request both (by not passing an
address family in the hints to getaddrinfo) and report them all in the
"Other addresses" line. This should encourage more users to scan with
-6. Additionally, it allows us to catch and report attempts to scan
IPv6-only hosts via IPv4, where previously we would just say "Failed to
resolve"
Closes#76
Using the macports version, which is up-to-date, instead of the outdated
version included in the 10.5 SDK. As we update the minimum supported
version of OS X, that would improve, but not by much: 10.9 is still on
0.9.8y
Libpcap only needs libnl for monitor-mode sniffing. Disabling it lets us
not worry about which -lnl or -lnl-3 linker argument to include in our
own LIBS, so Nmap builds properly no matter whether libnl is present or
not.
Mostly just eliminating concatenation-reassignments by chaining
concatenations, reordering assignments to allow better use of bin.pack,
and using tables to store intermediate results before concatenating
them. Used strbuf as a quick fix in dhcp.lua. Eliminated some unused
string variables in vulns.lua.
Unnecessary, probably, but this eliminates 2 of 7 string
creations/collections due to concatenation and reassignment. Also
eliminates 2 unneeded table lookups and tests (since host always has
host.ip and port always has port.number), and eliminates 1 extra test
for prerule and postrule scripts, since we can't have a port if we don't
have a host.
A few bugs crept in during the conversion to LPEG parsing:
1. Unicode parsing of UTF-16 surrogate pairs returned an ending position
that was off by 2, so that the last 2 characters in the escape code were
parsed as literal characters.
2. Arrays and objects were not being tagged as such with make_array and
make_object during parsing.
This commit fixes these bugs, and returns to using unicode.utf8_enc for
UTF-8 encoding instead of a separately-defined function. Also, the tests
at the end (which were helpful in finding both of the bugs above) were
converted to unittest.lua tests.
Building a string with var = var .. "something" has miserable time
complexities. This commit cleans up a lot of that in scripts, focusing
on packing of data with bin.pack and concatenations within loops.
Additionally, a few instances were replaced with string.rep
psl_tree now takes an accumulator argument. It adds lines to the result
table instead of concatenating them together in a string. Then psl_print
concats all the lines together.
The charset argument was intended to be a table, since Lua doesn't allow
indexing strings with []. Unfortunately, irc-brute and tftp-enum passed
a string instead, which meant that the output was always the empty
string. This change allows both formats, and fixes those scripts.
irc-brute and tftp-enum had been broken since r33632 (no released
version of Nmap)
The message stating that an unknown -P* option was used contained
references to old, deprecated forms:
-PT (now -PA)
-PB (now -PE -PA)
-PI (now -PE)
Additionally, -PR was missing.