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

171 Commits

Author SHA1 Message Date
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
aa76963dcd Check for an address family mismatch after parsign NetBlocks.
This caused a segfault in reverse DNS resolution when the v4hostip of an
IPv6 target was accessed:
./nmap -sL 2001:500:88:200::10
2013-04-22 21:56:09 +00:00
david
5583156725 Check for an empty host batch before ping scanning.
This was a regression related to target deferral. It caused a null
pointer dereference if all your targets failed to resolve or were
excluded.
2013-03-01 02:10:53 +00:00
david
0b20c18f90 Limit the number of HostGroupState targets we will defer.
This prevents potentially reading (and buffering) every input host while
looking for more targets to fill up the current hostgroup. One of the
criteria that can split hostgroups is interface. Suppose you have an
input list of targets whose interfaces are
	eth0 eth0 eth0 wlan0 wlan0 wlan0 wlan0 wlan0 wlan0...
The first three eth0 will go in the first group, and then the following
wlan0 will start to be buffered while we look for more eth0. But we will
only look ahead 64 targets, then go ahead and scan the three eth0.
2013-02-26 03:39:25 +00:00
david
136b8fa280 Add a defer buffer to HostGroupState.
This allows some targets to be skipped over yet remembered so they can
be dealt with later. The idea is that because ping groups are not
allowed
to have duplicate IPs, we continue searching for non-duplicates in order
to fill up a ping group, then return to what were formerly duplicates.
This prevents potentially large ping groups from being split into small
groups.

For example, if the list of targets is
        A B C D A B E A F G
the ping groups used to be
        (A B C D) (A B E) (A F G)
but now they are
        (A B C D E F G) (A B) (A]

A similar thing can be done for port scan hostgroups, but this already
does most of the work because ping groups are generally bigger than
hostgroups and have pretty much the same restrictions.
2013-02-26 03:39:24 +00:00
david
5dbfba4799 Remove stray semicolon. 2013-02-26 03:39:23 +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
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
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
03d4b03d2c Get rid of "using namespace std".
Importing the whole std namespace caused a problem with Clang and the
punning of bind and std::bind.

http://seclists.org/nmap-dev/2012/q4/58

The Web's opinion of "using namespace std" also seems to be more against
than for.
2012-10-11 04:45:50 +00:00
david
1cb72a4928 Do ARP/ND scan with -PR --disable-arp-ping.
These options look contradictory, but --disable-arp-ping is really an
option to disable *implicit* ARP ping when you haven't asked for it.
Actually requesting ARP should still do ARP scan. The contradiction that
remains is the option name --disable-arp-ping, which doesn't exactly do
what it says.

The idea here is that you can just throw --disable-arp-ping at the end
of your command lines, and implicit ARP scan will always be disabled,
and any command using -PR will continue to work.
2012-07-16 18:26:39 +00:00
david
31bbb65c07 Add implicitARPPing option to NmapOps. 2012-07-16 18:11:20 +00:00
david
70d728ffcf Make "failed to determine route" a warning, not a fatal error. 2012-05-16 23:50:03 +00:00
david
5067f767b7 Add the new <target> element to XML output.
This element is intended to report information about command-line target
specifications. Now it's used with status="skipped" to indicate that a
specification was ignored.
2012-05-04 15:04:41 +00:00
david
ac8b76ec81 Rework a loop to give access to the condition. 2012-04-27 06:27:03 +00:00
david
f511045723 Make the two versions of target_needs_new_hostgroup the same.
Up to data structure differences. I'm not sure why they differed to
begin with, though I remember writing the comment that explains that
they differed. This is related to a problem reported by Daniel Miller:
http://seclists.org/nmap-dev/2012/q1/675.
2012-04-17 22:55:09 +00:00
david
89987139db Fix the check for duplicate addresses in target_needs_new_hostgroup. 2012-04-17 22:55:09 +00:00
david
2fa4737b7d Correct a comment. 2012-04-17 03:35:32 +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
6cbd5a9a58 Allow --exclude and --excludefile together. 2011-12-08 23:16:57 +00:00
david
262ec8f7d7 Keep a std::string in scope when accessing its c_str.
The std::string was being created and deleted in a single statement, so
its c_str pointer pointed to freed memory. This could be seen with

valgrind nmap --exclude foo
2011-07-29 20:43:31 +00:00
david
9a64d66a1e Clarify an ambiguous if/else. 2011-07-19 21:40:32 +00:00
weilin
1dcf652410 Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
colin
dc4e67dffc Fixed broken --exclude in nmap.
--exclude 1.2.3.4,5.6.7.8 now works.
2011-06-21 18:05:25 +00:00
david
5f99b2ad9e Remove addrset_init from load_exclude_{file,string}.
That's the responsibility of calling code; also, these should
accumulate.
2011-06-21 16:16:19 +00:00
colin
83ded596c4 Updated comment to state correct location of addrset 2011-06-20 22:06:11 +00:00
colin
e02b218925 Updated targets to correctly check from errors in the addrset functions and call fatal 2011-06-20 21:57:58 +00:00
colin
6cd1cee328 Merging from nmap-exp/colin/nmap-addrset, nmap-exp/colin/nbase-addrset, and /nmap-exp/colin/ncat-addrset
Ported addrset from ncat to nbase. Made --exclude and --exclude-file options use addrset. As a side effect IPv6 Excludes work.
2011-06-20 20:46:41 +00:00
david
ea99942f25 Revert r24116 and r24117; the addrset functions need to go in a C
library instead.
2011-06-18 23:52:25 +00:00
colin
221d8db694 Merging from nmap-exp/colin/nmap-addrset and /nmap-exp/colin/ncat-addrset
Ported addrset from ncat to libnetutil. Made --exclude and --exclude-file options use addrset. As a side effect IPv6 Excludes work.
2011-06-17 19:58:03 +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
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
david
fc9d35fed9 Add a symbolic constant for INITIAL_ARP_RTT_TIMEOUT. 2010-09-17 16:46:09 +00:00
david
c8106e0ef3 Let --min-rtt-timeout be a lower bound on the initial timeout for ARP
scan. ARP scan had a hardcoded initial timeout of 100 ms, which could be
lower than the minimum requested. The default minimum timeout is also
100 ms, so this has no effect if --min-rtt-timeout is not used.
2010-09-17 16:35:01 +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
578a26e552 Remove unused variables -- I'm not sure if these were ever actually used 2010-07-26 18:08:36 +00:00
david
77df357acd Check for target->deviceName == NULL in target_needs_new_hostgroup in
targets.cc, and return false if it is so. This indicates that we are not
doing a raw scan. target->deviceName != NULL is necessary before
checking target->directlyConnected(), otherwise you get this assertion
failure when doing any non-root scan (such as -sT or -sL) as root with
two or more targets:

nmap: Target.cc:369: bool Target::directlyConnected() const: Assertion `directly_connected == 0 || directly_connected == 1' failed.
Aborted

This is how the logic originally worked, and I accidentally broke it in
r17892.
2010-06-25 05:34:08 +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
david
58e1d664a6 Force a new host group whenever the next host has the same IP address as
one already present in the current group. This is because ultra_scan
does not cope with multiple targets sharing the same IP address. However
this alone isn't enough to force a new host group, because the loop in
nmap.cc concatenates groups that nexthost splits apart, with its own
duplicate logic for breaking up groups.
2010-06-07 23:43:07 +00:00
david
a70b8dd5fd Break apart target_needs_new_hostgroup to it's easier to read, not just
one big expression. Also fix a dumb bug I just introduced where I was
comparing the same value with itself.
2010-06-07 22:36:21 +00:00
david
f6358d1f3a Factor out the logic that decides if a target needs to go into a
different host group. Also insert the target into the group only after
we're sure we want it, instead of provisionally inserting it and then
removing it after we find it's unwanted.
2010-06-07 22:13:20 +00:00
david
138745fda6 Remove the unused gethostnum static function. I think this was used in
checking responses for weird_responses, which we don't do anymore.
2010-06-07 21:27:04 +00:00
david
2111c0ab54 Fix up indentation in targets.cc. 2010-06-07 21:25:53 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +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