1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00
Commit Graph

53 Commits

Author SHA1 Message Date
gorjan
abf2a20866 Adding the NSE nmap.list_interfaces() function that lists all interfaces available to Nmap. 2011-07-05 00:01:35 +00:00
gorjan
fc2f88e2ed Added the nmap.get_ttl() which returns the TTL (time to live) specified with the --ttl option;
Added the nmap.get_payload_length() function which returns the value specified with the --data-length option
2011-06-24 01:03:23 +00:00
djalal
c57de44417 A small fix to the NSEDoc. 2011-06-21 20:24:57 +00:00
david
62c177b84b List formatting for get_interface_info NSEDoc. 2011-06-21 18:21:03 +00:00
david
873f2dbb64 Fix broken comment in nmap.luadoc.
Preventing get_interface from appearing in documentation.
2011-06-21 18:16:39 +00:00
batrick
a26f606ecd Just use srand on NSE startup in nse_main.cc. This removes the need
for a binding which will probably not be useful for script writers
when they have OpenSSL's PRNG already available.
2011-05-24 02:48:39 +00:00
batrick
5fc587c20c nsedoc for nmap.get_random_uint. 2011-05-24 00:18:06 +00:00
gorjan
1d01038a1e Small fix in nmap NSE library documentation 2011-05-02 23:23:13 +00:00
djalal
e91c3505be o [NSE] Removed the nmap.get_interface_link function, which was
deprecated by the new nmap.get_interface_info function.
2011-04-22 22:47:28 +00:00
david
c36cf833e6 Add the nmap.get_interface and nmap.get_interface_info functions by
Djalal Harouni.
2011-04-05 06:11:58 +00:00
kris
1317675fb3 Document the status return value for nmap.resolve(). Patrik noticed the
omission.
2010-11-19 21:38:47 +00:00
batrick
c30cb92e81 Corrected and reformatted the raw packet I/O documentation. 2010-11-05 14:01:05 +00:00
david
877cbab16f o [NSE] Added reporting of the type and bit size of certificate public
keys to ssl-cert.nse. [Matt Selsky]
2010-10-20 05:49:17 +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
batrick
de4ba536de Merge from /nmap-exp/patrick/nse-nsock-maintenance.
This is a maintenance fix for the NSE Nsock library binding. The patch focuses
on code correctness and simplicity. The patch also brings some initial updates
with an eye towards the upcoming Lua 5.2 release. See [1] for a post concerning
this branch.

[1] http://seclists.org/nmap-dev/2010/q3/710
2010-09-18 20:35:09 +00:00
kris
8729f667fe Some new NSE functions:
o [NSE] Added the nmap.resolve() function which takes a host name and
  optionally an address family (such as "inet") and returns a table
  containing all of its matching addresses.  If no address family is
  specified, then all of the addresses are returned for the name. [Kris]

o [NSE] Added the nmap.address_family() function which returns the address
  family Nmap is using as a string (e.g., "inet6" is returned if Nmap is
  called with the -6 option). [Kris]
2010-08-27 04:17:51 +00:00
david
3c89e089fc Change calls in these forms:
socket:connect(host.ip, port.number)
socket:connect(host.ip, port.number, port.protocol)

to this:

socket:connect(host, port)

connect can take host and port tables now, and the default protocol is
taken from the port table if possible.
2010-08-16 18:59:30 +00:00
david
bfffa53616 When nmap.connect gets a port table, let port.protocol be the default
protocol (instead of always "tcp"). You can still override it by
providing an explicit protocol after the table.
2010-08-16 18:09:04 +00:00
david
0e3c861ea0 Let nmap.connect take a host table and port table in place of a string
and an integer. This is going to be used to easily support Server Name
Indication for SSL connections.
2010-08-16 17:35:20 +00:00
kris
33fa744392 fix function name typo in @usage doc 2010-07-24 20:24:55 +00:00
kris
cc33a59ca4 Add nmap.clock() for providing scripts with the current time in floating
point seconds since the epoch, and add clock_ms() and clock_us() to stdnse
for convenience (millisecond and microsecond).

qscan.nse now provides microsecond resolution.
2010-07-23 19:49:42 +00:00
kris
ee3c89afe4 o [NSE] When receiving raw packets from Pcap, the packet capture time
is now available to scripts as an additional return value from
  pcap_receive().  It is returned as the floating point number of
  seconds since the epoch.  The qscan.nse script was updated to use
  this more accurate data instead of using the clock_ms() function
  (which returns the current time). [Kris]
2010-07-23 10:43:04 +00:00
david
7d0c08a097 Brief copyediting of NSEDoc for modules. 2010-07-12 19:42:43 +00:00
david
1038dc8bcd Fix an error in the documentation for get_ssl_certificate. 2010-06-13 23:34:13 +00:00
kris
a42ea72a97 Merge through r16884 from /nmap-exp/kris/nse-rawip plus the following changelog
entries:

o [NSE] Raw packet sending at the IP layer is now supported, in addition to
  the Ethernet sending functionality.  Packets to send start with an IPv4
  header and can be sent to arbitrary hosts. [Kris]

o [NSE] Added the ipidseq script to classify a host's IP ID sequence numbers
  in the same way Nmap does.  This can be used to test hosts' suitability for
  Nmap's Idle Scan (-sI), i.e. check if a host is an idle zombie.  This is
  the first script to use the new raw IP sending functionality in NSE. [Kris]

o [NSE] Added the function nmap.is_privileged() to tell a script if, as far
  as Nmap's concerned, it can do privileged operations.  For instance, this
  can be used to see if a script should be able to open a raw socket or
  Ethernet interface. [Kris]

o [NSE] Added the function nmap.get_ports() to allow a script to iterate
  over a host's port tables matching a certain protocol and state. [Kris,
  Patrick]
2010-02-26 20:42:10 +00:00
kris
003cc98eab nmap.luadoc typos 2010-02-12 23:41:56 +00:00
batrick
da041cb0b3 Get rid of <em>/<strong> tags because there is no uniform
way to use them across DocBook and HTML.
2010-01-16 01:59:12 +00:00
batrick
d1a4984d8d Fixed a typo. 2010-01-16 01:38:38 +00:00
batrick
e94da5d874 Use em/strong tags instead of <b>. 2010-01-10 03:18:05 +00:00
batrick
2b3df5882f [NSE] Patch to add worker threads to NSE for scripts to use. Right
now a script is limited in parallelism to working on one socket at any
time. A script can now create a worker thread that will be capable of
doing work on sockets in parallel with the parent script. See [1] for
more information.

This patch also comes with condition variables that are similar to
POSIX condition variables. They are used in the same fashion as
NSE's mutexes (nmap.mutex).

[1] http://seclists.org/nmap-dev/2009/q4/294
2009-11-12 01:33:52 +00:00
batrick
8f3ecdbb8b Cleaned up documentation for mutexes. Also added note that NSE
only maintains a weak reference in the background.
2009-11-12 01:20:19 +00:00
david
a8821f3cf4 Add the NSE function nmap.bind, which sets the source address of a
socket.
2009-10-11 23:08:43 +00:00
batrick
afa84d2320 [NSE] Added the reconnect_ssl method for sockets. We sometimes need
to reconnect a socket with SSL because the initial communication on the socket
is done without SSL. See this thread [1] for more details.

[1] http://seclists.org/nmap-dev/2009/q4/3
2009-10-06 13:02:12 +00:00
david
361f10fc90 Update NSEDoc to say that nmap.get_port_state can return nil if you pass
it a port that was not scanned.
2009-09-29 14:58:44 +00:00
david
8ba33e607b Make it clear in the NSEDoc that error values can be any false value:
<code>false</code> or <code>nil</code>. Basically it's anything that
matches the protocol of an nmap.new_try handler.
2009-09-14 15:56:49 +00:00
david
6c766c58cd Add the nmap.get_ssl_certificate NSE function, which returns the peer
certificate of an SSL socket.
2009-08-13 23:32:33 +00:00
david
276a2f195c [NSE] Scripts that are listed by name with the --script option now
have their verbosity level automatically increased by one. Many
will print negative results ("no infection found") at a higher
verbosity level. The idea is that if you ask for a script
specifically, you are more interested in such results.
2009-07-12 19:35:56 +00:00
batrick
3016193c11 Improvements to the nmap library. See [1] for discussion and a full listing of
the changes.

[1] http://seclists.org/nmap-dev/2008/q4/0663.html
2008-12-29 21:59:08 +00:00
david
9b82189c39 Make the documentation for nmap.new_try more clear on a suggestion by Patrick. 2008-12-29 04:08:43 +00:00
batrick
f08596bf49 Fixed a misspelling. 2008-12-09 01:37:10 +00:00
david
041e39f88a Fix a typo in nmap.luadoc. 2008-11-20 17:27:05 +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
854b3460b5 Fix an inaccuracy in the documentation for the nmap.receive_lines and
nmap.receive_bytes functions. It claimed that if you don't get all the
lines/bytes you request before a timeout, then a "TIMEOUT" error happens. In
reality you get back data as long as at least one byte was received before the
timeout. From nsock_readlines:

/* Read up to nlines lines (terminated with \n, which of course
   inclues \r\n), or until EOF, or until the timeout, whichever comes
   first.  Note that NSE_STATUS_SUCCESS will be returned in the case
   of EOF or tiemout if at least 1 char has been read.  Also note that
   you may get more than 'nlines' back -- we just stop once "at least"
   'nlines' is read */
2008-11-04 22:39:07 +00:00
david
d0e545b49c Proofread and update documentation of nmap, openssl, packet, and pcre. 2008-10-24 19:08:27 +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
a2ca60092c Remove module and object prefixes from function names in .luadoc files, as
suggested by jah in http://seclists.org/nmap-dev/2008/q4/0232.html. This makes
@see cross-references to functions in these files work from other modules.
2008-10-24 15:57:11 +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
david
20137202d9 Change nmap.luadoc to use Unix line endings. 2008-10-21 22:35:10 +00:00
david
06b661f2ef Fix the documentation for nmap.new_try, because it was incorrect. The result of
nmap.new_try is not a function accepting another function, it is a function
taking a variable number of arguments, assumed to be the return value of some
function. In other words, the returned try function is not responsible for
running other functions, it only sees their return values.
2008-10-16 22:21:08 +00:00