1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00
Commit Graph

41 Commits

Author SHA1 Message Date
patrik
86f58e1090 Add support for returning non authoritative answers as packets 2012-04-21 21:36:51 +00:00
patrik
80e998b91f o [NSE] Added support for edns-client-subnet requests to the DNS library and
the script dns-client-subnet-scan that scans for addresses resolved from
  different subnets. [John Bond]
2012-02-19 13:22:20 +00:00
patrik
c579d844ba o [NSE] Added script dns-nsid by John Bond, that retrieves name server ID and
version information.

o [NSE] Applied patch to DNS library by John Bond that adds support for the
  CHAOS class and NSID requests.
2012-01-17 11:37:19 +00:00
henri
b7df13296e Fix a bug in dns.lua: ensure that dns.query() always return two values (status and response).
Update asn-query.nse accordingly.
2011-09-22 18:00:44 +00:00
patrik
5558837091 o [NSE] Added two new scripts broadcast-netbios-master-browser and smb-mbenum:
- broadcast-netbios-master-browser attempts to discover master browsers in
    the broadcast domain
  - smb-mbenum lists servers registered with the master browser
  [Patrik]
2011-06-19 18:47:19 +00:00
batrick
4444071f03 use # length operator instead of string.len (canonicalize)
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)).
2011-05-11 15:08:55 +00:00
david
832fae4c11 Restore working DNS updates in dns.encode.
This was broken in the merge in r22778. Patrick Donnelly noticed this
with nse_check_globals.
2011-04-27 20:33:04 +00:00
david
cd462ade8f Whitespace in dns.lua: Expand tabs, remove trailing space, change from
3-space to 4-space indents.
2011-03-28 22:52:37 +00:00
david
03a42edfe5 Parse more than one type bitmap block in an NSEC record if present. 2011-03-27 05:07:26 +00:00
david
6d90b593b7 Change the "name" member of a decoded NSEC record to be called
"next_dname" instead.
2011-03-27 05:07:16 +00:00
david
4f054a058e Remove intermediate calculations from a decoded NSEC table: WinBlockNo,
bmplength, and bin. Factor out a function to read the type bitmap.
2011-03-27 05:07:03 +00:00
david
477bd66fc9 Merge r22369:22777 from /nmap-exp/david/nmap-nsec. This adds the
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.
2011-03-27 04:24:43 +00:00
patrik
583f65227c o [NSE] Added support for dynamic updates to the DNS library. Added the
script dns-update.nse, which attempts to add a DNS record to a given zone.
  [Patrik]
2011-01-14 15:15:24 +00:00
ron
61ca42638d Merging changes from http-dns-cleanup branch. A few documentation changes, big improvement to main NSEDoc. 2010-11-02 02:15:39 +00:00
patrik
d0eecf5392 Fixed the following error reported by Ron:
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]
2010-10-29 17:19:06 +00:00
ron
af72edc2a5 Fixed a bug (misspelled variable) in dns.lua 2010-10-29 13:01:37 +00:00
patrik
2c7045aa10 Fixed variable 'host' is not declared in dns.lua, reported by Ron and
introduced by me when adding multicast support. [Patrik]
2010-10-29 05:03:39 +00:00
david
18157ed081 Merge from /nmap-exp/david/nmap-unconnected. This adds unconnected
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]
2010-10-16 00:48:44 +00:00
david
7d0c08a097 Brief copyediting of NSEDoc for modules. 2010-07-12 19:42:43 +00:00
jah
19117c80be Fixed error in dns.lua reported by Eugene Alexeev:
nselib/dns.lua:110: attempt to get length of field 'dtype' (a number value)
2010-04-10 21:25:50 +00:00
david
e942244ba2 Add a patch to dns.lua from Patrik Karlsson to cope with some mDNS
implementations.
2010-01-22 23:44:51 +00:00
david
ceaf1a9b16 Additions to dns.lua from Patrik Karlsson. Adds an answer fetcher for
TXT and SRV records, and a function get answers from the additional
section.
2010-01-20 22:54:20 +00:00
jah
fe186c5500 Normalised the return values from dns.query() (and consequently
dns.findNiceAnswer() and associated answerFetcher functions).
(see http://seclists.org/nmap-dev/2009/q3/0253.html )

Improved the handling of MX records.
2009-07-22 10:04:41 +00:00
batrick
90a712ae2b Patch to libraries that were inappropriately using globals.
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.
2009-07-07 00:20:52 +00:00
jah
3235065a1e Fixed: dns.query() calls dns.sendPackets() with the wrong number of parameters
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'
2009-04-28 22:41:53 +00:00
david
62aa04c11a In dns-zone-transfer.nse, return "<parse error>" in case domain decoding fails.
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..
2009-02-27 20:16:29 +00:00
david
2d018963ca Use dns.decStr in dns-zone-transfer.nse instead of a custom DNS decoder. This
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.
2009-02-10 00:53:26 +00:00
david
f8987ac849 Avoid a stack overflow in dns.lua. A "compressed" DNS message can have its
pointers arranged to form a loop. We put a limit on the number of pointers
we're willing to follow.
2008-11-19 19:59:51 +00:00
david
5f166e19ec Don't use empty parentheses when referring to functions by name in NSE
documentation.
2008-11-07 22:49:49 +00:00
david
3ee17ecb5c Fix NSEDoc error messages, except for some "documenting undefined parameter"
that happen when one function is defined to be another by assignment.
2008-10-24 17:05:40 +00:00
david
114e1420bb Proofread and update documentation format in base64, bin, bit, comm, datafiles,
and dns.
2008-10-24 03:56:55 +00:00
david
7e15f259a4 Standardize the @copyright fields of NSE modules; change "See nmaps COPYING for
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.
2008-10-24 00:44:22 +00:00
jah
eacb951209 Fixed typos for some nsedoc tag names:
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'
2008-10-18 20:49:00 +00:00
david
12e34eb5b0 Reformat and merge documentation for some NSE modules: comm, datafiles, dns,
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.
2008-10-15 22:03:14 +00:00
fyodor
2c00352b8e make timing a little more conservative 2008-09-15 19:05:00 +00:00
david
3121ac156d Make DNS timeouts dependent on the timing template. Patch by jah. See
http://seclists.org/nmap-dev/2008/q3/0702.html.
2008-09-15 18:56:54 +00:00
david
dfdf8a5752 Move the new version of dns.reverse that does IPv6 reverse lookups out of
ASN.nse and into the dns library.
2008-09-06 03:45:37 +00:00
kris
0399bc71c5 Give dns.lua default module name like the others if absent 2008-09-05 18:59:31 +00:00
fyodor
dc74809a68 Applied patch from Jah:
Attached corrects answerFetcher[types.TXT]() in dns.lua which inserts
v.data into answers only if v.domain is present - I believe the test
should be for v.data.  This was preventing TXT answers from being
returned from dns.query() with the retAll option.
2008-08-26 01:01:27 +00:00
pgpickering
9e6a88ad67 changed option in dns.lua 2008-08-21 10:00:25 +00:00
pgpickering
d8bb0e8c73 added NSE DNS library 2008-08-21 09:38:28 +00:00