1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00
Commit Graph

69 Commits

Author SHA1 Message Date
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
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
8bc4a2ced3 Document something in NMAP_MODIFICATIONS I forgot to document before. It's from
when I adapted some libdnet 1.11 code to convert a dnet name to a pcap name by
matching hardware addresses. I removed an earlier comment that this one
supersedes.
2008-08-30 04:39:30 +00:00
david
ba27a7308c Copy libdnet-stripped/include/dnet/os.h from libdnet 1.12. This avoids a
duplicate typedef of ssize_t.
2008-08-29 20:23:56 +00:00
fyodor
2c4f8d1a67 o The Nmap Windows self-installer now automatically installs the MS
Visual C++ 2008 runtime components if they aren't already installed
  on a system.  These are some reasonably small DLLs that are
  generally necessary for applications compiled with Visual C++ (with
  dynamic linking).  Many or most systems already have these installed
  from other software packages.  The lack of these components led to
  the error message "The Application failed to intialize properly
  (0xc0150002)." with Nmap 4.65.  A related change is that Nmap on
  Windows is now compiled with /MD rather than /MT so that it
  consistently uses these runtime libraries.  The patch was created by
  Rob Nicholls.
2008-06-29 04:52:00 +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
kris
85edc7a005 Merging over from /nmap-exp/kris/assert-testing
Ensuring the safety of assert() calls by keeping NDEBUG undefined throughout
Nmap, Nbase and Nsock.

I've tested this on Linux and Windows XP without problems.  On Windows I've
removed the definitions of _DEBUG and NDEBUG from the *.vcproj files.
2008-05-03 17:58:48 +00:00
fyodor
356352cfa7 regenerated autoconf configure files using autoconf-2.61-9.fc8 2008-03-15 10:23:08 +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
3d9ccee8ff I think I'm done with pcap upgrade and doug's pcap selectable_fd patch 2006-08-17 00:23:03 +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
bb10b6a8f3 moved everything to VS Express 2005 2006-05-31 23:01:19 +00:00
fyodor
0b33f41633 About to do Nmap 4.03 2006-04-22 23:00:09 +00:00