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

141 Commits

Author SHA1 Message Date
dmiller
9c7ea727a7 Update license terms for 2017 2017-06-07 12:32:38 +00:00
dmiller
ab5e247cee Include netutil.h for IPPROTO_SCTP constant where necessary. Fixes #868 2017-04-26 18:55:16 +00:00
dmiller
891c3be3b9 remove tcpip.h from other headers' includes 2017-04-19 13:53:57 +00:00
fyodor
4bd67aa2fb Update the Nmap license/header text to reflect latest updates to docs/legal-notices.xml 2016-12-14 00:12:23 +00:00
abhishek
9d288db7fd Add support for decoys in IPv6 closes #433 and fixes #98 2016-08-17 06:09:09 +00:00
dmiller
67fd101b01 Enable Nmap, Nping to use Npcap over Winpcap if available. 2016-06-14 14:16:46 +00:00
dmiller
6e33d6ac3c Bump date in copyright headers 2016-04-04 15:38:44 +00:00
dmiller
0021991042 Fix a segfault with --release-memory without --traceroute 2015-09-09 02:50:50 +00:00
dmiller
0f371d701a Consolidate TCP options for SYN into nmap.h 2015-07-14 03:08:17 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller
26faf21ae1 Work around weird AIX traceroute hang
std::list::size() was hanging because list traversal was broken for this
particular static list (timedout_hops). Could not reproduce with a small
test program, but another AIX user confirmed. Exhausted other options
before switching it to dynamic allocation (of the list itself, not the
elements, which are always dynamically allocated), which somehow
bypasses the problem.
2014-09-16 15:36:44 +00:00
dmiller
9a155c269d Actually use reply ttl for distance guessing in traceroute
This chunk of code in read_replies was generating valgrind errors
because reply.ttl was uninitialized:

  if (host->state == HostState::COUNTING_DOWN) {
    /* If this probe was past the target, skip ahead to what we think the
       actual distance is. */
    int distance = get_initial_ttl_guess(reply.ttl) - reply.ttl + 1;
    if (distance > 0 && distance < host->current_ttl)
      host->current_ttl = MIN(distance, MAX_TTL);
  }

My compiler was setting the initial value to 0, which meant that
distance was always 33, clearly wrong. Setting reply.ttl in decode_reply
silences the error and causes distance to be more accurate.
2014-09-15 17:27:10 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
jay
8d5ec9e310 Reapply r33420, r33421. Fix a missing right parenthesis. https://xkcd.com/859/ 2014-08-15 12:09:22 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
d4cf544df6 Fix a missing bracket at the end of the IMPORTANT NMAP LICENSE TERMS part in each file 2014-08-02 19:29:50 +00:00
d33tah
a80c90608c sed -i 's/if ( /if (/g' *.cc *.h; sed -i 's/for ( /for (/g' *.cc *.h; sed -i 's/( /(/g' nmap_amigaos.h tcpip.h service_scan.cc
There's still quite a lot of code like this, nse_openssl.cc being most
messy IMHO. Also, I left out "if( something )" syntax.
2014-06-25 15:40:54 +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
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
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
7b18ea1bc0 Move win32_fatal_raw_sockets out of nmap_raw_socket.
For the same reason and with the same exception (nse_dnet.cc) as in
r30159.
2012-10-31 17:00:55 +00:00
david
03946ba2f5 Return -1 instead of calling pfatal in nmap_raw_socket.
There was one case where we previously didn't fatal, in nse_dnet.cc.
Move the fatal calls out of nmap_raw_socket and into the calling scope,
with the exception of the one in nse_dnet.cc.

The problem was reported by Rob Nicholls.
http://seclists.org/nmap-dev/2012/q4/186
2012-10-31 16:09:47 +00:00
david
53b4fdcf0a Move HopIdent above hop_cache, which uses it.
This caused an error message when compiled with Clang 3.1:

traceroute.cc:173:41: note: in instantiation of exception specification for 'map' requested here
static std::map<struct HopIdent, Hop *> hop_cache;
                                        ^
traceroute.cc:173:24: note: forward declaration of 'HopIdent'
static std::map<struct HopIdent, Hop *> hop_cache;
                       ^

Found by arrowdodger. http://seclists.org/nmap-dev/2012/q4/58.
2012-10-11 05:42:37 +00:00
david
21af053639 Enable IP Protocol (Next Header) traceroute for IPv6. 2012-10-06 21:26:34 +00:00
david
cf33599c2f Support IPv6 SCTP traceroute. 2012-10-06 21:26:33 +00:00
david
7830eb4db6 Support IPv6 UDP traceroute. 2012-10-06 21:26:31 +00:00
david
cf0b55788f Enable IPv6 traceroute only for TCP and ICMPv6.
The other protocols that are implemented for IPv4 are not implemented
for IPv6, leading to an assertion failure.

nmap: traceroute.cc:749: virtual unsigned char* UDPProbe::build_packet(const sockaddr_storage*, u32*) const: Assertion `source->ss_family == 2' failed.

This was noticed by Pierre Emeriaud.
http://seclists.org/nmap-dev/2012/q4/36
2012-10-06 21:26:30 +00:00
david
07f9b440f4 Whitespace. 2012-10-06 21:26:28 +00:00
david
8ab0096609 Remove dead asserts.
I believe the purpose of these asserts was to quiet a compiler warning
in r24309, but the rest of that revision (marking fatal as a
non-returning function) should do the job.
2012-10-06 21:26:26 +00:00
david
49a57d8dde Typo. 2012-10-06 20:48:29 +00:00
david
a53e00afa1 Factor out an nmap_raw_socket function.
This does the common setup of a raw socket that we use everywhere.
2012-10-03 15:43:21 +00:00
david
725692b744 Use an unsigned int for --max-retries and related values. 2012-08-28 14:29:11 +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
b6c5004c3b Remove accidental duplicate struct_ip definitions. 2011-09-21 07:48:11 +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
f56c0d0f77 Make dummy struct operator() const.
Solves a compile error with Visual C++ 2008.
2011-07-25 23:31:17 +00:00
shinnok
3240e10bb0 Fix MSVC compiler noreturn related warnings and add extra
safety asserts to the functions that do not return on all
control paths.
2011-06-23 23:59:52 +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
41e3e105be Comment typo. 2011-06-08 20:19:13 +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
david
a2e58b4875 Use sockaddr_storage_equal in place of sockaddr_storage_cmp where
appropriate.
2011-05-07 00:50:54 +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
batrick
0f8dcc1766 typo 2010-09-10 21:45:44 +00:00