1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00
Commit Graph

93 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
31f12a071c Check for <netinet/in6_var.h>.
This contains the SIOCGIFNETMASK6 ioctl definition on AIX.
2011-09-28 06:55:47 +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
david
c32d196ce2 Remove the nonexistent include/config.h from the build configuration.
With this present, the project always appeared out of date. Visual C++
would always prompt to rebuild the project when starting to debug, for
example.
2011-07-20 07:16:05 +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
shinnok
9562171e86 Remove unreferenced local variable. 2011-06-22 18:35:56 +00:00
david
5f8b19c700 Add ICMPv6 Parameter Problem defines. 2011-06-14 19:46:49 +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
33f3645ecd Don't define HAVE_SYS_SOCKET_H in dnet_winconfig.h. That it was wrongly
defined was noticed by Gisle Vanem. It makes no difference because this
macro isn't used in any source files for Windows (or any platform).
2010-11-29 20:30:52 +00:00
david
fa320a9c16 Change the name of the "dnet" project to "libdnet-stripped". This was only a
warning, not a build failure, but now it better matches the other projects
whose name matches their directory name.
2010-11-04 20:27:30 +00:00
david
6ce7c2e34d Upgrade the Windows build files using the Visual C++ 2010 Express conversion
wizard. At this point the solution doesn't build.
2010-11-04 18:16:40 +00:00
david
dba101df69 Update NMAP_MODIFICATIONS to reflect upstream code merges by Jay Fink. 2010-10-11 18:17:23 +00:00
david
f664110479 Update NMAP_MODIFICATIONS for fixed ip6_pack_hdr. 2010-10-07 21:54:19 +00:00
david
6112cb9a43 Fix bugs in ip6_pack_hdr so that the traffic class and flow label are
set correctly.

1. Shift the low-order bits of fc by 20 bits, not 28, because fl is a
   20-bit field.
2. Use a mask in host byte order to mask fl, which is also provided in
   host byte order.
3. Swap | and & in combining fc and fl.
2010-10-07 21:51:28 +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
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
7b956b8099 Document r17542 in NMAP_MODIFICATIONS.
o Made eth_get_pcap_devname compare interface descriptions as well as
  MAC addresses when assigning interface names like eth0 on Windows.
  Only comparing MAC addresses failed in the case of "teamed"
  interfaces, when three interfaces (two physical, one virtual) could
  have the same hardware address.
2010-05-14 16:53:46 +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
5c1ec9a488 Don't build a shared libdnet library by default. We always link directly
against the static library.
2010-05-07 21:08:32 +00:00
david
d4ff5e9688 Make the Autoconf check for PF_PACKET support Linux-specific. Recent
versions of OpenSolaris (I tested snv_134) also support PF_PACKET, but
not in an entirely compatible way. The configure check was making the
build use eth-linux.c, which doesn't compile under OpenSolaris. This
change makes OpenSolaris fall back to eth-dlpi.c, which works. The
report about this was sent by Darren Reed.
2010-04-27 23:33:17 +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
2099944ef0 Move entries in libdnet-stripped/NMAP_MODIFICATIONS to reflect recent
upstream merges by Jay Fink.

http://code.google.com/p/libdnet/source/detail?r=654
http://code.google.com/p/libdnet/source/detail?r=655
http://code.google.com/p/libdnet/source/detail?r=656
2010-02-24 01:54:56 +00:00
david
89ca07bec6 Include AC_INCLUDES_DEFAULT (which includes <sys/types.h>), in addition
to <socket.h>, when doing the test for socklen_t. Apparently OpenBSD has
it in <sys/types.h> and it causes a build failure later if we detect
that the type is not present.
2010-01-14 16:47:28 +00:00
david
e8fdd394e6 Add semicolons to the socklen_t typedefs, thanks again to Michael
Pattrick.
2010-01-14 06:04:17 +00:00
david
9570d04ea0 Do the socklen_t typedef in acconfig.h too, so it will remain after
config.h.in is regenerated by autoheader.
2010-01-14 03:38:22 +00:00
david
53c3d44b9a Fix the socklen_t typedef in libdnet-stripped. It was
typedef socklen_t int;

Michael Pattrick pointed out that it should be

typedef int socket_t;
2010-01-14 03:34:11 +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
fyodor
978b8fc3ae Applied a configure.in patch from Petr Salinger in Debian bug #542388 which apparently fixes the libdnet build on GNU/kFreeBSD 2009-08-20 08:46:00 +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
david
b47b0db086 Don't use the removed directorie man, python, and test in Makefile.am.
Pass the arguments "-I config" to aclocal. This makes it possible to
rebuild all the Autotools files with autoreconf.
2009-08-06 21:45:19 +00:00
david
000a1ee3ac Regenerate configure and aclocal.m4 with Autoconf 2.63. 2009-08-06 19:58:10 +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
daniel
82f698becf Mark the __attribute__ ifndefs merged to upstream libdnet r653. 2009-07-05 21:08:52 +00:00
daniel
f2f66722d8 Making struct packing explicit for sctp.h too. 2009-07-05 21:02:43 +00:00
daniel
1cfb3558c9 Cleanup and introduction of a special section for changes to libdnet
which have been merged to the upstream libdnet repository and thus
do not have to be re-applied when the libdnet version included with
Nmap is updated in the future.
2009-07-03 18:07:20 +00:00
daniel
2ed58055ee Setting eol-style native in preparation of cleanups to NMAP_MODIFICATIONS. 2009-07-03 17:52:54 +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
b4243e23f2 Fix all the compiler warnings when building with Visual C++ 2008. 2009-04-29 17:56:30 +00:00