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

115 Commits

Author SHA1 Message Date
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
d91b131da0 Make various accessors and parameters const. 2011-09-19 16:13: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
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
david
650ede916a Remove unused send_ip_raw function. 2011-04-01 21:17:01 +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
luis
d0a4d0ad50 Moved function max_sd() to libnetutil. Also, two new helper functions have been added. 2010-10-20 15:57:50 +00:00
fyodor
5539c9e39e Change NETINET_IN_SYSTEM_H definitions to NETINET_IN_SYSTM_H (missing the final E) because that is how the actual include filename is spelled. Also removed instances of HAVE_NETINET_IN_SYSTEM_H since they aren't used 2010-07-14 05:43:19 +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
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
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
kris
a42ea72a97 Merge through r16884 from /nmap-exp/kris/nse-rawip plus the following changelog
entries:

o [NSE] Raw packet sending at the IP layer is now supported, in addition to
  the Ethernet sending functionality.  Packets to send start with an IPv4
  header and can be sent to arbitrary hosts. [Kris]

o [NSE] Added the ipidseq script to classify a host's IP ID sequence numbers
  in the same way Nmap does.  This can be used to test hosts' suitability for
  Nmap's Idle Scan (-sI), i.e. check if a host is an idle zombie.  This is
  the first script to use the new raw IP sending functionality in NSE. [Kris]

o [NSE] Added the function nmap.is_privileged() to tell a script if, as far
  as Nmap's concerned, it can do privileged operations.  For instance, this
  can be used to see if a script should be able to open a raw socket or
  Ethernet interface. [Kris]

o [NSE] Added the function nmap.get_ports() to allow a script to iterate
  over a host's port tables matching a certain protocol and state. [Kris,
  Patrick]
2010-02-26 20:42:10 +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
daniel
50830f7488 o Added initial SCTP port scanning support to Nmap. SCTP is
a layer 4 protocol used mostly for telephony related applications.
  This brings the following new features:
  o SCTP INIT chunk port scan (-sY): open ports return an INIT-ACK
    chunk, closed ones an ABORT chunk.  This is the SCTP equivalent
    of a TCP SYN stealth scan.
  o SCTP COOKIE-ECHO chunk port scan (-sZ): open ports are silent,
    closed ports return an ABORT chunk.
  o SCTP INIT chunk ping probes (-PY): host discovery using SCTP
    INIT chunk packets.
  o SCTP-specific IP protocol scan (-sO -p sctp).
  o SCTP-specific traceroute support (--traceroute).
  o The ability to use the deprecated Adler32 algorithm as specified
    in RFC 2960 instead of CRC32C from RFC 4960 (--adler32).
  o 42 well-known SCTP ports were added to the nmap-services file.
  Part of the work on SCTP support was kindly sponsored by
  Compass Security AG, Switzerland.  [Daniel Roethlisberger]
2009-06-03 23:15:45 +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
fyodor
eccc235d5a Increase copyright year to 2009, simplify/reword some derivative works text, and remove a confusing clause about selling proprietary front-ends to Nmap 2009-03-31 04:16:12 +00:00
david
177e2cd4a2 constify the pointer passed to magic_tcpudp_cksum. 2008-08-21 17:43:23 +00:00
kris
910cb5ca48 Moving block_socket() and unblock_socket() from Nmap to Nbase for reuse in
Nsock and Ncat
2008-08-02 03:44:35 +00:00
kris
299e0de19e o Added --ip-options support for the connect() scan (-sT). [Kris] 2008-07-14 20:02:30 +00:00
kris
83ed199791 Adding packet validity checking to readip_pcap() so the caller can assume the
packet is OK from the get-go rather than running basic checks of it's own.

In a nutshell this patch checks to make sure:

1) there is enough room for an IP header in the amount of bytes read
2) the IP version number is correct
3) the IP length fields are at least as big as the standard header
4) the IP packet received isn't a fragment, or is the initial fragment
5) that next level headers seem reasonable

For TCP, this checks that there is enough room for the header in the number
of bytes read, and that any option lengths are correct.  The options checked
are MSS, WScale, SackOK, Sack, and Timestamp.

This also fixes a bug I discovered while testing.  Since the Ethernet CRC
(and other datalink-layer data) could be read and counted, it was being
returned that there was more IP packet than there really was.  This didn't
cause an overrun of the buffer or anything, just that garbage data could have
easily been read instead of real packet data.  Now, if validity is checked for
and the number of total bytes read is larger than the IP's length, the length
is set to the IP header's total length field.

This seems to work great after doing what testing I could.  It's been out on
nmap-dev for a couple of weeks without any bad reports (none at all for that
matter).  I reviewed this patch again before committing and it looks good as
well.
2008-06-30 23:55:19 +00:00
kris
9af737cd7f Changing --no_stylesheet to --no-stylesheet in the refguide, and changing
a few more long options with underscores in comments and output
2008-06-08 15:34:07 +00:00
fyodor
779b96a197 trivial copyright text tweak: filename nmap-os-fingerprints has changed to nmap-os-db 2008-05-22 20:45:32 +00:00
fyodor
10b54b773b minor license template updates from Kris--fix gnu.org link to GPLv2 (moved) and openssl license filename (COPYING.OpenSSL) 2008-05-05 04:10:00 +00:00
kris
9a89b403f9 Moving Nmap's config.h[.in] to nmap_config.h[.in] 2008-04-28 17:53:32 +00:00
fyodor
5551c5a311 o Fixed a bunch of code to avoid compilation warning messages (at
least on some Linux machines) [Andrew J. Bennieston]
2008-04-09 02:11:20 +00:00
fyodor
1accc12fb2 fix typo in legal header found by Leigh Zhao (missing word: of) 2008-02-28 18:52:06 +00:00
fyodor
29c912f394 URL change from http://insecure.org/nmap/* to http://nmap.org/* 2008-01-17 07:22:03 +00:00
fyodor
8220c8a42f update copyright line at the top of files from 1996-2006 to 1996-2008 2007-12-22 06:32:03 +00:00
kris
dfc9eba4db enable --ttl support for connect() scans 2007-10-14 14:37:56 +00:00
david
eddc2b0839 Merge r5733:5850 from /nmap-exp/david/nmap-massping-migration.
Remove special-purpose log functions for graphing congestion control and other t
hings. There's enough information provided by -d3.

Update the congestion control graph program and add a program for graphing probe
s and drops.

Increase the initial ccthresh from 50 to 75.

Change how much the congestion threshold drops on packet drops.

Print group timing stats with -d2 and individual host timing stats with -d3.

Bump up the cc-graph.sh y axis limit to 80.

Put graphs in the same directory as their log file.

Go ahead and adjust timing for ICMP destination unreachables. I'm going to commi
t and experimental change to the congestion control that doesn't rely on this an
y more.

Scale group congestion control increments by the inverse of the packet
receipt ratio. This gives great performance without ignoring ICMP
destintation unreachable drops. This may be the breakthrough we've been
looking for.
I'll probably send a message about this later today. For information and        
graphs right now, see
http://www.bamsoftware.com/wiki/Nmap/ResponseRateScaledCongestionControl.
Sorry it's only in my nmap-massping-migration branch for now, but please
give it a try.

Only -d2 is now needed for cc-graph.sh.

Put a cap of 50 on the cwnd scaling factor.

Fix up the order of things in the packet_ratio debugging output.

Move the packet_ratio debugging output to printAnyStats and rearrange the order 
in which things are printed.

Put a header with the scan args at the top of the probes-graph.sh data files.

Add a function pcap_print_stats that shows the number of received and dropped pa
ckets for a descriptor.

Call pcap_print_stats after a run of ultra_scan.

Increase the congestion window less aggressively than before with -T4 and -T5 (s
till more aggressivly than with lesser timing values).
2007-09-18 06:34:33 +00:00
fyodor
8b9a340fc4 merge soc07 r4829 - Added winpcap device names to the --iflist table 2007-08-11 03:44:40 +00:00
fyodor
58522c59f6 merge soc07 r4822 - Reduce the number of build dependencies. 2007-08-11 03:35:46 +00:00
kris
cc14c538ad Removing extraneous newlines (sometimes up to 9 of them) from ends of a few files 2007-02-04 02:53:29 +00:00
kris
4cbb311bc4 Change __BSD_SOURCE references to _BSD_SOURCE. The __FAVOR_BSD and __USE_BSD have double underscores in front, the *_SOURCE only have one. 2007-01-26 22:32:42 +00:00
kris
69754e8311 Use dnet headers for TCP and UDP. This allows us to remove netinet tcp.h and udp.h references, the udphdr_bsd stuff, and the TH_ECE/TH_CWR #defines in tcpip.h. That was easy, but we (Fyodor and I) came to the conclusion that IP and ICMP aren't worth the hassle to switch (I was testing TCP, UDP and IP in my branch). The struct icmp_hdr in dnet isn't setup anything like what we're using now. Then, struct ip_hdr uses ip_addr_t (typedef'd to uint32_t in that ip.h) instead of struct in_addr for the IP addresses, and that would require some dnet modifying to work right. We might be able to come up with some elegant solution for IP, but probably not for ICMP. For now, they're still left up to netinet (or tcpip.h). 2007-01-23 05:29:59 +00:00
kris
928750ce05 Fix some typos, one in output. IPPROTO_TCP -> IPPROTO_IP (2), extre -> extra, /etc/protocol -> /etc/protocols 2007-01-19 01:39:03 +00:00
kris
9ff574d50e Merging my IGMP -sO patch. This adds build_igmp_raw() to easily build IGMP packets and uses it for -sO. Systems respond more when these packets are sent with an actual IGMP header. The RFC says they MUST verify the checksum, so that's most likely why I always got open|filtered instead of open. Since the different IGMP types all seem to have the checksum in the same place in the packet, it should at least tell us if it's supported or not even if the rest of the header is bogus (because the rest of the header has changed a little bit between the versions). 2007-01-17 17:40:16 +00:00
fyodor
8e2de50dd3 Kris Katterjohn patches for code clean up, iana ip assignment update, fixe fileexistsandisreadable 2006-12-12 09:56:15 +00:00
fyodor
49a4a74d70 I hope these changes fix windows compilation 2006-11-20 07:56:38 +00:00
fyodor
508e674ce4 fix Mac OS X pcap problem, I hope 2006-11-19 09:35:26 +00:00
fyodor
10ffae41cf spellcheck patch 2006-09-05 08:39:32 +00:00
fyodor
9cbae88f44 Add -ip-options support 2006-08-29 03:26:00 +00:00
fyodor
b28d51167c Minor source code header improvements 2006-08-25 01:47:49 +00:00
fyodor
a403864351 Replace file headers, mostly to update copyright to 2006 2006-08-24 04:43:50 +00:00
fyodor
40672e849b a decent amount of OS detection changes/fixes 2006-08-20 01:56:53 +00:00
fyodor
d3055b26bf Some patches from Marek 2006-07-04 08:00:11 +00:00
fyodor
56384d8770 About to release 4.20SOC-ALPHA1 2006-06-25 02:02:14 +00:00