1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +00:00
Commit Graph

320 Commits

Author SHA1 Message Date
david
e131a1e86a Fix some awkward phrasing in -h output. Change
-A: Enables OS detection and Version detection, Script scanning and Traceroute

to

  -A: Enable OS detection, version detection, script scanning, and traceroute
2010-07-16 17:41:41 +00:00
david
16232ff34c Change the warning message for time specifications that look off by a
factor of 1000. I realized there is a bad ambiguity in

The default unit for --host-timeout is seconds (since April 2010),
so your time of "10000" is 2.8 hours.

It could be interpreted as "seconds since April 2010" which is a strange
way to specify a length of time and would be confusing if you took it
that way. I have changed it to

Since April 2010, the default unit for --host-timeout is seconds,
so your time of "10000" is 2.8 hours.
2010-07-13 17:22:58 +00:00
batrick
45a51eff5c Move Script Database Update code from nse_main.cc (Lua code embedded in C
strings) to nse_main.lua.
2010-07-07 16:31:17 +00:00
luis
da126c8b78 Merged nmap-dedup branch from nmap-exp/luis/nmap-dedup. This completes the Nmap/Nping code de-duplication phase. 2010-06-22 17:24:34 +00:00
david
2a8d0f2301 Break apart host groups when a new host has the same address as one already in
the current host group. This was already done in nexthost but only affected
ping scanning. Here in nmap.cc it takes effect for port scanning.
2010-06-09 03:12:38 +00:00
kris
0f4a5e305c update ip_is_reserved(): 177/8 and 181/8 allocated 2010-06-02 21:24:37 +00:00
fyodor
54313a53af Change --webxml nmap.xsl stylesheet location from http://nmap.org/data/nmap.xsl to http://nmap.org/svn/docs/nmap.xsl. The former just redirected to the latter anyway. Maybe it would be better to just use http://nmap.org/nmap.xsl and make that a symlink to the appropriate place. Oh well, I think this is fine for now. 2010-05-27 02:28:40 +00:00
david
238e0107f5 Fix the XML stylesheet processing instruction. It read "test/xsl"
instead of "text/xsl". This was reported by Grant Bartlett.
2010-05-24 18:56:39 +00:00
kris
15ae5ba5b2 Update the comment for ip_is_reserved(). An old comment (ca 2001, r1152)
says that the function could be outdated if IANA keeps assigning IP ranges,
but I update this function many times per year (usually consisting of more
than one IP block per update).  So in case I somehow slack on my unofficial
job of updating this function, I note that it needs frequent attention.
2010-05-21 16:42:54 +00:00
kris
9277af5e57 update ip_is_reserved(): 31/8 and 176/8 allocated 2010-05-07 16:09:49 +00:00
kris
75a17210f7 remove unneeded OS_SCAN_DEFAULT #define (multi-gen support is long gone) 2010-05-06 23:00:09 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
0e7e3b90ca Make an unqualified number stand for seconds, not milliseconds, in
tval2msecs and tval2secs. This affects the following options:
  Nmap:
    --host-timeout
    --max-rtt-timeout --min-rtt-timeout --initial-rtt-timeout
    --scan-delay --max-scan-delay
    --stats-every
  Ncat:
    -d --delay
    -i --idle-timeout
    -w --wait
  Nping:
    --delay
    --host-timeout
    --icmp-orig-time --icmp-recv-time --icmp-trans-time
Some sanity checks have been added when it looks like someone is using
the old default of milliseconds. For example,

$ ./nmap --host-timeout 10000
The default unit for --host-timeout is seconds (since April 2010), so your time of "10000" is 2.8 hours. If this is what you want, use "10000s".
QUITTING!

$ ./nmap --scan-delay 1000
The default unit for --scan-delay is seconds (since April 2010), so your time of "1000" is 16.7 minutes. Use "1000ms" for 1000 milliseconds.
QUITTING!

Times with a unit are always taken at face value and will avoid the
error message.

See http://seclists.org/nmap-dev/2010/q2/159 for discussion.
2010-04-16 00:38:51 +00:00
david
6940096a27 Use atoi to parse the argument to --max-os-tries, not tval2msecs. The
latter would allow you to do this:

$ nmap --max-os-tries 1s localhost
Bogus --max-os-tries argument specified, must be between 1 and 50 (inclusive)
QUITTING!

Because the "1s" became 1000.

atoi isn't right for option parsing because it doesn't catch errors, but
it's what the rest of the option parsing code uses.
2010-04-15 22:42:13 +00:00
david
859ef5ecaf Merge r17202:17298 from /nmap-exp/david/nmap-xml. This brings in
structured XML output, automatic closing of XML elements on error, and
inclusion of error messages in XML output.
2010-04-14 01:05:51 +00:00
kris
3f4153c956 update ip_is_reserved(): 14/8 and 223/8 allocated 2010-04-10 04:11:39 +00:00
david
6ba24a5a36 o Removed --interactive mode, a miniature shell whose primary purpose
was to hide command line arguments from the process list. It had
  been broken (would segfault during the second scan) since before May
  2009 until February 2010 and was rarely used. The fact that it was
  broken was reported by Juan Carlos Castro y Castro.

See http://seclists.org/nmap-dev/2009/q2/464 and
http://seclists.org/nmap-dev/2010/q1/688 for report and discussion.
2010-04-01 03:33:14 +00:00
david
ede6b224f5 Make it a fatal error if you try to combine traceroute with idle or
connect scan, IPv6, or non-root. Previously it only printed a warning
and disabled traceroute, which was easy to miss until the scan finished.
2010-03-24 01:12:58 +00:00
kris
9f979c6da8 use __func__, and fix space in output 2010-03-19 05:11:58 +00:00
kris
599bb361a4 Update ip_is_reserved(): I decided to go through the existing address checks
to verify their correctness and to check more than just the table in
ipv4-address-space.  Beyond comment changes and some code movement:

* 198.51.100.0/24 and 203.0.113.0/24 are reserved by RFC5737 (Jan 2010)
* Fix 198.18.0.0/15, which was implemented wrongly.  This goes back a while
and was handled somewhat like 198.18.0.0/18.
2010-03-13 01:31:11 +00:00
david
7d0fbfb4c2 Don't print output for hosts that don't have any open ports when --open
is used. See discussion at http://seclists.org/nmap-dev/2010/q1/837.

In this patch, all output formats are treated the same. So if a host
isn't shown in normal output, it's not shown in XML output either.
2010-03-12 22:15:22 +00:00
david
5318dd3c58 Only write host elements for down hosts to XML in verbose mode. This
makes it consistent with other output formats.
2010-03-12 21:20:05 +00:00
david
48654df805 Switch to -sn and -Pn as the new preferred synonyms for -sP and -P0.
This establishes a more regular syntax for some options that disable
phases of a scan:
	-n  no reverse DNS
	-Pn no host discovery
	-sn no port scan
Also, the -sP was possibly misleading because the 'P' suggests "ping
scan," when you can now do more than just pinging when you disable port
scanning. For example, -sC -sn and -sn -Pn --traceroute make sense.
2010-03-11 01:16:06 +00:00
david
34bca6a73b Fix the printing of the warning
Warning: --min-parallelism and --max-parallelism are ignored with --scan-delay.
It was checking o.min_parallelism against -1, when its default value is
0.
2010-03-06 17:48:56 +00:00
david
39a80f1987 Make --resume work with the new "Nmap scan report " strings. It also
works when there was no reverse DNS resolution, which didn't work with
the old format. This patch is from vladz.
http://seclists.org/nmap-dev/2010/q1/770
2010-03-05 23:46:42 +00:00
david
82ead9256e Make some output changes suggested by greengreat. Mention the S: SCTP
port specifier. Mention -PY in the ping probe error output. Use the word
"protocol" instead of "port" in the error output for -PO.
2010-03-05 19:54:45 +00:00
david
49e36a57f3 Add a function free_services that tells Nmap to reload the nmap-services
file again when it needs it. This is called from nmap_free_mem, because
cp_free (also called by nmap_free_mem) invalidates members of the
services data structures.

In normal use this doesn't matter. It only matters when reinvoking the
engine several times with --interactive.
2010-02-26 22:29:03 +00:00
david
9632670762 o The -v and -d options are now handled in the same way. The three
forms are equivalent:
    -v -v -v    -vvv    -v3
    -d -d -d    -ddd    -d3
  Formerly, the -ddd and -v3 forms didn't work. Mak Kolybabi submitted
  a patch.
2010-02-17 19:12:15 +00:00
kris
fd7f981bc5 update ip_is_reserved() again: 050/8 and 107/8 allocated 2010-02-12 18:05:29 +00:00
kris
c9e68798c9 Updating ip_is_reserved(): 001/8 and 027/8 allocated 2010-01-25 01:52:37 +00:00
fyodor
1636f41ba9 Fix the description of --min/max parallelism in the help screen 2010-01-18 08:19:11 +00:00
fyodor
7d5ba70591 Provide Christmas greetings and a reminder of Xmas scan (-sX) when run on December 25 in verbose mode. 2009-12-24 21:32:06 +00:00
david
a06b900f00 Merge from /nmap-exp/david/nmap-mem. This reduces the memory usage of OS
scan by about 95%. (66832396 bytes to 2815061 bytes according to
Massif.)
2009-11-23 21:22:07 +00:00
david
300e038aa6 Print host timing information ("Final times for host" and the times
element in XML) even when doing only a ping scan. Don't print the
information if it was never set; i.e., we never measured an RTT to the
target.
2009-11-16 08:36:58 +00:00
david
ecb9aa0565 Print output for down hosts, even when doing scanning past a ping scan.
This always goes to XML and grepable output. It goes to normal in
interactive output in verbose mode. The format for printing a down host
is changed slightly:
Nmap scan report for 1.1.1.1 [host down]
2009-11-16 07:37:01 +00:00
david
0b715fd28c Fix some indentation. 2009-10-29 00:46:55 +00:00
david
030411ffd8 Don't repeat the host name and IP address in "Host is up/down" messages.
Don't print the "Nmap scan report" header if there's nothing to put
under it.
2009-10-27 05:26:40 +00:00
david
01f70c5432 Write an "Nmap scan report" heading before scan results. It includes the
reverse DNS if it differs from the forward hostname.
2009-10-26 19:09:56 +00:00
david
89019cb221 Split the load_exclude function into load_exclude_file and
load_exclude_string. Use read_host_from_file in load_exclude_file to
support comments like in -iL files.
2009-09-29 02:06:56 +00:00
david
0e2d5af0f9 Factor out the function that reads a host specification from an input
file.
2009-09-29 01:15:17 +00:00
david
a3df140563 Allow # comments in input files from -iL. The patch is from Tom Sellers. 2009-09-29 00:33:41 +00:00
david
adcbd54e19 Close the -iL input file after reading. 2009-09-28 23:15:55 +00:00
david
084ba69efe Remove special-case code for doing a traceroute without a port scan, and
just handle it in the normal program flow. A problem with having two
pieces of code doing the same thing was that they varied a bit; if you
ran -sP --traceroute you wouldn't get the "Final times for host" output
because that was left out of one of the output loops. Another problem
was that the special-case logic assumed that traceroute was the only
thing that could happen after a port scan, which is not true because
script scanning can happen too. Running -sP --traceroute --script=all
would not run any scripts. Now it run asn-query and whois as expected.
2009-09-28 20:34:23 +00:00
kris
0ab7d34c88 updating ip_is_reserved(): 02/8 and 46/8 allocated yesterday 2009-09-18 19:03:33 +00:00
david
577a1be0e7 Merge from svn://svn.insecure.org/nmap-exp/david/nmap-traceroute. This
brings in a new, faster, parallel version of traceroute.
2009-09-17 00:03:46 +00:00
david
ef52f26769 Don't delete each target after doing a ping-scan traceroute; a future
implementation will have records for one target refer to others. Delete
them all at once at the end instead as is done with other scan types.
2009-09-07 22:00:42 +00:00
bmenrigh
3bce03ad8d This commit adds a new routine to nbase_rnd.c that generates 32bit
numbers in a collision-free way for a full 2^32 cycle.  This allows
Nmap to generate random IPs with -iR that don't have duplicates.

See:
http://seclists.org/nmap-dev/2009/q3/0695.html

How this is done is documented in the code.
2009-09-02 02:03:22 +00:00
david
d6ea9ea18a Fix an array bound passed to GetModuleFileName. It should be the size of
our static buffer, not 1024.
2009-08-24 20:57:32 +00:00
david
41d053a1ed Fix a stupid bug I introduced: Use MAX and not MIN to give a minimum
size to the allocation of space for the --data-length.
2009-08-24 20:47:28 +00:00
david
fec2cc40d0 Allow doing --data-length 0. That's the documented way to turn off UDP
payloads.
2009-08-19 17:52:23 +00:00