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

54 Commits

Author SHA1 Message Date
david
dbf79dafaa SIOCGLIFCONF-based implementation of intf_loop for Solaris 10.
The SIOCG*L*IFCONF interface is mostly like SIOCGIFCONF except that it
uses a sockaddr_storage-based structure that allows handling IPv6 interfaces.
2011-09-30 00:42:45 +00:00
david
399942d759 Add an MIB2_IP6 in addition to the MIB2_IP loop.
This gets IPv6 routes.
2011-09-29 22:23:16 +00:00
david
ddb4829b2b Use SIOCGIFNETMASK6 to get IPv6 interface netmasks.
This is used when SIOCGIFNETMASK_IN6 isn't available.
2011-09-28 06:55:48 +00:00
david
8d964ad4e9 Consider IFF_LOOPBACK before IFF_BROADCAST.
The IPv6 loopback interface on AIX has both IFF_BROADCAST and IFF_LOOPBACK set. Checking IFF_BROADCAST first erroneously makes it appear as an Ethernet device.
2011-09-26 22:26:50 +00:00
david
032caee6ac o Made the interface gathering loop work on Linux when an interface
index is more than two digits in /proc/sys/if_inet6. Joe McEachern
  tracked down the problem and provided the fix.
2011-09-25 19:14:33 +00:00
david
0bce585dec Use getkerninfo to get routing information on AIX. 2011-09-21 07:31:34 +00:00
david
70d2105b9f Use if_nametoindex instead of SIOCGIFINDEX.
The latter isn't available on OS X.
2011-09-17 06:40:41 +00:00
david
4f454a29d2 Add the intf_entry.intf_index member.
This is the operating system's interface index, as used by
if_indextoname and sockaddr_sin6.sin6_scope_id.
2011-08-30 23:55:07 +00:00
david
12f4742f0f Add intf_get_index to libdnet-stripped.
This function gets an interface from an internal interface number, such
as a sockaddr_in6.sin6_scope_id.
2011-08-30 17:01:50 +00:00
shinnok
9562171e86 Remove unreferenced local variable. 2011-06-22 18:35:56 +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
7f7c78ad96 Fix a bug in Windows interface matching. The code was supposed to check if a
MAC address matched the expected address, and if so, take that as a preliminary
match before checking the description string for a stronger match. But if
retrieving the the MAC address failed completely, it was still being accepted
as a preliminary match, and would prevent later matches with only the MAC
address from being accepted.
2011-02-10 05:52:22 +00:00
david
b61286dc2c Add #ifdef guards around two uses of AF_LINK (there was already a guard
around the third use). Vlatko submitted this patch to compile on
Android.
2010-08-20 04:50:19 +00:00
david
e108318cd2 In intf_get_pcap_devname, allow a match if only the hardware address
matches, but keep searching in case there's an interface where both the
hardware address and description string match.

Matching only on the hardware address is not sufficient, because several
interfaces will have the same address in the case of interface teaming.
See the log message for r17542.

But this revision broke interface matching for Luis MartinGarcia and Rob
Nicholls. For Luis, the call to PacketRequest with OID_GEN_FRIENDLY_NAME
was failing. For Rob, the friendly name differed slightly from the
description provided by libpcap. This change makes a hardware address
match good enough but will prefer a description match too.
2010-07-14 16:44:59 +00:00
david
48c6e7b820 Move the body of eth_get_pcap_devname back into intf_get_pcap_devname, leaving
eth_get_pcap_devname as a wrapper.

In addition to the hardware address check, add a check of the textual interface
descriptions in order better to distinguish interfaces. It appears to me that
the pcap description (pdev->description) is the same as what is returned by a
call to PacketRequest with an OID of OID_GEN_FRIENDLY_NAME, so that's what I'm
comparing. That differs from OID_GEN_VENDOR_NAME, which is what you get in
ifrow.bDescr from GetIfTable.

We've found that simply comparing hardware addresses is not enough when using
Windows "teamed" (link-aggregated) interfaces. In a simple example, two NICs
are teamed together, leading to three interfaces visible to libdnet: the two
physical NICs and the virtual teamed interface. All three of these have the
same MAC address. What was happening was the eth0 interface was being assigned
to one of the physical NICs, packets were sent over it, but the replies were
not necessarily coming back to the same physical NIC.
2010-05-13 04:06:53 +00:00
david
d9fd52c194 o Fixed the parsing of libdnet DLPI interface names that contain more
than one string of digits. Joe Dietz reported that an interface with
  the name e1000g0 was causing the error message
    Warning: Unable to open interface e1000g0 -- skipping it.
  on Solaris 9. [David]
2010-02-28 19:45:39 +00:00
david
5cb31211f9 Open bpf devices in read/write mode, not read-only, in libdnet on BSD. This is
to work around a bug in Mac OS X 10.6 that causes incoming traffic to become
invisible.
2009-11-09 04:49:32 +00:00
david
41dadaedb7 Use socklen_t as the type in arguments to getsockname and getsockopt to
avoid a "pointer targets differ in signedness" warning. Add a check for
socklen_t in configure.in; if it's not present, typedef it to int.
2009-08-07 00:11:57 +00:00
david
36c672cdd7 autoreconf with Autoconf 2.63, Automake 1.10.1, and libtool 2.2.6. 2009-08-06 22:00:34 +00:00
josh
1d45eaf352 Changd some calls to ctype functions so that their arguments are explicitly cast
to type int.
2009-08-06 16:12:21 +00:00
josh
9c374417eb Fixed a formatting mistake in libdnet-stripped/src/intf.c and updated
NMAP_MODIFICATIONS to reflect a bug fix.
2009-07-02 20:33:38 +00:00
josh
294b15ce81 Fixed two memory leaks and a case where an open file may not be closed. 2009-07-02 03:36:43 +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
david
10962f4fc0 A bug was fixed in route finding on BSD Unix. The libdnet function
addr_stob didn't handle the special case of the sa_len member of
struct sockaddr being equal to 0 and accessed unrelated memory past
the end of the sockaddr. A symptom of this was the fatal error
  nexthost: failed to determine route to ...
which was caused by the default route being assigned a netmask other
than 0.0.0.0.
2009-03-15 22:55:20 +00:00
kris
d23556c513 Upgrading shipped libdnet to 1.12 2008-09-19 06:12:25 +00:00
david
38c50f3ac3 In eth_get_pcap_devname (nee intf_get_pcap_devname), fall back on matching MAC
addresses if matching IP addresses fails. I have a feeling this is more
reliable than matching IP addresses, but as I'm not sure, I have made it the
backup so that nothing will stop working that was working before. The MAC
address matching works fine for me if I disable the IP address matching. The
code is adapted from libdnet 1.11.
2008-06-20 20:57:40 +00:00
david
09cc37f7f0 Rename intf_get_pcap_devname to eth_get_pcap_devname to reflect its new home. 2008-06-20 20:44:54 +00:00
david
b145c5549d Move intf_get_pcap_devname from intf-win32.c to eth-win32.c. Pending changes
are going to make that function use a struct eth_t, so it needs to be here to
be in scope for that struct's internals.
2008-06-20 20:36:21 +00:00
david
f557cbe90e Remove the unused (and broken) intf_get_desc function from libdnet-stripped. It
used to be used to get the interface description back when the eth_open
correlation code worked that way.
2008-06-20 20:32:51 +00:00
david
450052603b In intf_get_pcap_devname, compare each of the pcap device's addresses against
all of the dnet device's addresses, not just the first one. This is a long shot
to fix the "dnet: Failed to open eth4" problem on Vista, but it's the right
thing anyway.
2008-06-20 19:44:13 +00:00
kris
44f6087b94 Merging changes from my vc2008-testing branch. This moves Windows development
to VC++2008.
2008-06-13 05:58:11 +00:00
david
3e3f0d8d39 Canonicalize interface type numbers used internally by libdnet. Also
recognize devices with type INTF_TYPE_IEEE80211 as Ethernet devices.
This ought to make wireless network scanning work on Windows Vista. For
more background see http://seclists.org/nmap-dev/2007/q4/0391.html.
2007-12-03 23:51:26 +00:00
david
62823cb379 Back out r6322, which added a debugging message to libdnet. The bug which
necessitated the message will be fixed in a pending commit.
2007-12-03 23:44:02 +00:00
david
dfb9c157c7 Delete auxiliary scripts config.guess, config.sub, depcomp, install-sh,
ltmain.sh, and missing from subdirectories. Autoconf automatically looks
in the parent directory for these files. I had to copy the files
depcomp, ltmain.sh, and missing into the root of the source tree.
2007-11-27 06:22:46 +00:00
david
e1a5a6424d Show a warning in libdnet whenever a Windows interface type is unrecognized.
(These get mapped to interfaces beginning with "net": net0, net1, etc.) I
originally planned to make this a debugging message to be displayed at a
certain debuggin level whether the interface type is recognized or not. It
looked to be a pain to give libdnet visibility of Nmap debugging level, so
instead it just prints a message to stderr only when the interface type is
unrecognized.
2007-11-27 00:39:01 +00:00
david
d08af8a057 List all interface aliases on Windows. All aliases of one interface will be
given the same name, e.g., "eth0". Use -e to choose the interface and -S to
choose the source address.
2007-11-26 23:44:20 +00:00
fyodor
b361685be8 NSE committed 2006-12-11 00:34:26 +00:00
fyodor
9c686d4a12 about to do more os fingerprint integration 2006-12-03 00:34:19 +00:00
fyodor
5a9fea3b39 portability fixes, fixed UDP phantom port bug, fixed --version-intensity crash, changed mass_dns to give warning rather than error if cannot find dns servers 2006-06-10 21:23:27 +00:00
fyodor
76acd0a496 Nmap 3.98BETA1 2006-01-21 23:57:49 +00:00
fyodor
e2b19b36a3 a bunch of misc. changes 2005-12-29 11:34:45 +00:00
fyodor
0551dc6964 Time to start working on verifying/fixing alleged memorly leak on large scans 2005-12-03 04:20:52 +00:00
fyodor
908942d57a use windows config.h instead of normal config.h on windows 2005-09-12 09:03:38 +00:00
fyodor
a14f8bc51c close to 3.92 release 2005-09-12 08:08:35 +00:00
fyodor
02397959b3 removed winip lib 2005-08-10 04:16:18 +00:00
fyodor
f2e62cf403 Windoze just about working 2005-08-09 04:20:41 +00:00
fyodor
bdf2caa2a4 vcproj for nmap 2005-08-08 05:48:49 +00:00
fyodor
68aaae4a0c removed some generated files that really never should have been checked in 2005-07-27 02:47:33 +00:00
fyodor
aafb4a0a82 Arp sp00fing c0de 2005-07-26 06:26:00 +00:00
fyodor
db7794d596 Mostly seems to be working on Solaris, though I am having some problems with libpcap not timing out 2005-07-23 04:05:31 +00:00