1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

127 Commits

Author SHA1 Message Date
dmiller
07bc658c4a Hide error traceback for nmap.new_try() handled exceptions. Fixes #2463 2022-06-29 20:40:30 +00:00
dmiller
c58b7b2526 Fix #2496: new targets couldn't be added because singleton object was not created 2022-06-27 23:01:44 +00:00
dmiller
4c28124b77 Fix #2175: NSE script output now tagged to Target obj, not IP or targetname 2020-11-09 18:49:17 +00:00
dmiller
73ce19e7b6 Use Lua integers in more places where floats are unexpected. Fixes #1647 2019-06-26 20:13:43 +00:00
dmiller
37384c2225 Expose nbase's get_random_bytes as an alternative random source for NSE, via rand.random_string 2018-10-17 00:30:15 +00:00
dmiller
a0f55317f3 Fix inclusion of Lua headers. See #1355
We will need to do something similar for Ncat.
2018-10-16 05:18:31 +00:00
dmiller
e4f65348cb Use lua_createtable to prealloc some tables, saving time & memory 2018-06-28 03:43:25 +00:00
dmiller
7d724a69a2 Reduce a level of indirection in traceroute entries in NSE 2018-06-28 03:43:24 +00:00
dmiller
42fc53fbbf Provide raw OS fingerprint to scripts. See #223 2017-12-10 01:06:34 +00:00
dmiller
675ae460b3 Move NewTargets class to its own h/cc files 2017-08-05 21:11:00 +00:00
dmiller
891c3be3b9 remove tcpip.h from other headers' includes 2017-04-19 13:53:57 +00:00
batrick
7f5ec526fe Merge branch 'nse-lua53'
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.
2016-07-02 17:02:27 +00:00
dmiller
5e47450bdc Use forward-declaration of class FingerPrintResults in Target.h 2015-06-30 04:04:51 +00:00
dmiller
d50436def8 Let scripts set/preserve port.version.service_fp
Previously, calling nmap.set_port_version would delete a service
fingerprint if it existed. Now, setting probestate to anything but
"hardmatched" will preserve the fingerprint, if it exists. This allows
scripts (like http-server-header) to use "softmatched" to set version
info but still encourage users to submit fingerprints.
2014-09-20 05:40:43 +00:00
jay
4d5950cb42 Add (and document) host.reason and host.reason_ttl 2014-08-10 06:28:58 +00:00
jay
fc5cc15b2c Add port.reason_ttl
Document port.reason and port.reason_ttl
2014-08-10 06:14:00 +00:00
jay
b281e0bf1d Get rid of unnecessary spaces at the end of lines 2014-08-09 19:09:06 +00:00
jay
3c38c2099b If a version script is called by name (eg: '-sV --script skypev2-version'), then set version_intensity() to 9 for that script; thus guaranteeing that it will run 2014-08-03 04:16:13 +00:00
jay
341e447868 Add the nmap.version_intensity() function for use in NSE version scripts. Modify shortport.version_port_or_service() to also take a rarity parameter. 2014-07-30 07:05:58 +00:00
dmiller
ec9074f718 Correct "it's" to "its" where necessary
it's = it is
its = belonging to it
2014-06-19 04:58:46 +00:00
d33tah
421176fc00 Get rid of double newline at the EOF I accidentally introduced in the
last commit.
2014-06-18 11:30:02 +00:00
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
2014-06-18 10:18:58 +00:00
dmiller
c9714990c7 Remove trailing whitespace from C/C++ files
https://secwiki.org/w/Nmap/Code_Standards
2014-02-12 20:25:51 +00:00
d33tah
4816358475 Replace all tab characters at the beginnings of lines with 8 spaces.
Mixed indentation annoyed my vim.
2014-01-05 19:14:26 +00:00
batrick
e30122ef0a Make the catch function yieldable. 2012-11-23 03:50:17 +00:00
david
3b55096ab4 Index nmap.list_intefaces return value from 1, not 0. 2012-09-01 03:19:00 +00:00
kroosec
e7e34112db Updated nse nmap lib to reflect old rpc grind removal. 2012-08-17 18:34:59 +00:00
batrick
036d28c898 Remove nmap.sleep as we just want to have stdnse.sleep. 2012-08-07 17:25:49 +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
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
david
f813b50a4d Include service information in -oX and -oM even without -sV.
This is by Daniel Miller.
http://seclists.org/nmap-dev/2012/q1/731
2012-04-03 01:28:32 +00:00
patrik
9b9aceac92 Fix to allow cpe port table entry to be nil when calling set_port_version 2012-03-27 21:55:32 +00:00
david
b5a9bca6dc Change the structure of host.os tables.
Previously they were a flat list intermixing human-readable names and
CPE strings. Now they reflect the structure that we use to represent
them. In brief:

host.os = {
  {
    name = "Microsoft Windows XP",
    classes = {
      {
        vendor = "Microsoft",
        osfamily = "Windows",
        osgen = "XP",
        type = "general purpose",
        cpe = {
          "cpe:/o:microsoft:windows_xp"
        }
      },
      ... more classes ...
    },
  },
  ... more OS matches ...
}
2012-03-09 02:32:30 +00:00
batrick
4e7756e4de Change hostname parameter to const char *. 2012-03-04 07:26:16 +00:00
patrik
72af4637b0 o [NSE] Added host based registry, which allows scripts to share data between
scripts scanning a specific host. [Patrik]
2012-02-22 20:03:15 +00:00
henri
487c08ff63 Make gathered CPE codes available to NSE.
CPEs are available at host.os (for the ones from OS fingerprinting) and
port.version.cpe (for the version detection ones).

This patch also fix a memory leak that David noticed in
PortList::setServiceProbeResults().
2012-01-13 10:24:19 +00:00
david
9bf2ec3884 Merge from /nmap-exp/luis/nmap-os6.
svn merge --ignore-ancestry svn://svn.insecure.org/nmap@26621 svn://svn.insecure.org/nmap-exp/luis/nmap-os6

This is the IPv6 OS detection branch. "nmap -6 -O" works now, though at
this point it only prints fingerprints and not OS guesses, because we
need to collect more submissions.
2011-09-19 18:31:46 +00:00
david
04069e6166 Merge r26341:26417 from /nmap-exp/david/nmap-cpe.
This adds CPE output support.
2011-09-09 23:24:14 +00:00
gorjan
59b7ac706a Removed unnecesary variable from l_list_interfaces() in nse_nmaplib.cc 2011-07-11 22:16:05 +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
david
b4cdf40769 Make host.bin_ip and host.bin_ip_src work with IPv6 addresses. 2011-06-25 00:51:52 +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
david
4aa4a154f9 Merge from /nmap-exp/david/nmap-ipv6.
This is raw IPv6 packet support for most port and ping scans, Neighbor
Discovery, and traceroute.
2011-06-08 01:24:48 +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
3b83666a9c use a random number from /dev/urandom (nbase.get_random_uint wrapper) 2011-05-24 00:09:42 +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
david
a362d4c48f Fix condvar("signal") when there is nothing waiting on the condvar. The
logic was
  while (unsigned >= 0)
which is an infinite loop.
2011-03-05 21:16:09 +00:00
david
bf99fb231b Check that the argument to freeaddrinfo is not NULL. The behavior may be
unspecified and causes a segmentation fault on Android Bionic libc.
Vlatko fixed the bug in his Android binaries and it was first reported
by @alexismm2.
2011-02-15 08:19:58 +00:00
batrick
8c898d3938 Simplified some code. 2010-09-23 20:13:47 +00:00