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

115 Commits

Author SHA1 Message Date
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
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
10d23e924f trivial: move a statement back closer to its context 2010-09-17 20:30:27 +00:00
djalal
c9a756bc12 Clean debug messages and make debug level 3 the default debug level for the 'adding new targets' code. 2010-09-03 17:53:34 +00:00
djalal
c7c502b227 Merge r19520:r20039 from nmap-exp/djalal/nmap-add-targets. This will let NSE scripts to add new discovered targets to future Nmap scans. 2010-09-01 01:50:34 +00:00
david
b2350aa947 o [NSE] Host tables now have a host.traceroute member when --traceroute
is used. This array contains the IP address, reverse DNS name, and RTT
  for each traceroute hop. [Henri Doreau]
2010-08-28 15:50:10 +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
11e70075fa Revert r19975, wrong external. 2010-08-26 19:51:22 +00:00
david
611cc22676 Fix a copy-paste error. 2010-08-26 19:50:45 +00:00
kris
57664a51cf Committing MTU-related changes:
* Adding path-mtu.nse for Path MTU Discovery
* Nmap now stores the MTU for interfaces (from SIOCGIFMTU or libdnet)
* Scripts can access the MTU for host.interface via host.interface_mtu
* Nmap prints the MTU for interfaces in --iflist
2010-08-24 01:47:12 +00:00
kris
412fcbcca0 o [NSE] Added a "times" table to the host table passed to scripts.
This table contains Nmap's timing data (srtt, the smoothed round
  trip time; rttvar, the rtt variance; and timeout), all represented
  as floating-point seconds.  The ipidseq and qscan scripts were
  updated to utilize the host's timeout value instead of the very
  conservative guess of 3 seconds for read timeouts. [Kris]
2010-08-05 01:55:05 +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
batrick
b70fe49adf Compact/share some code. 2010-07-19 12:25:24 +00:00