Lua 5.3 adds several awesome features of particular interest to nmap including
bitwise operators and integers, a utf8 library, and standard binary pack/unpack
functions.
In addition to adding Lua 5.3, this branch changes:
o Complete removal of the NSE bit library (in C), It has been replaced with
a new Lua library wrapping Lua 5.3's bit-wise operators.
o Complete removal of the NSE bin library (in C). It has been replaced with a
new Lua library wrapping Lua 5.3's string.pack|unpack functions.
o The bin.pack "B" format specifier (which has never worked correctly) is
unimplemented. All scripts/libraries which use it have been updated. Most
usage of this option was to allow string based bit-wise operations which are no
longer necessary now that Lua 5.3 provides integers and bit-wise operators.
o The base32/base64 libraries have been reimplemented using Lua 5.3's new
bitwise operators. (This library was the main user of the bin.pack "B" format
specifier.)
o A new "bits" library has been added for common bit hacks. Currently only has
a reverse function.
Thanks to David Fifield, Daniel Miller, Jacek Wielemborek, and Paulino
Calderon for testing this branch.
1. The first paragraph of a function's NSEdoc is used as a short
summary. Some of these were very long, so I split off a shorter summary.
2. Use asterisks (*) to denote bulletted lists, not 'o'
3. Wrap lines at 80 columns
4. a couple other spelling and formatting fixes
- broadcast-netbios-master-browser attempts to discover master browsers in
the broadcast domain
- smb-mbenum lists servers registered with the master browser
[Patrik]
Used this perl command:
$ # perl -pi -e 's/string\.len\((.*?)\)/#\1/g' *.lua
Also fixed one instance where the above command didn't correctly
translate the intended code (string.len(a .. b .. c)).
dns-nsec-enum script, originally by John Bond and improved by him and
me.
Changes in dns.lua:
Add dnssec option to dns.query that adds an OPT RR with the DO (DNSSEC
okay) flag set.
Add answer fetcher for NSEC records (unused currently).
Add decoder for NSEC records.
Add rudimentary handling of the additional section in dns.encode.
Add a check that a decoder exists before trying to call it.
Also added a copy of the simplified BSD license that the new script is
under.
NSE: test threw an error!
[string "local connect, socket_lock = ...;..."]:4: bad argument #2 to 'connect' (string expected, got boolean)
stack traceback:
[C]: in function 'connect'
[string "local connect, socket_lock = ...;..."]:4: in function 'connect'
./nselib/dns.lua:53: in function 'sendPackets'
./nselib/dns.lua:252: in function <./nselib/dns.lua:215>
(tail call): ?
(tail call): ?
(tail call): ?
(tail call): ?
././test.nse:41: in function <././test.nse:15>
(tail call): ?
[Patrik]
socket support to NSE, with updates in scripts and libraries.
o [NSE] Added the ability to send and receive on unconnected sockets.
This can be used, for example, to receive UDP broadcasts without
using pcap. A number of scripts have been changed so that they can
work as prerule scripts to discover services by UDP broadcasting,
optionally add the discovered targets to the scanning queue:
- ms-sql-info
- upnp-info
- dns-service-discovery
The nmap.new_socket function can now optionally take a default
protocol and address family, which will be used if the socket is not
connected. There is a new nmap.sendto function to be used with
unconnected UDP sockets. [David, Patrik]
Often two (or more) scripts using the same library would
overwrite the globals each was using. This would result
in (at best) an error or (at worst) a deadlock.
The patch changes the global accesses to local.
which makes the 'to' value in a for .. to loop of type 'nil' - causing:
nselib/dns.lua:54: 'for' limit must be a number
stack traceback:
nselib/dns.lua:54: in function 'sendPackets'
nselib/dns.lua:194: in function 'query'
otherwise there is an assertion failure trying to insert a nil into an output
table in tab.lua. Increase the maximum number of message compression pointers
we will follow in dns.lua from 3 to 10, because Brandon found a server that
used 4..
avoids an infinite recursion bug present in the old decoder. I raised the
number of compression pointers that dns.decStr will follow from 1 to 3 because
I found a server that sent 2.
license" to "Same as Nmap--See http://nmap.org/book/man-legal.html" like
scripts commonly use. I added the field to some modules I know to be under the
Nmap license: bin, datafiles, dns, nmap, unpwdb. I left alone bin, bit, pcre,
and url, which come from outside sources.
INFO processing file `nselib/datafiles.lua'
ERROR undefined handler for tag `type'
INFO processing file `nselib/dns.lua'
ERROR undefined handler for tag `result'
ERROR undefined handler for tag `result'
INFO processing file `nselib/netbios.lua'
ERROR undefined handler for tag `returns'
INFO processing file `nselib/snmp.lua'
ERROR undefined handler for tag `result'
INFO processing file `scripts/SSLv2-support.nse'
ERROR undefined handler for tag `ouput'
Removed a @see tag which refers to Lua's string.format rather than to NSE docs:
INFO generating file `docs/modules/stdnse.html'
ERROR unresolved reference to symbol `string.format'
http, ipOps, listop, and match. This is mainly merging the best documentation
from the module source and scripting.xml into the module, with the aim of
making the source code the canonical source for module documentation.