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

79 Commits

Author SHA1 Message Date
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
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
for file in `grep "* including the terms and conditions of this license text as well.       \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well.       \*/* including the terms and conditions of this license text as well.        */g" -i $file; done
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
david
7cb2946d60 Actually set the base addr in NetBlockIPv6Netmask.
This is needed for proper copying of the scope_id.
2013-01-26 05:31:33 +00:00
david
249c566196 Have NetBlock::next return the socklen.
This matters on OS X; with the wrong size, connect scans give "Invalid
argument".
Reported by Jesper Kückelhahn.
http://seclists.org/nmap-dev/2013/q1/84
2013-01-26 05:31:33 +00:00
david
010969b77f Set sa_len of IPv4 to sizeof(sockaddr_in), not sizeof(sockaddr_storage). 2013-01-26 05:31:32 +00:00
david
94fd369de7 Clear the sockaddr_in before filling it in. 2013-01-26 05:31:31 +00:00
david
b8e4f8832c Initialize NetBlock members. 2013-01-26 05:31:30 +00:00
david
e1fba2d663 Merge r30416:30527 from /nmap-exp/david/ipv6-ranges.
This is a refactoring of target parsing that stores different types of
target specifications as different classes. The eventual intention is to
allow easy iteration over each specification for the purpose of IPv6
multicast host discovery.
2013-01-22 00:01:08 +00:00
david
93b978fba8 Merge 30432:30436 from /nmap-exp/david/ipv6-ranges.
This is simple IPv6 unicast ranges. For example,
nmap -6 en.wikipedia.org/120 -sn

The other, more complicated part of this overall change is automatic
multicast scanning of large local subnets. That part isn't done yet.
2012-12-19 01:10:39 +00:00
david
3afb4c9992 Remove TargetGroup::skip_range.
This was left over from when TargetGroup was used for exclude.
2012-12-17 23:18:58 +00:00
david
55e210d589 Formatting in TargetGroup.{cc,h}.
astyle -a -p -H -s2 -m2 TargetGroup.cc TargetGroup.h
2012-12-17 22:41:13 +00:00
david
bfead6f4b7 hostexp[i] is a nicer way to write *(hostexp + i). 2012-12-17 22:39:23 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
bd1b2ccf98 Make it a warning (not a fatal error) when there's a problem with an IPv4 spec.
This is the way it worked for IPv6 (with the exception of a slash in an
IPv6 address, which has also been made into a warning)--warn about the
bogus specification and carry on with the other targets.

The main use for this is preventing the whole scan from being stopped
when a bad specification appears in a hostgroup after the first.
2012-04-27 06:27:01 +00:00
david
652fb94405 Make -e assign IPv6 scope ids for everything, not only route_dst.
You could use "-e en0" to automatically add scope ids to your IPv6
addresses, so you didn't need the write "fe80::1234%en0". But this only
happened for the route_dst calculation, and could lead to later failures
in sendmsg when the address didn't have a scope id.
2012-03-27 21:48:53 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
david
6987814beb Remove extra const qualifiers.
Some function declared parameters like this:
	int f(const char * const s)
Where appropriate, I changed to
	int f(const char *s)

The second const is a qualifier on the pointer itself; i.e., the value
of s may not be changed (may not be made to point to anything else)
within the function. This is probably not what was intended. The first
const is what prevents modifying things referenced through s.
2011-10-13 20:52:03 +00:00
fyodor
cee8ed9068 Add a note to the failed to resolve error message that you might need to use -6. It is a mistake I keep making :) 2011-09-19 23:37:05 +00:00
weilin
05bcbe71d9 Remove unused TargetGroup::rewind method. It was used for --exclude groups before that code was rewritten to use addrset. 2011-08-04 02:37:05 +00:00
david
17d49b21fa Fix "value computed is not used" warning. 2011-05-30 17:34:11 +00:00
david
a2e58b4875 Use sockaddr_storage_equal in place of sockaddr_storage_cmp where
appropriate.
2011-05-07 00:50:54 +00:00
djalal
4ea062b1e3 Check if the added target is too long. Currently we are using std::string objects to store new targets but we want to make sure that the script is not adding long strings. 2011-04-03 14:38:34 +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
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
26636d3cf7 Remember the forward DNS name and non-scanned addresses for IPv6, just
as for IPv4. This makes the output more uniform and gives NSE access to
host.targetname for IPv6 hosts.

This is what IPv4 output looks like:

$ nmap -sL www.kame.net
Nmap scan report for www.kame.net (203.178.141.194)
rDNS record for 203.178.141.194: orange.kame.net
Nmap done: 1 IP address (0 hosts up) scanned in 0.16 seconds

$ nmap -sL www.debian.org
Nmap scan report for www.debian.org (128.31.0.51)
Other addresses for www.debian.org (not scanned): 206.12.19.7
rDNS record for 128.31.0.51: senfl.debian.org
Nmap done: 1 IP address (0 hosts up) scanned in 0.17 seconds

Here is the output before this change. Notice that the target name is
missing and there is no separate "rDNS" line.

$ nmap -6 -sL www.kame.net
Nmap scan report for 2001:200:dff:fff1:216:3eff:feb1:44d7
Nmap done: 1 IP address (0 hosts up) scanned in 0.04 seconds

$ nmap -6 -sL www.debian.org
Nmap scan report for bellini.debian.org (2607:f8f0:610:4000:211:25ff:fec4:5b28)
Nmap done: 1 IP address (0 hosts up) scanned in 0.11 seconds

Here is the output after this change:

$ ./nmap -6 -sL www.kame.net
Nmap scan report for www.kame.net (2001:200:dff:fff1:216:3eff:feb1:44d7)
Nmap done: 1 IP address (0 hosts up) scanned in 1.04 seconds

$ ./nmap -6 -sL www.debian.org
Nmap scan report for www.debian.org (2607:f8f0:610:4000:211:25ff:fec4:5b28)
rDNS record for 2607:f8f0:610:4000:211:25ff:fec4:5b28: bellini.debian.org
Nmap done: 1 IP address (0 hosts up) scanned in 0.07 seconds
2010-11-26 04:06:25 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
djalal
73ca070916 Small change on code documentation. 2010-09-09 12:59:35 +00:00
djalal
d2773a09a7 Make NewTargets::push() return 1 if the target is already in the queue to avoid returning 0 (error code). 2010-09-09 12:56:43 +00:00
david
430a1287a6 Remove NOLUA guards around NewTargets code. This code compiles fine
--without-liblua.
2010-09-07 19:23:56 +00:00
djalal
4bec98f23f Small debug message improvements, to show if a new target was successfully added. 2010-09-06 21:02:38 +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
luis
c7be757035 Fixed small format specifier error that caused a compiler warning 2010-06-22 17:47:32 +00:00
david
d90b7b15a7 Make a new function called resolve_all in tcpip.cc, which is like
resolve except that it returns all resolved addresses. Use this new
function to resolve IPv4 addresses instead of gethostbyname in
TargetGroup.cc. The gethostbyname code assumed that only IPv4 addresses
would be returned. If the resolver returned IPv6 addresses, TargetGroup
would blindly copy the first four bytes of the IPv6 address into the
IPv4 struct. This was first reported by Mats Erik Andersson at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584301; he also
suggested the fix.
2010-06-19 00:13:44 +00:00
david
57238b7df5 Print the addresses that were resolved but not scanned in each scan
report. It looks like this.

$ ./nmap google.com -sn

Starting Nmap 5.30BETA1 ( http://nmap.org ) at 2010-05-10 23:57 MDT
Nmap scan report for google.com (66.102.7.99)
Host is up (0.073s latency).
Other addresses for google.com (not scanned): 66.102.7.104
rDNS record for 66.102.7.99: lax04s01-in-f99.1e100.net

This replaces the line

Hostname google.com resolves to 2 IPs. Only scanned 66.102.7.99
2010-05-11 05:59:09 +00:00
david
fea2ad0a33 o Moved the parse_long function from ncat to nbase for better reuse,
and used it to simplify netmask parsing code. This patch was
  contributed by William Pursell.
2010-05-08 21:08:55 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
a4fc71afb6 Return the last host before skipping an octet in an IPv4 range exclude
group. Not doing this was the cause of off-by-one errors that led to
assertion failures and, potentially, excluded hosts being scanned. Here
is the comment I added:

  /* The decision to skip a range was based on the address that came immediately
     before what our current array contains now. For example, if we have just
     handed out 0.0.0.0 from the the range 0-5.0.0.0, and we're asked to skip
     the first octet, we want to advance to 1.0.0.0. But 1.0.0.0 is what is in
     the current array right now, because TargetGroup::get_next_host advances
     the array after returning an address. If we didn't step back we would
     erroneously skip ahead to 2.0.0.0. */
2009-11-18 01:17:59 +00:00
david
bf29b139bd Only print the first warning that a name resolves to multiple addresses
(the one that happens right after then name is resolved) with -vv. That
information is also printed out above the ports table later.
2009-10-27 06:16:22 +00:00
david
398e53b3de Keep trace of the list of addresses a name resolved to, and print out
how many there were if there were more than one.
2009-10-27 06:08:04 +00:00
david
cb9222bd20 Fix TargetGroup::is_resolved_address. It was actually checking against
the address that was the start of a netmask range.
2009-10-27 05:08:05 +00:00
david
c9fb13b4bb Add methods to TargetGroup to record the name or address that was the
"base address" from which a group of addresses were derived, for example
in "scanme.nmap.org/24", "scanme.nmap.org" would be the base address.
Use these methods to set the target name of that one host even when
addresses come from a netmask.
2009-10-26 23:15:43 +00:00
josh
df71e36084 Updated uses of the ctype function to support explict casting of the arguments
to (int)(unsigned char).
2009-08-06 15:10:00 +00:00
jah
89dc4fca57 Improved the parsing of host expressions to handle a few cases where supplying invalid targets would cause Nmap to scan unintended hosts.
See http://seclists.org/nmap-dev/2009/q2/0319.html for more detail.
2009-05-13 09:09:55 +00:00
jah
e8f696571e Improved a couple of indents which I messed-up in the last commit. 2009-05-12 23:36:40 +00:00
jah
66fc9a039e Fixed some whitespace anomalies. 2009-05-12 22:59:33 +00:00
fyodor
d0e21e1d03 Suggest that people send patches to nmap-dev rather than to me directly 2009-04-15 00:37:03 +00:00