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

71 Commits

Author SHA1 Message Date
nnposter
db39ee0518 Add missing includes to route.h test for FreeBSD. Fixes #2379 2022-04-20 17:09:55 +00:00
dmiller
9b36c5b2b8 libdnet: Remove call to FreeLibrary after GetModuleHandle.
Per Windows API docs: "do not pass a handle returned by GetModuleHandle
to the FreeLibrary function. Doing so can cause a DLL module to be
unmapped prematurely."
2021-07-23 16:50:12 +00:00
dmiller
8d59507aad Support Npcap 0.9983's new loopback behavior 2019-09-03 19:13:14 +00:00
dmiller
30db709755 Optimistically revert mutex that was needed with WinPcap. Npcap likely is unaffected. 2018-10-03 16:57:54 +00:00
dmiller
36a6d897a5 Use correct width in sscanf. Fixes #1156 2018-03-22 16:31:32 +00:00
dmiller
4c3450ce05 Fix route detection on FreeBSD. 2017-08-02 18:48:27 +00:00
dmiller
2f104650a8 Detect SNMP MIB2 STREAMS on Solaris even if /dev/ip is not present. 2017-02-13 19:46:23 +00:00
dmiller
85dd7e6ac1 Fix a potential buffer overrun due to sscanf using the wrong field width 2016-07-27 20:11:27 +00:00
dmiller
423c8380ef Fix network prefix length on Windows. http://seclists.org/nmap-dev/2016/q2/101 2016-05-11 02:23:21 +00:00
dmiller
312cff5ac5 Fix 'INTERFACES: NONE FOUND' for real. See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821913 2016-04-25 05:20:56 +00:00
dmiller
54bd372ccf CHANGELOG and mod patches for mutex change 2015-09-20 19:06:12 +00:00
dmiller
0f602cbd38 Fix address detection on Solaris. Fixes #124 2015-05-23 13:22:29 +00:00
dmiller
ee1156eb51 Fix a NULL pointer dereference in libdnet-stripped
Reported and diagnosed by Gisle Vanem.

Fixes #70
2015-03-05 22:09:49 +00:00
dmiller
a86b679404 Fix WinPcap crash on pcap_findalldevs error
See http://seclists.org/nmap-dev/2015/q1/176

Fixes #15
2015-02-12 16:52:02 +00:00
dmiller
17a5e77e0a Add ARP_HRD_IEEE80211_PRISM identifier 2015-01-27 02:31:11 +00:00
dmiller
c22c1119e9 Note last commit in libdnet/NMAP_MODIFICATIONS 2014-09-09 21:19:09 +00:00
dmiller
48dfb446d2 Only use RT_ROUNDUP on NetBSD
AIX's version breaks things: http://seclists.org/nmap-dev/2014/q3/405
2014-09-08 20:50:51 +00:00
david
02cb2931aa Fix rt_msghdr padding on NetBSD.
NetBSD uses a fixed 64-bit padding, unlike OS X (32-bit), and unlike
other platforms (sizeof(unsigned long)). There is an RT_ROUNDUP macro
that does the right alignment; use that when available.

http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libc/net/getifaddrs.c
http://fxr.watson.org/fxr/source/net/route.h?v=NETBSD#L270

Rounding to 4 bytes was breaking with IPv6 addresses, which are 28
bytes. The pointer was being advanced by 28 instead of 32. Compare to
r29739, somewhat similar.

Reported by Fredrik Pettai.
http://seclists.org/nmap-dev/2013/q1/384
2013-06-01 16:28:44 +00:00
henri
4a261dd5f2 Updated libdnet to not SIOCIFNETMASK before SIOCIFADDR on OpenBSD. This was
reported to break on -current as of May 2013. [Giovanni Bechis]
2013-05-17 21:38:08 +00:00
dmiller
14c40b6281 Handle AppleTalk devices
Fixed a bug that prevented Nmap from finding any interfaces when one
of them had the type ARP_HDR_APPLETALK; this was the case for
AppleTalk interfaces. However, This support is not complete
since AppleTalk interfaces use different size hardware addresses
than Ethernet. Nmap IP level scans should work without any problem,
please refer to the '--send-ip' switch and to the following thread:
http://seclists.org/nmap-dev/2013/q1/214
This bug was reported by Steven Gregory Johnson on IRC.
2013-02-14 23:32:52 +00:00
david
f55171a088 Add metric to struct route_entry.
Actually getting a nonzero value for the metric is supported only on
Linux and Windows.
2013-02-01 05:01:56 +00:00
david
f602ead419 Check some libdnet mallocs for failure.
Patch based on one by Bill Parker.
http://seclists.org/nmap-dev/2012/q4/261
2012-11-22 00:50:18 +00:00
david
11b76a55e2 Route tables rework to libdnet-stripped/NMAP_MODIFICATIONS. 2012-09-30 00:01:20 +00:00
djalal
af495cdc49 Fixed a bug that prevented Nmap from finding any interfaces when one
of them had the type ARPHDR_INFINIBAND; this was the case for
IP-over-InfiniBand interfaces. However, This support is not complete
since IPoIB interfaces use 20 bytes for the hardware address, and
currently we only report and handle 6 bytes.
Nmap IP level scans should work without any problem, please refer to
the '--send-ip' switch and to the following thread:
http://seclists.org/nmap-dev/2012/q3/642

This bug was reported by starlight.2012q3.
2012-09-26 09:24:00 +00:00
djalal
e017b7c290 Fixed a bug that prevented Nmap from finding any interfaces when one
of them had the type ARPHDR_IEEE80211; this was the case for wireless
interfaces operating in access point mode. This bug was reported by
Sebastiaan Vileijn.

http://seclists.org/nmap-dev/2012/q3/986
2012-09-26 08:49:22 +00:00
david
0674925f73 Skip over entire ifreq struct in NEXTIFR.
On platforms supporting sa_len, NEXTIFR would skip over sa_len bytes
starting at the beginning of ifr_addr, and assume that was the end of
the struct. (The idea being that a large address such as a sockaddr_in6
could overflow the nominal struct boundary.) This logic was wrong when
there was something else in the union bigger than sa_len; we would
increment into somewhere in the middle of the same struct.

This exhibited itself on NetBSD, where struct ifreq has a
sockaddr_storage member in its internal union:
struct	ifreq {
	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		struct	sockaddr ifru_broadaddr;
		struct	sockaddr_storage ifru_space;

No, we skip over sa_len bytes, or to the nominal end of the struct,
whichever is larger.

Unix Network Programming gets this wrong too; in figure 17.8 they do
ptr += sizeof(ifr->ifr_name) + max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
2012-09-10 01:17:28 +00:00
david
f7873c0089 Resolve strict-aliasing problems in ip6_ntop.
addr-util.c:191:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2012-09-01 03:29:39 +00:00
david
48ff61a710 Handle ARPHRD_VOID in addr_ston.
This type is used by OpenVZ venet interfaces. We "handle" such an
address type just by blanking the MAC address field.

Lack of support for this type of interface was preventing Nmap from
working on certain systems.

http://seclists.org/nmap-dev/2012/q2/763

An earlier message about this same type of interface is

http://seclists.org/nmap-dev/2009/q3/303
2012-07-21 07:35:41 +00:00
djalal
8e7edbd008 o Fixed a bug that caused Nmap to fail to find any network interface when
at least one of them is in the monitor mode. The fix was to define the
  ARP_HRD_IEEE80211_RADIOTAP 802.11 radiotap header identifier in the
  libdnet-stripped code. Network interfaces that are in this mode are used
  by radiotap for 802.11 frame injection and reception. The bug was
  reported by Tom Eichstaedt and Henri Doreau.
  http://seclists.org/nmap-dev/2012/q2/449
  http://seclists.org/nmap-dev/2012/q2/478
  [Djalal Harouni, Henri Doreau]
2012-06-02 19:35:08 +00:00
david
ae2f887af1 Ignore IPMP interfaces in SIOCGLIFCONF intf_loop.
This is a (hopefully temporary) workaround for these virtual interfaces
on Solaris. They don't work for Nmap because they don't allow packet
sniffing, but you can use one of the physical interfaces they're
composed of.
2012-05-24 02:56:08 +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
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
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
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
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
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
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
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