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

332 Commits

Author SHA1 Message Date
david
cde81f6fb4 Disambiguate another map from std::map. 2012-03-19 16:53:44 +00:00
david
59d472b232 Give a loacl variable better locality.
This was only used in an #ifdef LINUX, and gave a "set but not used"
warning on other platforms.
2012-03-19 02:17:12 +00:00
david
089d697e98 Whitespace. 2012-03-18 16:44:39 +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
2461746840 Allow --min-rate to trump the built-in limit of 50 sends per wait. 2012-01-01 20:26:58 +00:00
david
637ba35a28 Count an ACK right after counting a drop for a retransmitted reply.
We count a drop for congestion control purposes if we receive a response
to a retransmitted probe, because that means that the reply to the
original probe was dropped. However, we weren't taking into account that
we are at the same time receiving a positive response, and should
increase the window accordingly. There are now three things that can
happen:

Response to first probe:	ACK
Response to retransmission:	DROP, then ACK
Probe timeout:			DROP
2011-12-31 21:59:58 +00:00
david
8ba1cf6b15 Factor out timing ack and drop code. 2011-12-31 21:59:57 +00:00
david
e962f1c5fe Centralize initialization of scan_performance_vars. 2011-12-31 21:59:52 +00:00
david
b04380207a Move most of ultra_scan_performance_vars to global_structures.h. 2011-12-31 21:59:50 +00:00
david
8e63481a5d Move ultra_timing_vals to global_structures.h. 2011-12-31 21:59:48 +00:00
david
2caebcda8e Add a missing factor of USI->perf.ca_incr to host cwnd updates.
USI->perf.ca_incr is either 1 or 2 (2 with -T4 or greater).
2011-12-31 21:59:46 +00:00
david
cfa3e3e8c2 Typo. 2011-12-31 21:59:45 +00:00
david
fee764a5d8 Use a special struct_ip.h to include <netinet/ip.h> and accoutrements.
The comment in struct_ip.h explains the reasoning for this. The AIX C library
uses #defines that change the names of members of struct ip, and conflict with
some existing code. (Notably struct ip_hdr in libdnet and IPv4Header::h in
libnetutil.) We can still use the AIX files if we include <netinet/ip.h> after
this other code has been preprocessed. That's hard to enforce when
<netinet/ip.h> is included from another header file; this new file allows
including it always late, and only where needed.
2011-09-21 07:31:38 +00:00
david
f41753c4e9 Add a sockaddr dst argument to send_ip function that use raw sockets.
Heretofore we have always extracted teh destination address directly
from the packet contents. But the raw packet bytes do not contain enough
information in one case: IPv6 link-local addresses. For those we really
need the scope ID, and for that we must pass this information all the
way down.

Before this, I got "no route to host" on OS link-local addresses. I
think that it was working on Linux only on accident, by the OS picking a
default interface or something.
2011-09-19 16:13:35 +00:00
david
77d3994bc8 Count ND probes in UltraScan::numProbesPerHost.
Now it shows
	Scanning 2 hosts [1 port/host]
instead of
	Scanning 2 hosts [0 ports/host]
2011-08-30 23:55:12 +00:00
david
3b500dc8df Remove these condition on probe matching:
A RST/ACK can only be matched to a SYN or FIN. A bare RST cannot
	be matched to a SYN or FIN.

Matthew Stickney and Joe McEachern found cases where this caused replies
to be missed (specifically, RST/ACK in reponse to a NULL probe) and also
found standards justification for hosts returning RST/ACK in such a
situation.
2011-08-25 05:35:03 +00:00
david
6cf428d8c6 Fix some "and" -> "&&". 2011-07-19 23:42:33 +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
david
092772e1b5 Use ipv6_get_data_any and ip_get_data_any when parsing -sO packets.
Restore error checking.
2011-06-17 05:47:34 +00:00
david
332c93ea07 Correctly update datalen when getting IP data.
We were instead updating the value of an unused temporary variable. This
caused encapsulated data to appear longer than it was.
2011-06-17 05:47:32 +00:00
david
08faad4ca5 Remove [-Wunused-but-set-variable] warnings from scan_engine.cc. 2011-06-17 03:21:54 +00:00
david
2c3bf07b60 Whitespace and formatting in build_protoscan_packet. 2011-06-17 02:47:07 +00:00
david
1f58263afa Factor out build_protoscan_packet.
This removes some inline complexity from sendIPScanProbe.
2011-06-17 02:47:07 +00:00
david
a31a41e770 Interpret ICMPv6 Parameter Problem responses. 2011-06-14 19:46:53 +00:00
david
223d45c435 Isolate the test for valid encapsulated ICMPv6 data to those protocols
that need it.

We need to accept invalid encapsulated data for protocol scan responses.
2011-06-14 19:46:51 +00:00
david
a67eca0555 Allow sending -6 -sO probes. 2011-06-14 19:46:48 +00:00
david
af7da5f72d Don't consider any more probes after finding one of our own to localhost.
There is a special test that uses IP IDs to check if a presumed reply
from localhost is actually one of our own probes. However the test
didn't bail out ofter finding one of these matches, so a retransmission
(with a different IP ID) could match and look like a protocol reply from
localhost.
2011-06-14 19:46:47 +00:00
david
0793852c90 Fix the setting of ipid in setIP. 2011-06-14 19:46:44 +00:00
david
381bb03d70 Rename readip_pcap -> readipv4_pcap and readip46_pcap to readip_pcap.
We should have the multiprotocol version be the main version, with
IPv4-only code being a noted exception. Also these functions are almost
the same so one can call the other.
2011-06-08 23:46:21 +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
colin
5d3e0e688c Portreasons Restructuring. icmpt_to_reason added. 2011-05-26 19:46:29 +00:00
david
7453ec34d0 Change o.TimeSinceStartMS returning milliseconds to o.TimeSinceStart
returning floating-point seconds. Everywhere o.TimeSinceStartMS was
called, the return value was being divided by 1000.0, which had the same
effect but would overflow when the difference exceeded about 25 days
(2^31 milliseconds). This patch is by Daniel Miller.
2011-03-28 20:34:32 +00:00
david
523c4f7104 Remove -sR o.rpcscan handling; make -sR an alias for -sV. 2011-03-12 18:20:09 +00:00
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
c822f62d84 Typo fix. 2010-12-03 21:29:59 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
kris
380cfaba2c For generating ICMP IDs to send, use modulus and addition on a single random
number to guarantee it's nonzero (which some target hosts require) rather
than looping for new random numbers.  

* ICMP ID values are unimportant, as long as they are nonzero
* The original code to get random numbers was exactly duplicated (new variable,
  comment, loop, even whitespace) in the same function, so using a single
  variable set initially (albeit differently) simplifies duplication
2010-10-01 22:45:23 +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
david
a2b84bf74f o Changed the name of libdnet's sctp_chunkhdr to avoid a conflict with
a struct of the same name in <netinet/sctp.h>. This caused a
  compiliation error when Nmap was compiled with an OpenSSL that had
  SCTP support. [Olli Hauer, Daniel Roethlisberger]
2010-09-05 03:40:31 +00:00
david
852ad9440d Improve indentation and comments in init_socket. 2010-08-11 14:39:42 +00:00
david
c78dcce4d3 Move init_socket from nmap.cc to scan_engine.cc, because it is only used
in the latter file.
2010-08-11 14:34:54 +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
fyodor
6ac6e2fad5 loosen the requirements for a split-handshake syn detection to allow the likes of SYN|PSH. See this thread: http://seclists.org/nmap-dev/2010/q2/739 2010-06-11 06:17:52 +00:00
jah
a17609e6b4 Ports are now considered open during a SYN scan if a SYN packet (without the ACK
flag) is received in response. This can be due to an extremely rare TCP feature
known as a simultaneous open or split handshake connection.
see http://nmap.org/misc/split-handshake.pdf
Added a reason code: ER_SYN and associated reason string: "split-handshake-syn".
2010-06-08 01:50:45 +00:00
david
994da96f9c Merge Jay Fink's patch that puts UDP payloads in an external data file
instead of being hard-coded in payloads.cc. This is the patch from
http://seclists.org/nmap-dev/2010/q2/497.
2010-05-25 17:38:23 +00:00
kris
0be83cf063 Move around a few gettimeofday() calls, including where port scan timing
comparisons would be affected by debugging level:

http://seclists.org/nmap-dev/2010/q2/373
2010-05-11 03:22:42 +00:00
kris
0cf74cdfdd comment fix 2010-05-04 04:32:12 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00