From 14c40b628109b302e71cc34213ee9c6a039d6027 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 14 Feb 2013 23:32:52 +0000 Subject: [PATCH] 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. --- CHANGELOG | 9 ++++++++ libdnet-stripped/NMAP_MODIFICATIONS | 35 +++++++++++++++++++++++++++++ libdnet-stripped/include/dnet/arp.h | 1 + libdnet-stripped/src/addr.c | 1 + 4 files changed, 46 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d5bb31ef5..6218c038e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ # Nmap Changelog ($Id$); -*-text-*- +o 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. [Daniel Miller] + o [Nping] Nping now skips localhost targets for privileged pings (with an error message) because those generally don't work. [David Fifield] diff --git a/libdnet-stripped/NMAP_MODIFICATIONS b/libdnet-stripped/NMAP_MODIFICATIONS index b6196be12..913111f55 100644 --- a/libdnet-stripped/NMAP_MODIFICATIONS +++ b/libdnet-stripped/NMAP_MODIFICATIONS @@ -1820,3 +1820,38 @@ index b4536b3..c69b29b 100644 if ((ret = (*callback)(&entry, arg)) != 0) break; + +o Support Appletalk devices and make addr_ston able to handle + them. However, this support is not complete since ipddp interfaces + use different size hardware addresses than Ethernet. + Nmap IP level scans should work without any + problem, please see Nmap's '--send-ip' switch. + + For more information, please see this thread: + http://seclists.org/nmap-dev/2013/q1/214 + +Index: libdnet-stripped/include/dnet/arp.h +=================================================================== +--- libdnet-stripped/include/dnet/arp.h (revision 30609) ++++ libdnet-stripped/include/dnet/arp.h (working copy) +@@ -40,6 +40,7 @@ + #define ARP_HRD_IEEE802 0x0006 /* IEEE 802 hardware */ + + #define ARP_HRD_INFINIBAND 0x0020 /* InfiniBand */ ++#define ARP_HRD_APPLETALK 0x0309 /* AppleTalk DDP */ + #define ARP_HDR_IEEE80211 0x0321 /* IEEE 802.11 */ + #define ARP_HRD_IEEE80211_RADIOTAP 0x0323 /* IEEE 802.11 + radiotap header */ + #define ARP_HRD_VOID 0xFFFF /* Void type, nothing is known */ +Index: libdnet-stripped/src/addr.c +=================================================================== +--- libdnet-stripped/src/addr.c (revision 30609) ++++ libdnet-stripped/src/addr.c (working copy) +@@ -318,6 +318,7 @@ + #endif + case AF_UNSPEC: + case ARP_HRD_ETH: /* XXX- Linux arp(7) */ ++ case ARP_HRD_APPLETALK: /* AppleTalk DDP */ + case ARP_HRD_INFINIBAND: /* InfiniBand */ + case ARP_HDR_IEEE80211: /* IEEE 802.11 */ + case ARP_HRD_IEEE80211_RADIOTAP: /* IEEE 802.11 + radiotap header */ + diff --git a/libdnet-stripped/include/dnet/arp.h b/libdnet-stripped/include/dnet/arp.h index 907d36a86..9bfdcaf1b 100644 --- a/libdnet-stripped/include/dnet/arp.h +++ b/libdnet-stripped/include/dnet/arp.h @@ -40,6 +40,7 @@ struct arp_hdr { #define ARP_HRD_IEEE802 0x0006 /* IEEE 802 hardware */ #define ARP_HRD_INFINIBAND 0x0020 /* InfiniBand */ +#define ARP_HRD_APPLETALK 0x0309 /* AppleTalk DDP */ #define ARP_HDR_IEEE80211 0x0321 /* IEEE 802.11 */ #define ARP_HRD_IEEE80211_RADIOTAP 0x0323 /* IEEE 802.11 + radiotap header */ #define ARP_HRD_VOID 0xFFFF /* Void type, nothing is known */ diff --git a/libdnet-stripped/src/addr.c b/libdnet-stripped/src/addr.c index 8e9a9ce70..8953b5be2 100644 --- a/libdnet-stripped/src/addr.c +++ b/libdnet-stripped/src/addr.c @@ -318,6 +318,7 @@ addr_ston(const struct sockaddr *sa, struct addr *a) #endif case AF_UNSPEC: case ARP_HRD_ETH: /* XXX- Linux arp(7) */ + case ARP_HRD_APPLETALK: /* AppleTalk DDP */ case ARP_HRD_INFINIBAND: /* InfiniBand */ case ARP_HDR_IEEE80211: /* IEEE 802.11 */ case ARP_HRD_IEEE80211_RADIOTAP: /* IEEE 802.11 + radiotap header */