1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00
Commit Graph

69 Commits

Author SHA1 Message Date
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller
00064a1809 Whitespace/reindent cleanup in NSE. https://secwiki.org/w/Nmap/Code_Standards 2015-05-31 17:37:51 +00:00
jay
5f346ca88c Document nmap.version_intensity() 2014-08-09 17:49:11 +00:00
batrick
1d77f352ed Fix doc. 2014-08-03 01:19:31 +00:00
dmiller
e0a0b616b4 remove trailing whitepace from *.luadoc 2014-03-10 19:01:14 +00:00
dmiller
1b71f75aad Spelling fixes for Lua files
Mostly in documentation/comments, but a couple code bugs were caught,
including a call to stdnse.pirnt_debug and a mis-declared variable.
2014-02-19 04:15:46 +00:00
dmiller
298c42d3b4 Update the usage examples in match.lua
The example uses of nmap.receive_buf() were missing the second
parameter, keeppattern. Also referenced the match library from
nmap.receive_buf's NSEdoc to avoid reimplementations of buffered
sockets.
2014-02-10 19:39:09 +00:00
dmiller
330e5cbd39 Note that cpe is settable via nmap.set_port_version 2013-10-23 17:23:25 +00:00
dmiller
666de7b83f Clarify nmap.fetchfile only searches Nmap's paths 2013-04-26 12:14:42 +00:00
david
a4a046ac4c Let dnet:ip_send take a destination address.
Previously we always took the destination address from the packet
buffer, which failed for IPv6 link-local addresses because the packet
buffer does not contain the scope id.
2012-09-15 17:56:19 +00:00
david
44c5c227d3 Revert "Document dnet:ip_send to take a destination address."
This reverts r29795. It's not finished yet.
2012-09-15 15:06:15 +00:00
david
78cf2dfb06 Document dnet:ip_send to take a destination address. 2012-09-15 15:05:11 +00:00
david
6d0e34ad7b nmap.ip_send is for both IPv4 and IPv6. 2012-09-15 07:27:27 +00:00
david
21ba9f7b4a Undocument nmap.sleep and undeprecate stdnse.sleep.
There are various functions in the internal nmap.socket and nmap.dnet
libraries that are there for technical reasons:
	http://seclists.org/nmap-dev/2012/q1/318
The sleep function is exposed through the stdnse namespace because it
fits that library better.

Some code comments said that names such as nmap.new_socket were
deprecated in favor of e.g. nmap.socket.new, but the old names were
never formally deprecated, so I removed those comments.
2012-08-03 02:08:44 +00:00
kroosec
8c20c04d99 Documentation fixes. Changed host.name and host.targetname by host.ip and host.name 2012-07-30 13:33:05 +00:00
batrick
000f6dc4d9 Lua 5.2 upgrade [1] for NSE.
[1] http://seclists.org/nmap-dev/2012/q2/34
2012-05-27 08:53:32 +00:00
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