1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00
Commit Graph

153 Commits

Author SHA1 Message Date
dmiller
2f104650a8 Detect SNMP MIB2 STREAMS on Solaris even if /dev/ip is not present. 2017-02-13 19:46:23 +00:00
yang
c238ef3df4 Fix MSVC 2010's compilation warning on DLT_NULL_HEADER pointer assignment (https://github.com/nmap/nmap/issues/563) 2016-10-06 03:40:29 +00:00
dmiller
d5f7d5c45b Permit sending on DLT_NULL devices on Windows 2016-08-14 12:29:50 +00:00
dmiller
af13cef717 Upgrade to Npcap 0.08 (libpcap 1.8.0 headers for Windows) 2016-08-13 20:04:05 +00:00
dmiller
b8fb5be8a1 Sanity check on IPv6 addresses: they must be 128 bits or less 2016-07-30 03:54:01 +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
vincent
900f015726 Silencing sizeof() warning
Here, the sizeof() function return the size of 'char *' instead of 
INTF_NAME_LEN. I replaced the use of the latter function by INTF_NAME_LEN 
(maximum size of the array intf_name). Here is the compiler warning output:

route-bsd.c:171:38: warning: sizeof on array function parameter will return 
size of 'char *' instead of 'char [16]' [-Wsizeof-array-argument] 
strlcpy(intf_name, namebuf, sizeof(intf_name));
2016-07-01 11:27:37 +00:00
dmiller
abfcd7ba71 Update Npcap's loopback adapter registry key name, changed in Npcap 0.07-r7 2016-06-15 02:21:28 +00:00
dmiller
67fd101b01 Enable Nmap, Nping to use Npcap over Winpcap if available. 2016-06-14 14:16:46 +00:00
dmiller
50054e6ed7 Update platform toolset to remove XP compatibility 2016-06-04 02:46:11 +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
0d44a381b1 Fix netmask handling on FreeBSD. Fixes #284 2016-01-26 04:52:28 +00:00
dmiller
37d517b32e Use XP compatibility SDK, because users are complaining 2015-11-10 16:47:35 +00:00
dmiller
54bd372ccf CHANGELOG and mod patches for mutex change 2015-09-20 19:06:12 +00:00
dmiller
3d9e348832 Use a mutex on Windows to avoid a hang when accessing WinPCAP driver
Reported by multiple users on Windows 8.1 and Windows Server 2012 R2.
Seems to hang when the WinPCAP driver is accessed via OpenServiceA by
multiple processes at once. Users report that this change, which uses a
mutex to avoid concurrent access, fixes the hang.
2015-09-20 19:06:11 +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
0952bed032 Merge final changes to support VS2013 build
Changes:

* Fix a collision of the name PS_NONE with a different constant in shlobj.h
* Update solution and project files for VS2013
* Update the NSIS installer to reference the VC 2013 redistributable
2015-01-17 04:35:01 +00:00
dmiller
c22c1119e9 Note last commit in libdnet/NMAP_MODIFICATIONS 2014-09-09 21:19:09 +00:00
dmiller
73275cc872 dnet: Fix hw address getting on AIX 2014-09-09 21:19:08 +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
ce51d8c4da Use the default value of MultiThreadedDLL where possible. 2013-02-09 20:30:01 +00:00
david
6b095f42d2 Use MultiThreadedDebugDLL (/MDd) in place of MultiThreadedDebug (/MTd).
This is to match r8507, which did the analogous thing for the Release
configuration.
http://seclists.org/nmap-dev/2013/q1/120
2013-02-09 20:29:55 +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
5fd515b039 Get rid of ntohs in ip6_ntop.
Byte-swapping is handled by the initial loop that reads into an array of
16-bit integers. That initial loop was added by me in r29708.
2013-01-30 08:47:24 +00:00
david
e7a4a8a364 Set sa.sndd_8022_ethertype to 0 in eth-ndd.c.
This file is used for Ethernet handles on AIX. We had a report from
Peter O'Gorman that setting this member to 0 rather than ETH_TYPE_IP was
necessary to avoid an EEXIST error on bind.

http://seclists.org/nmap-dev/2011/q4/349
http://seclists.org/nmap-dev/2011/q4/353
http://seclists.org/nmap-dev/2011/q4/att-353/aix.patch
https://code.google.com/p/libdnet/issues/detail?id=23

However Ben Lentz more recently tried the patch and said that he still
got an EEXIST on bind.

http://seclists.org/nmap-dev/2012/q4/327
http://seclists.org/nmap-dev/2012/q4/395

So who knows what the right thing to do here is. The messages from IBM
seem to say that setting ETH_TYPE_IP is definitely wrong though.
2012-12-08 11:04:23 +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
david
049208898b Set intf_name in route-bsd.c, the parts used by OS X.
There are some other #ifdefs that are used on other platforms, in which
code intf_name might nto be set but will continue to be an empty string
as before.
2012-09-30 00:01:17 +00:00
david
0ed5d26bc3 Set intf_name in route-win32.c. 2012-09-30 00:01:16 +00:00
david
98aa8fbe80 Set intf_name in route-linux.c. 2012-09-30 00:01:12 +00:00
david
5bbe36af7a Add intf_name to the route_entry struct.
This is set to an empty string in all functions yielding routes,
particularly route_loop. The code to get the interface pertaining to a
route is different on different platforms, so must be added one by one.
The code setting the intf_name to an empty string is only tested on
Linux.
2012-09-30 00:01:10 +00:00
david
bfea61a51e Put the sscanf count check right after the call to sscanf. 2012-09-27 03:10:28 +00:00
david
06dcb1c138 Check ipv6 route flags and sscanf count as well. 2012-09-27 03:06:22 +00:00
david
95b634d28c We are reading 11, not 10, fields from /proc/net/route. 2012-09-27 02:58:27 +00:00
david
645e0d213f We can only read n - 1 bytes of interface name; sscanf doesn't include
the terminator.

Noticed by Djalal.
2012-09-27 02:58:26 +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
7a9e7c502e Add a missing IFF_IPMP #ifdef guard. 2012-08-26 20:44:32 +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