From aafb4a0a82581638fb15f06176df2aceeb2876ce Mon Sep 17 00:00:00 2001 From: fyodor Date: Tue, 26 Jul 2005 06:26:00 +0000 Subject: [PATCH] Arp sp00fing c0de --- CHANGELOG | 15 +++ MACLookup.cc | 23 ++++ MACLookup.h | 8 ++ Makefile.in | 2 +- NmapOps.cc | 8 +- NmapOps.h | 7 + config.h | 22 ++-- docs/nmap.1 | 17 +++ docs/nmap.usage.txt | 2 +- docs/nmap_manpage.html | 6 +- libdnet-stripped/Makefile | 32 ++--- libdnet-stripped/include/Makefile | 32 ++--- libdnet-stripped/include/config.h | 44 +++---- libdnet-stripped/include/dnet/Makefile | 32 ++--- libdnet-stripped/libtool | 169 +++++++++++++------------ libdnet-stripped/src/Makefile | 36 +++--- nmap.cc | 54 ++++++++ nmap.h | 1 + targets.cc | 11 +- 19 files changed, 330 insertions(+), 191 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cec1cc0e7..c51f8f947 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,21 @@ UNRELEASED +o Added the --spoof_mac option, which asks Nmap to use the given MAC + address for all of the raw ethernet frames it sends. The MAC given + can take several formats. If it is simply the string "0", Nmap + chooses a completely random MAC for the session. If the given + string is an even number of hex digits (with the pairs optionally + separated by a colon), Nmap will use those as the MAC. If less than + 12 hex digits are provided, Nmap fills in the remainder of the 6 + bytes with random values. If the argument isn't a 0 or hex string, + Nmap looks through the nmap-mac-prefixes to find a vendor name + containing the given string (it is case insensitive). If a match is + found, Nmap uses the vendor's OUI (3-byte prefix) and fills out the + remaining 3 bytes randomly. Valid --spoof_mac argument examples are + "Apple", "0", "01:02:03:04:05:06", "deadbeefcafe", "0020F2", and + "Cisco". + o Fixed a problem where Nmap compilation would use header files from the libpcap included with Nmap even when it was linking to a system libpcap. Thanks to Solar Designer (solar(a)openwall.com) and Okan diff --git a/MACLookup.cc b/MACLookup.cc index eac276f20..451c3fd0a 100644 --- a/MACLookup.cc +++ b/MACLookup.cc @@ -221,3 +221,26 @@ const char *MACPrefix2Corp(const u8 *prefix) { ent = findMACEntry(MacCharPrefix2Key(prefix)); return (ent)? ent->vendor : NULL; } + +/* Takes a string and looks through the table for a vendor name which + contains that string. Sets the first three bytes in mac_data and + returns true for the first matching entry found. If no entries + match, leaves mac_data untouched and returns false. Note that this + is not particularly efficient and so should be rewriteen if it is + called often */ +bool MACCorp2Prefix(const char *vendorstr, u8 *mac_data) { + if (!vendorstr) fatal("%s: vendorstr is NULL", __FUNCTION__); + if (!mac_data) fatal("%s: mac_data is NULL", __FUNCTION__); + if (!initialized) InitializeTable(); + + for(int i = 0; i < MacTable.table_capacity; i++ ) { + if (MacTable.table[i]) + if (strcasestr(MacTable.table[i]->vendor, vendorstr)) { + mac_data[0] = MacTable.table[i]->prefix >> 16; + mac_data[1] = (MacTable.table[i]->prefix >> 8) & 0xFF; + mac_data[2] = MacTable.table[i]->prefix & 0xFF; + return true; + } + } + return false; +} diff --git a/MACLookup.h b/MACLookup.h index b20ded6c7..2ea7b292a 100644 --- a/MACLookup.h +++ b/MACLookup.h @@ -111,4 +111,12 @@ is some other error. */ const char *MACPrefix2Corp(const u8 *prefix); +/* Takes a string and looks through the table for a vendor name which + contains that string. Sets the first three bytes in mac_data and + returns true for the first matching entry found. If no entries + match, leaves mac_data untouched and returns false. Note that this + is not particularly efficient and so should be rewriteen if it is + called often */ +bool MACCorp2Prefix(const char *vendorstr, u8 *mac_data); + #endif /* MACLOOKUP_H */ diff --git a/Makefile.in b/Makefile.in index 555301ac0..e2ff3b9e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -export NMAP_VERSION = 3.83.SOC2 +export NMAP_VERSION = 3.83.SOC3 NMAP_NAME= nmap NMAP_URL= http://www.insecure.org/nmap/ NMAP_PLATFORM=@host@ diff --git a/NmapOps.cc b/NmapOps.cc index 7e68537cc..1831eb384 100644 --- a/NmapOps.cc +++ b/NmapOps.cc @@ -242,6 +242,7 @@ void NmapOps::Initialize() { #endif if (xsl_stylesheet) free(xsl_stylesheet); xsl_stylesheet = strdup(tmpxsl); + spoof_mac_set = false; } bool NmapOps::TCPScan() { @@ -269,7 +270,7 @@ bool NmapOps::RawScan() { void NmapOps::ValidateOptions() { if (pingtype == PINGTYPE_UNKNOWN) { - if (isr00t && af() == AF_INET) pingtype = PINGTYPE_TCP|PINGTYPE_TCP_USE_ACK|PINGTYPE_ICMP_PING; + if (isr00t && af() == AF_INET) pingtype = DEFAULT_PING_TYPES; else pingtype = PINGTYPE_TCP; // if nonr00t or IPv6 num_ping_ackprobes = 1; ping_ackprobes[0] = DEFAULT_TCP_PROBE_PORT; @@ -480,3 +481,8 @@ void NmapOps::setXSLStyleSheet(char *xslname) { if (xsl_stylesheet) free(xsl_stylesheet); xsl_stylesheet = xslname? strdup(xslname) : NULL; } + +void NmapOps::setSpoofMACAddress(u8 *mac_data) { + memcpy(spoof_mac, mac_data, 6); + spoof_mac_set = true; +} diff --git a/NmapOps.h b/NmapOps.h index f30955808..86b6d37c2 100644 --- a/NmapOps.h +++ b/NmapOps.h @@ -220,6 +220,11 @@ class NmapOps { should be skipped */ char *XSLStyleSheet() { return xsl_stylesheet; } + /* Sets the spoofed MAC address */ + void setSpoofMACAddress(u8 *mac_data); + /* Gets the spoofed MAC address, but returns NULL if it hasn't been set */ + const u8 *spoofMACAddress() { return spoof_mac_set? spoof_mac : NULL; } + int max_ips_to_scan; // Used for Random input (-iR) to specify how // many IPs to try before stopping. 0 means unlimited. int extra_payload_length; /* These two are for --data_length op */ @@ -290,5 +295,7 @@ class NmapOps { bool pTrace; // Whether packet tracing has been enabled bool vTrace; // Whether version tracing has been enabled char *xsl_stylesheet; + u8 spoof_mac[6]; + bool spoof_mac_set; }; diff --git a/config.h b/config.h index a2adc6760..57dab2703 100644 --- a/config.h +++ b/config.h @@ -103,7 +103,7 @@ #ifndef CONFIG_H #define CONFIG_H -/* #undef PCAP_TIMEOUT_IGNORED */ +#define PCAP_TIMEOUT_IGNORED 1 #define HAVE_STRUCT_IP 1 @@ -123,7 +123,7 @@ #define HAVE_STRING_H 1 -/* #undef HAVE_GETOPT_H */ +#define HAVE_GETOPT_H 1 #define HAVE_STRINGS_H 1 @@ -131,7 +131,7 @@ /* #undef HAVE_BSTRING_H */ -#define WORDS_BIGENDIAN 1 +/* #undef WORDS_BIGENDIAN */ #define HAVE_MEMORY_H 1 @@ -142,21 +142,21 @@ #define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_SOCKIO_H 1 +/* #undef HAVE_SYS_SOCKIO_H */ /* #undef HAVE_PCRE_H */ -/* #undef HAVE_PCRE_PCRE_H */ +#define HAVE_PCRE_PCRE_H 1 #define BSD_NETWORKING 1 -/* #undef HAVE_INET_ATON */ +#define HAVE_INET_ATON 1 -/* #undef HAVE_STRCASESTR */ +#define HAVE_STRCASESTR 1 /* #undef HAVE_GETOPT_LONG */ -#define IN_ADDR_DEEPSTRUCT 1 +/* #undef IN_ADDR_DEEPSTRUCT */ /* #undef HAVE_NETINET_IN_SYSTEM_H */ @@ -164,7 +164,7 @@ #define HAVE_NETINET_IF_ETHER_H 1 -/* #undef HAVE_OPENSSL */ +#define HAVE_OPENSSL 1 /* #undef STUPID_SOLARIS_CHECKSUM_BUG */ @@ -191,10 +191,10 @@ extern "C" int gethostname (char *, unsigned int); #endif /* #undef DEC */ -/* #undef LINUX */ +#define LINUX 1 /* #undef FREEBSD */ /* #undef OPENBSD */ -#define SOLARIS 1 +/* #undef SOLARIS */ /* #undef SUNOS */ /* #undef BSDI */ /* #undef IRIX */ diff --git a/docs/nmap.1 b/docs/nmap.1 index bb14cde24..1a5eb6190 100644 --- a/docs/nmap.1 +++ b/docs/nmap.1 @@ -500,10 +500,27 @@ while ethernet frames work best on the many Windows versions where Microsoft has disabled raw sockets support. Nmap still uses raw IP packets when there is no other choice (such as non-ethernet connections). +.TP .B --send_ip Asks Nmap to send packets via raw IP sockets rather than sending lower level ethernet frames. It is the complement to the --send-eth option.discussed previously. +.TP +.B \--spoof_mac [mac, prefix, or vendor substring] +Ask Nmap to use the given MAC address for all of the raw ethernet +frames it sends. The MAC given can take several formats. If it is +simply the string "0", Nmap chooses a completely random MAC for the +session. If the given string is an even number of hex digits (with +the pairs optionally separated by a colon), Nmap will use those as the +MAC. If less than 12 hex digits are provided, Nmap fills in the +remainder of the 6 bytes with random values. If the argument isn't a +0 or hex string, Nmap looks through the nmap-mac-prefixes to find a +vendor name containing the given string (it is case insensitive). If +a match is found, Nmap uses the vendor's OUI (3-byte prefix) and fills +out the remaining 3 bytes randomly. Valid --spoof_mac argument +examples are "Apple", "0", "01:02:03:04:05:06", "deadbeefcafe", +"0020F2", and "Cisco". +.TP .B \-f This option causes the requested scan (including ping scans) to use tiny fragmented IP packets. The idea is to split up the TCP header diff --git a/docs/nmap.usage.txt b/docs/nmap.usage.txt index b455db8d2..267c6e2f7 100644 --- a/docs/nmap.usage.txt +++ b/docs/nmap.usage.txt @@ -1,4 +1,4 @@ -Nmap 3.83.SOC2 Usage: nmap [Scan Type(s)] [Options] +Nmap 3.83.SOC3 Usage: nmap [Scan Type(s)] [Options] Some Common Scan Types ('*' options require root privileges) * -sS TCP SYN stealth port scan (default if privileged (root)) -sT TCP connect() port scan (default for unprivileged users) diff --git a/docs/nmap_manpage.html b/docs/nmap_manpage.html index 748a0b660..dfa410615 100644 --- a/docs/nmap_manpage.html +++ b/docs/nmap_manpage.html @@ -461,7 +461,7 @@ or other scan types, have a look at http://nmap6.source- forge.net/ . - --send-eth + --send_eth Asks Nmap to send packets at the raw ethernet (data link) layer rather than the higher IP (network) layer. By default, Nmap chooses the one which is generally best for the platform it is @@ -469,7 +469,7 @@ for UNIX machines, while ethernet frames work best on the many Windows versions where Microsoft has disabled raw sockets sup- port. Nmap still uses raw IP packets when there is no other - choice (such as non-ethernet connections). --send-ip Asks Nmap + choice (such as non-ethernet connections). --send_ip Asks Nmap to send packets via raw IP sockets rather than sending lower level ethernet frames. It is the complement to the --send-eth option.discussed previously. -f This option causes the @@ -544,7 +544,7 @@ URL is often more useful, but the local filesystem locaton of nmap.xsl is used by default for privacy reasons. - --no-stylesheet + --no_stylesheet Specify this option to prevent Nmap from associating any XSL stylesheet with its XML output. The xml-stylesheet directive is omitted. diff --git a/libdnet-stripped/Makefile b/libdnet-stripped/Makefile index e513b3cbd..8485e7da4 100644 --- a/libdnet-stripped/Makefile +++ b/libdnet-stripped/Makefile @@ -22,7 +22,7 @@ pkglibdir = $(libdir)/libdnet pkgincludedir = $(includedir)/libdnet top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = config/install-sh -c +INSTALL = /usr/bin/install -c install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,8 +34,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = sparc-sun-solaris2.9 -host_triplet = sparc-sun-solaris2.9 +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/dnet-config.in \ $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure \ @@ -118,11 +118,11 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LDFLAGS = -LIBOBJS = err$U.o strsep$U.o arp-ioctl$U.o eth-dlpi$U.o fw-none$U.o intf$U.o ip-cooked$U.o route-bsd$U.o tun-none$U.o -LIBS = -lsocket -lnsl +LIBOBJS = strlcat$U.o strlcpy$U.o arp-ioctl$U.o eth-linux$U.o fw-ipchains$U.o intf$U.o ip$U.o route-linux$U.o tun-linux$U.o +LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s -LTLIBOBJS = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +LTLIBOBJS = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo MAINT = # MAINTAINER_MODE_FALSE = MAINTAINER_MODE_TRUE = # @@ -140,7 +140,7 @@ PYTHON_FALSE = PYTHON_TRUE = # RANLIB = ranlib SET_MAKE = -SHELL = /bin/bash +SHELL = /bin/sh STRIP = strip TCLINC = TCLLIB = @@ -164,18 +164,18 @@ am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin -build = sparc-sun-solaris2.9 +build = x86_64-unknown-linux-gnu build_alias = -build_cpu = sparc -build_os = solaris2.9 -build_vendor = sun +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown datadir = ${prefix}/share exec_prefix = ${prefix} -host = sparc-sun-solaris2.9 +host = x86_64-unknown-linux-gnu host_alias = -host_cpu = sparc -host_os = solaris2.9 -host_vendor = sun +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown includedir = ${prefix}/include infodir = ${prefix}/info install_sh = /home/fyodor/nmap/libdnet-stripped/config/install-sh @@ -183,7 +183,7 @@ libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var mandir = ${prefix}/man -mkdir_p = $(mkinstalldirs) +mkdir_p = mkdir -p -- oldincludedir = /usr/include prefix = /usr/local program_transform_name = s,x,x, diff --git a/libdnet-stripped/include/Makefile b/libdnet-stripped/include/Makefile index 4d8d4200e..714696e81 100644 --- a/libdnet-stripped/include/Makefile +++ b/libdnet-stripped/include/Makefile @@ -22,7 +22,7 @@ pkglibdir = $(libdir)/libdnet pkgincludedir = $(includedir)/libdnet top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = ../config/install-sh -c +INSTALL = /usr/bin/install -c install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,8 +34,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = sparc-sun-solaris2.9 -host_triplet = sparc-sun-solaris2.9 +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/Makefile.am.common @@ -109,11 +109,11 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LDFLAGS = -LIBOBJS = err$U.o strsep$U.o arp-ioctl$U.o eth-dlpi$U.o fw-none$U.o intf$U.o ip-cooked$U.o route-bsd$U.o tun-none$U.o -LIBS = -lsocket -lnsl +LIBOBJS = strlcat$U.o strlcpy$U.o arp-ioctl$U.o eth-linux$U.o fw-ipchains$U.o intf$U.o ip$U.o route-linux$U.o tun-linux$U.o +LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s -LTLIBOBJS = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +LTLIBOBJS = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo MAINT = # MAINTAINER_MODE_FALSE = MAINTAINER_MODE_TRUE = # @@ -131,7 +131,7 @@ PYTHON_FALSE = PYTHON_TRUE = # RANLIB = ranlib SET_MAKE = -SHELL = /bin/bash +SHELL = /bin/sh STRIP = strip TCLINC = TCLLIB = @@ -155,18 +155,18 @@ am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin -build = sparc-sun-solaris2.9 +build = x86_64-unknown-linux-gnu build_alias = -build_cpu = sparc -build_os = solaris2.9 -build_vendor = sun +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown datadir = ${prefix}/share exec_prefix = ${prefix} -host = sparc-sun-solaris2.9 +host = x86_64-unknown-linux-gnu host_alias = -host_cpu = sparc -host_os = solaris2.9 -host_vendor = sun +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown includedir = ${prefix}/include infodir = ${prefix}/info install_sh = /home/fyodor/nmap/libdnet-stripped/config/install-sh @@ -174,7 +174,7 @@ libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var mandir = ${prefix}/man -mkdir_p = $(mkinstalldirs) +mkdir_p = mkdir -p -- oldincludedir = /usr/include prefix = /usr/local program_transform_name = s,x,x, diff --git a/libdnet-stripped/include/config.h b/libdnet-stripped/include/config.h index c04ef7511..0c047e9dd 100644 --- a/libdnet-stripped/include/config.h +++ b/libdnet-stripped/include/config.h @@ -2,7 +2,7 @@ /* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if arpreq struct has arp_dev. */ -/* #undef HAVE_ARPREQ_ARP_DEV */ +#define HAVE_ARPREQ_ARP_DEV 1 /* Define if you have the Berkeley Packet Filter. */ /* #undef HAVE_BSD_BPF */ @@ -11,7 +11,7 @@ #define HAVE_DLFCN_H 1 /* Define if you have the `err' function. */ -/* #undef HAVE_ERR */ +#define HAVE_ERR 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 @@ -44,13 +44,13 @@ /* #undef HAVE_LIBNM */ /* Define if you have the `nsl' library (-lnsl). */ -#define HAVE_LIBNSL 1 +/* #undef HAVE_LIBNSL */ /* Define if you have the `resolv' library (-lresolv). */ /* #undef HAVE_LIBRESOLV */ /* Define if you have the `socket' library (-lsocket). */ -#define HAVE_LIBSOCKET 1 +/* #undef HAVE_LIBSOCKET */ /* Define if you have the `str' library (-lstr). */ /* #undef HAVE_LIBSTR */ @@ -59,7 +59,7 @@ /* #undef HAVE_LIBWS2_32 */ /* Define if you have the header file. */ -/* #undef HAVE_LINUX_IF_TUN_H */ +#define HAVE_LINUX_IF_TUN_H 1 /* Define if you have the header file. */ /* #undef HAVE_LINUX_IP_FWCHAINS_H */ @@ -69,19 +69,19 @@ /* Define if you have the header file. */ -/* #undef HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H */ +#define HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H 1 /* Define if you have Linux PF_PACKET sockets. */ -/* #undef HAVE_LINUX_PF_PACKET */ +#define HAVE_LINUX_PF_PACKET 1 /* Define if you have the Linux /proc filesystem. */ -/* #undef HAVE_LINUX_PROCFS */ +#define HAVE_LINUX_PROCFS 1 /* Define if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the header file. */ -#define HAVE_NETINET_IN_VAR_H 1 +/* #undef HAVE_NETINET_IN_VAR_H */ /* Define if you have the header file. */ /* #undef HAVE_NETINET_IP_COMPAT_H */ @@ -96,13 +96,13 @@ /* #undef HAVE_NETINET_IP_FW_H */ /* Define if you have the header file. */ -#define HAVE_NET_BPF_H 1 +/* #undef HAVE_NET_BPF_H */ /* Define if you have the header file. */ #define HAVE_NET_IF_ARP_H 1 /* Define if you have the header file. */ -#define HAVE_NET_IF_DL_H 1 +/* #undef HAVE_NET_IF_DL_H */ /* Define if you have the header file. */ #define HAVE_NET_IF_H 1 @@ -129,13 +129,13 @@ #define HAVE_NET_ROUTE_H 1 /* Define if you have cooked raw IP sockets. */ -#define HAVE_RAWIP_COOKED 1 +/* #undef HAVE_RAWIP_COOKED */ /* Define if raw IP sockets require host byte ordering for ip_off, ip_len. */ /* #undef HAVE_RAWIP_HOST_OFFLEN */ /* Define if has rt_msghdr struct. */ -#define HAVE_ROUTE_RT_MSGHDR 1 +/* #undef HAVE_ROUTE_RT_MSGHDR */ /* Define if has sockaddr_in6 struct. */ #define HAVE_SOCKADDR_IN6 1 @@ -144,13 +144,13 @@ /* #undef HAVE_SOCKADDR_SA_LEN */ /* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ +#define HAVE_STDINT_H 1 /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define if you have SNMP MIB2 STREAMS. */ -#define HAVE_STREAMS_MIB2 1 +/* #undef HAVE_STREAMS_MIB2 */ /* Define if you have route(7) STREAMS. */ /* #undef HAVE_STREAMS_ROUTE */ @@ -162,19 +162,19 @@ #define HAVE_STRING_H 1 /* Define if you have the `strlcat' function. */ -#define HAVE_STRLCAT 1 +/* #undef HAVE_STRLCAT */ /* Define if you have the `strlcpy' function. */ -#define HAVE_STRLCPY 1 +/* #undef HAVE_STRLCPY */ /* Define if you have the header file. */ #define HAVE_STROPTS_H 1 /* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ +#define HAVE_STRSEP 1 /* Define if you have the header file. */ -#define HAVE_SYS_BUFMOD_H 1 +/* #undef HAVE_SYS_BUFMOD_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_DLPIHDR_H */ @@ -183,7 +183,7 @@ /* #undef HAVE_SYS_DLPI_EXT_H */ /* Define if you have the header file. */ -#define HAVE_SYS_DLPI_H 1 +/* #undef HAVE_SYS_DLPI_H */ /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 @@ -198,13 +198,13 @@ #define HAVE_SYS_SOCKET_H 1 /* Define if you have the header file. */ -#define HAVE_SYS_SOCKIO_H 1 +/* #undef HAVE_SYS_SOCKIO_H */ /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define if you have the header file. */ -/* #undef HAVE_SYS_SYSCTL_H */ +#define HAVE_SYS_SYSCTL_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 diff --git a/libdnet-stripped/include/dnet/Makefile b/libdnet-stripped/include/dnet/Makefile index 43926b024..0c383bd22 100644 --- a/libdnet-stripped/include/dnet/Makefile +++ b/libdnet-stripped/include/dnet/Makefile @@ -22,7 +22,7 @@ pkglibdir = $(libdir)/libdnet pkgincludedir = $(includedir)/libdnet top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = ../../config/install-sh -c +INSTALL = /usr/bin/install -c install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,8 +34,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = sparc-sun-solaris2.9 -host_triplet = sparc-sun-solaris2.9 +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu DIST_COMMON = $(dnetinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.common subdir = include/dnet @@ -101,11 +101,11 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LDFLAGS = -LIBOBJS = err$U.o strsep$U.o arp-ioctl$U.o eth-dlpi$U.o fw-none$U.o intf$U.o ip-cooked$U.o route-bsd$U.o tun-none$U.o -LIBS = -lsocket -lnsl +LIBOBJS = strlcat$U.o strlcpy$U.o arp-ioctl$U.o eth-linux$U.o fw-ipchains$U.o intf$U.o ip$U.o route-linux$U.o tun-linux$U.o +LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s -LTLIBOBJS = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +LTLIBOBJS = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo MAINT = # MAINTAINER_MODE_FALSE = MAINTAINER_MODE_TRUE = # @@ -123,7 +123,7 @@ PYTHON_FALSE = PYTHON_TRUE = # RANLIB = ranlib SET_MAKE = -SHELL = /bin/bash +SHELL = /bin/sh STRIP = strip TCLINC = TCLLIB = @@ -147,18 +147,18 @@ am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin -build = sparc-sun-solaris2.9 +build = x86_64-unknown-linux-gnu build_alias = -build_cpu = sparc -build_os = solaris2.9 -build_vendor = sun +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown datadir = ${prefix}/share exec_prefix = ${prefix} -host = sparc-sun-solaris2.9 +host = x86_64-unknown-linux-gnu host_alias = -host_cpu = sparc -host_os = solaris2.9 -host_vendor = sun +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown includedir = ${prefix}/include infodir = ${prefix}/info install_sh = /home/fyodor/nmap/libdnet-stripped/config/install-sh @@ -166,7 +166,7 @@ libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var mandir = ${prefix}/man -mkdir_p = $(mkinstalldirs) +mkdir_p = mkdir -p -- oldincludedir = /usr/include prefix = /usr/local program_transform_name = s,x,x, diff --git a/libdnet-stripped/libtool b/libdnet-stripped/libtool index 5b3d998b1..3c471f64a 100755 --- a/libdnet-stripped/libtool +++ b/libdnet-stripped/libtool @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # libtoolT - Provide generalized library-building support services. # Generated automatically by (GNU libdnet 1.10) @@ -40,14 +40,14 @@ Xsed="/bin/sed -e s/^X//" if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. -available_tags="available_tags= CXX F77" +available_tags=" CXX F77" # ### BEGIN LIBTOOL CONFIG -# Libtool was configured on host ultra: +# Libtool was configured on host flog.yuma.net: # Shell to use when invoking shell scripts. -SHELL="/bin/bash" +SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes @@ -56,17 +56,17 @@ build_libtool_libs=yes build_old_libs=yes # Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=yes +build_libtool_need_lc=no # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=no # Whether or not to optimize for fast installation. -fast_install=needless +fast_install=yes # The host system. host_alias= -host=sparc-sun-solaris2.9 +host=x86_64-unknown-linux-gnu # An echo program that does not interpret backslashes. echo="echo" @@ -88,13 +88,13 @@ with_gcc=yes EGREP="grep -E" # The linker used to build libraries. -LD="/usr/ccs/bin/ld" +LD="/usr/bin/ld -m elf_x86_64" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. -NM="/usr/ccs/bin/nm -p" +NM="/usr/bin/nm -B" # A symbol stripping program STRIP="strip" @@ -138,7 +138,7 @@ pic_flag=" -fPIC -DPIC" pic_mode=default # What is the maximum length of a command? -max_cmd_len=262144 +max_cmd_len=32768 # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" @@ -168,10 +168,10 @@ link_static_flag="-static" no_builtin_flag=" -fno-builtin" # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="" +export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="-z allextract\$convenience -z defaultextract" +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" @@ -202,10 +202,12 @@ old_archive_from_new_cmds="" old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. -archive_cmds="\$CC -shared \${wl}-h \${wl}\$soname -o \$lib \$libobjs \$deplibs \$compiler_flags" -archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | \$SED -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~\$echo \\\"local: *; };\\\" >> \$lib.exp~ - \$CC -shared \${wl}-M \${wl}\$lib.exp \${wl}-h \${wl}\$soname -o \$lib \$libobjs \$deplibs \$compiler_flags~\$rm \$lib.exp" -postinstall_cmds="chmod +x \$lib" +archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ +cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ +\$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ + \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" +postinstall_cmds="" postuninstall_cmds="" # Commands used to build a loadable module (assumed same as above if empty) @@ -213,8 +215,8 @@ module_cmds="" module_expsym_cmds="" # Commands to strip libraries. -old_striplib="" -striplib="" +old_striplib="strip --strip-debug" +striplib="strip --strip-unneeded" # Dependencies to place before the objects being linked to create a # shared library. @@ -246,16 +248,16 @@ file_magic_cmd="\$MAGIC_CMD" allow_undefined_flag="" # Flag that forces no undefined symbols. -no_undefined_flag=" -z text" +no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. -finish_cmds="" +finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BDRT][BDRT]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" +global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" @@ -264,13 +266,13 @@ global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" # This is the shared library runtime path variable. -runpath_var= +runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=yes +shlibpath_overrides_runpath=no # How to hardcode a shared library path into an executable. hardcode_action=immediate @@ -280,7 +282,7 @@ hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. -hardcode_libdir_flag_spec="-R\$libdir" +hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # If ld is used when linking, flag to hardcode $libdir into # a binary during linking. This must work even if $libdir does @@ -300,7 +302,7 @@ hardcode_minus_L=no # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. -hardcode_shlibpath_var=no +hardcode_shlibpath_var=unsupported # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. @@ -308,16 +310,16 @@ hardcode_automatic=no # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. -variables_saved_for_relink="PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=yes +link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/ /usr/ccs/bin/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/bin/ /usr/ccs/lib/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/lib/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../ /lib/sparc-sun-solaris2.9/3.4.2/ /lib/ /usr/lib/sparc-sun-solaris2.9/3.4.2/ /usr/lib/" +sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64" # Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 include ld.so.conf.d/*.conf /usr/X11R6/lib /usr/X11R6/lib64 /usr/lib/mysql /usr/lib64/mysql " # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" @@ -6763,10 +6765,10 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # End: # ### BEGIN LIBTOOL TAG CONFIG: CXX -# Libtool was configured on host ultra: +# Libtool was configured on host flog.yuma.net: # Shell to use when invoking shell scripts. -SHELL="/bin/bash" +SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes @@ -6781,11 +6783,11 @@ build_libtool_need_lc=no allow_libtool_libs_with_static_runtimes=no # Whether or not to optimize for fast installation. -fast_install=needless +fast_install=yes # The host system. host_alias= -host=sparc-sun-solaris2.9 +host=x86_64-unknown-linux-gnu # An echo program that does not interpret backslashes. echo="echo" @@ -6807,13 +6809,13 @@ with_gcc=yes EGREP="grep -E" # The linker used to build libraries. -LD="/usr/ccs/bin/ld" +LD="/usr/bin/ld -m elf_x86_64" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. -NM="/usr/ccs/bin/nm -p" +NM="/usr/bin/nm -B" # A symbol stripping program STRIP="strip" @@ -6857,7 +6859,7 @@ pic_flag=" -fPIC -DPIC" pic_mode=default # What is the maximum length of a command? -max_cmd_len=262144 +max_cmd_len=32768 # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" @@ -6887,10 +6889,10 @@ link_static_flag="-static" no_builtin_flag=" -fno-builtin" # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="" +export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="" +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" @@ -6921,10 +6923,9 @@ old_archive_from_new_cmds="" old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. -archive_cmds="\$CC -shared -nostdlib \$LDFLAGS \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-h \$wl\$soname -o \$lib" -archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | \$SED -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~\$echo \\\"local: *; };\\\" >> \$lib.exp~ - \$CC -shared -nostdlib \${wl}-M \$wl\$lib.exp -o \$lib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags~\$rm \$lib.exp" -postinstall_cmds="chmod +x \$lib" +archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" +postinstall_cmds="" postuninstall_cmds="" # Commands used to build a loadable module (assumed same as above if empty) @@ -6932,16 +6933,16 @@ module_cmds="" module_expsym_cmds="" # Commands to strip libraries. -old_striplib="" -striplib="" +old_striplib="strip --strip-debug" +striplib="strip --strip-unneeded" # Dependencies to place before the objects being linked to create a # shared library. -predep_objects="/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crtbegin.o" +predep_objects="/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/3.4.3/crtbeginS.o" # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects="/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crtn.o" +postdep_objects="/usr/lib/gcc/x86_64-redhat-linux/3.4.3/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/crtn.o" # Dependencies to place before the objects being linked to create a # shared library. @@ -6949,11 +6950,11 @@ predeps="" # Dependencies to place after the objects being linked to create a # shared library. -postdeps="-lstdc++ -lm -lgcc_s -lgcc_s" +postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path="-L/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../.." +compiler_lib_search_path="-L/usr/lib/gcc/x86_64-redhat-linux/3.4.3 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.3 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../.. -L/lib/../lib64 -L/usr/lib/../lib64" # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" @@ -6965,16 +6966,16 @@ file_magic_cmd="\$MAGIC_CMD" allow_undefined_flag="" # Flag that forces no undefined symbols. -no_undefined_flag=" \${wl}-z \${wl}defs" +no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. -finish_cmds="" +finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BDRT][BDRT]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" +global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" @@ -6983,13 +6984,13 @@ global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" # This is the shared library runtime path variable. -runpath_var= +runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=yes +shlibpath_overrides_runpath=no # How to hardcode a shared library path into an executable. hardcode_action=immediate @@ -6999,7 +7000,7 @@ hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. -hardcode_libdir_flag_spec="\${wl}-R \$wl\$libdir" +hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # If ld is used when linking, flag to hardcode $libdir into # a binary during linking. This must work even if $libdir does @@ -7027,16 +7028,16 @@ hardcode_automatic=no # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. -variables_saved_for_relink="PATH LD_LIBRARY_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/ /usr/ccs/bin/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/bin/ /usr/ccs/lib/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/lib/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../ /lib/sparc-sun-solaris2.9/3.4.2/ /lib/ /usr/lib/sparc-sun-solaris2.9/3.4.2/ /usr/lib/" +sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64" # Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 include ld.so.conf.d/*.conf /usr/X11R6/lib /usr/X11R6/lib64 /usr/lib/mysql /usr/lib64/mysql " # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" @@ -7060,10 +7061,10 @@ include_expsyms="" # ### BEGIN LIBTOOL TAG CONFIG: F77 -# Libtool was configured on host ultra: +# Libtool was configured on host flog.yuma.net: # Shell to use when invoking shell scripts. -SHELL="/bin/bash" +SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes @@ -7078,11 +7079,11 @@ build_libtool_need_lc=no allow_libtool_libs_with_static_runtimes=no # Whether or not to optimize for fast installation. -fast_install=needless +fast_install=yes # The host system. host_alias= -host=sparc-sun-solaris2.9 +host=x86_64-unknown-linux-gnu # An echo program that does not interpret backslashes. echo="echo" @@ -7104,13 +7105,13 @@ with_gcc=yes EGREP="grep -E" # The linker used to build libraries. -LD="/usr/ccs/bin/ld" +LD="/usr/bin/ld -m elf_x86_64" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. -NM="/usr/ccs/bin/nm -p" +NM="/usr/bin/nm -B" # A symbol stripping program STRIP="strip" @@ -7154,7 +7155,7 @@ pic_flag=" -fPIC" pic_mode=default # What is the maximum length of a command? -max_cmd_len=262144 +max_cmd_len=32768 # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" @@ -7184,10 +7185,10 @@ link_static_flag="-static" no_builtin_flag="" # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="" +export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="-z allextract\$convenience -z defaultextract" +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" @@ -7218,10 +7219,12 @@ old_archive_from_new_cmds="" old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. -archive_cmds="\$CC -shared \${wl}-h \${wl}\$soname -o \$lib \$libobjs \$deplibs \$compiler_flags" -archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | \$SED -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~\$echo \\\"local: *; };\\\" >> \$lib.exp~ - \$CC -shared \${wl}-M \${wl}\$lib.exp \${wl}-h \${wl}\$soname -o \$lib \$libobjs \$deplibs \$compiler_flags~\$rm \$lib.exp" -postinstall_cmds="chmod +x \$lib" +archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ +cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ +\$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ + \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" +postinstall_cmds="" postuninstall_cmds="" # Commands used to build a loadable module (assumed same as above if empty) @@ -7229,8 +7232,8 @@ module_cmds="" module_expsym_cmds="" # Commands to strip libraries. -old_striplib="" -striplib="" +old_striplib="strip --strip-debug" +striplib="strip --strip-unneeded" # Dependencies to place before the objects being linked to create a # shared library. @@ -7262,16 +7265,16 @@ file_magic_cmd="\$MAGIC_CMD" allow_undefined_flag="" # Flag that forces no undefined symbols. -no_undefined_flag=" -z text" +no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. -finish_cmds="" +finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BDRT][BDRT]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" +global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" @@ -7280,13 +7283,13 @@ global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" # This is the shared library runtime path variable. -runpath_var= +runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=yes +shlibpath_overrides_runpath=no # How to hardcode a shared library path into an executable. hardcode_action=immediate @@ -7296,7 +7299,7 @@ hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. -hardcode_libdir_flag_spec="-R\$libdir" +hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # If ld is used when linking, flag to hardcode $libdir into # a binary during linking. This must work even if $libdir does @@ -7316,7 +7319,7 @@ hardcode_minus_L=no # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. -hardcode_shlibpath_var=no +hardcode_shlibpath_var=unsupported # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. @@ -7324,16 +7327,16 @@ hardcode_automatic=no # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. -variables_saved_for_relink="PATH LD_LIBRARY_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=yes +link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/lib/gcc/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../sparc-sun-solaris2.9/lib/ /usr/ccs/bin/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/bin/ /usr/ccs/lib/sparc-sun-solaris2.9/3.4.2/ /usr/ccs/lib/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../sparc-sun-solaris2.9/3.4.2/ /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../ /lib/sparc-sun-solaris2.9/3.4.2/ /lib/ /usr/lib/sparc-sun-solaris2.9/3.4.2/ /usr/lib/" +sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64" # Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 include ld.so.conf.d/*.conf /usr/X11R6/lib /usr/X11R6/lib64 /usr/lib/mysql /usr/lib64/mysql " # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" diff --git a/libdnet-stripped/src/Makefile b/libdnet-stripped/src/Makefile index ce4de3464..ed936fe8e 100644 --- a/libdnet-stripped/src/Makefile +++ b/libdnet-stripped/src/Makefile @@ -24,7 +24,7 @@ pkglibdir = $(libdir)/libdnet pkgincludedir = $(includedir)/libdnet top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = ../config/install-sh -c +INSTALL = /usr/bin/install -c install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -36,8 +36,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = sparc-sun-solaris2.9 -host_triplet = sparc-sun-solaris2.9 +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.am.common arp-bsd.c arp-ioctl.c \ arp-none.c arp-win32.c err.c eth-bsd.c eth-dlpi.c eth-linux.c \ @@ -65,7 +65,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) -libdnet_la_DEPENDENCIES = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +libdnet_la_DEPENDENCIES = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo am_libdnet_la_OBJECTS = addr-util.lo addr.lo blob.lo ip-util.lo ip6.lo \ rand.lo libdnet_la_OBJECTS = $(am_libdnet_la_OBJECTS) @@ -123,11 +123,11 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LDFLAGS = -LIBOBJS = err$U.o strsep$U.o arp-ioctl$U.o eth-dlpi$U.o fw-none$U.o intf$U.o ip-cooked$U.o route-bsd$U.o tun-none$U.o -LIBS = -lsocket -lnsl +LIBOBJS = strlcat$U.o strlcpy$U.o arp-ioctl$U.o eth-linux$U.o fw-ipchains$U.o intf$U.o ip$U.o route-linux$U.o tun-linux$U.o +LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s -LTLIBOBJS = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +LTLIBOBJS = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo MAINT = # MAINTAINER_MODE_FALSE = MAINTAINER_MODE_TRUE = # @@ -145,7 +145,7 @@ PYTHON_FALSE = PYTHON_TRUE = # RANLIB = ranlib SET_MAKE = -SHELL = /bin/bash +SHELL = /bin/sh STRIP = strip TCLINC = TCLLIB = @@ -169,18 +169,18 @@ am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin -build = sparc-sun-solaris2.9 +build = x86_64-unknown-linux-gnu build_alias = -build_cpu = sparc -build_os = solaris2.9 -build_vendor = sun +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown datadir = ${prefix}/share exec_prefix = ${prefix} -host = sparc-sun-solaris2.9 +host = x86_64-unknown-linux-gnu host_alias = -host_cpu = sparc -host_os = solaris2.9 -host_vendor = sun +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown includedir = ${prefix}/include infodir = ${prefix}/info install_sh = /home/fyodor/nmap/libdnet-stripped/config/install-sh @@ -188,7 +188,7 @@ libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var mandir = ${prefix}/man -mkdir_p = $(mkinstalldirs) +mkdir_p = mkdir -p -- oldincludedir = /usr/include prefix = /usr/local program_transform_name = s,x,x, @@ -202,7 +202,7 @@ DISTCLEANFILES = *~ lib_LTLIBRARIES = libdnet.la libdnet_la_SOURCES = addr-util.c addr.c blob.c ip-util.c ip6.c rand.c EXTRA_libdnet_la_SOURCES = -libdnet_la_LIBADD = err$U.lo strsep$U.lo arp-ioctl$U.lo eth-dlpi$U.lo fw-none$U.lo intf$U.lo ip-cooked$U.lo route-bsd$U.lo tun-none$U.lo +libdnet_la_LIBADD = strlcat$U.lo strlcpy$U.lo arp-ioctl$U.lo eth-linux$U.lo fw-ipchains$U.lo intf$U.lo ip$U.lo route-linux$U.lo tun-linux$U.lo libdnet_la_LDFLAGS = -version-info 1:0:0 all: all-am diff --git a/nmap.cc b/nmap.cc index 36cbbc7c4..a4ed71aef 100644 --- a/nmap.cc +++ b/nmap.cc @@ -106,6 +106,7 @@ #include "idle_scan.h" #include "timing.h" #include "NmapOps.h" +#include "MACLookup.h" using namespace std; @@ -233,6 +234,7 @@ int nmap_main(int argc, char *argv[]) { source addresses? */ unsigned int ideal_scan_group_sz = 0; char hostname[MAXHOSTNAMELEN + 1] = ""; + const char *spoofmac = NULL; time_t timep; char mytime[128]; struct sockaddr_storage ss; @@ -288,6 +290,7 @@ int nmap_main(int argc, char *argv[]) { {"mtu", required_argument, 0, 0}, {"append_output", no_argument, 0, 0}, {"noninteractive", no_argument, 0, 0}, + {"spoof_mac", required_argument, 0, 0}, {"ttl", required_argument, 0, 0}, /* Time to live */ {"allports", no_argument, 0, 0}, #ifdef WIN32 @@ -409,6 +412,10 @@ int nmap_main(int argc, char *argv[]) { o.append_output = 1; } else if (strcmp(long_options[option_index].name, "noninteractive") == 0) { /* Do nothing */ + } else if (strcmp(long_options[option_index].name, "spoof_mac") == 0) { + /* I need to deal with this later, once I'm sure that I have output + files set up, --datadir, etc. */ + spoofmac = optarg; } else if (strcmp(long_options[option_index].name, "allports") == 0) { o.override_excludeports = 1; } else if (strcmp(long_options[option_index].name, "scan_delay") == 0) { @@ -826,6 +833,53 @@ int nmap_main(int argc, char *argv[]) { fatal("You cannot use -F (fast scan) or -p (explicit port selection) with PING scan or LIST scan"); } + if (spoofmac) { + u8 mac_data[6]; + int pos = 0; /* Next index of mac_data to fill in */ + char tmphex[3]; + /* A zero means set it all randomly. Anything that is all digits + or colons is treated as a prefix, with remaining characters for + the 6-byte MAC (if any) chosen randomly. Otherwise, it is + treated as a vendor string for lookup in nmap-mac-prefixes */ + if (strcmp(spoofmac, "0") == 0) { + pos = 0; + } else { + const char *p = spoofmac; + while(*p) { + if (*p == ':') p++; + if (isxdigit(*p) && isxdigit(*(p+1))) { + if (pos >= 6) fatal("Bogus --spoof_mac value encountered (%s) -- only up to 6 bytes permitted", spoofmac); + tmphex[0] = *p; tmphex[1] = *(p+1); tmphex[2] = '\0'; + mac_data[pos] = (u8) strtol(tmphex, NULL, 16); + pos++; + p += 2; + } else break; + } + if (*p) { + /* Failed to parse it as a MAC prefix -- treating as a vendor substring instead */ + if (!MACCorp2Prefix(spoofmac, mac_data)) + fatal("Could not parse as a prefix nor find as a vendor substring the given --spoof_mac argument: %s. If you are giving hex digits, there must be an even number of them.", spoofmac); + pos = 3; + } + } + if (pos < 6) { + get_random_bytes(mac_data + pos, 6 - pos); + } + /* Got the new MAC! */ + const char *vend = MACPrefix2Corp(mac_data); + log_write(LOG_NORMAL|LOG_SKID|LOG_STDOUT, + "Spoofing MAC address %02X:%02X:%02X:%02X:%02X:%02X (%s)\n", + mac_data[0], mac_data[1], mac_data[2], mac_data[3], mac_data[4], + mac_data[5], vend? vend : "No registered vendor"); + o.setSpoofMACAddress(mac_data); + + /* If they want to spoof the MAC address, we should at least make + some effort to actually send raw ethernet frames rather than IP + packets (which would use the real IP */ + if (o.sendpref != PACKET_SEND_IP_STRONG) + o.sendpref = PACKET_SEND_ETH_STRONG; + } + if (!ports) { if (o.ipprotscan) { ports = getdefaultprots(); diff --git a/nmap.h b/nmap.h index 78a065ed4..4c3a8868d 100644 --- a/nmap.h +++ b/nmap.h @@ -364,6 +364,7 @@ void *realloc(); #define PINGTYPE_UDP 512 #define PINGTYPE_ARP 1024 +#define DEFAULT_PING_TYPES PINGTYPE_TCP|PINGTYPE_TCP_USE_ACK|PINGTYPE_ICMP_PING /* TCP/IP ISN sequence prediction classes */ #define SEQ_UNKNOWN 0 #define SEQ_64K 1 diff --git a/targets.cc b/targets.cc index af2cd8c68..2419c3596 100644 --- a/targets.cc +++ b/targets.cc @@ -356,7 +356,9 @@ do { } hs->hostbatch[hidx]->setIfType(rnfo.ii.device_type); if (rnfo.ii.device_type == devt_ethernet) { - hs->hostbatch[hidx]->setSrcMACAddress(rnfo.ii.mac); + if (o.spoofMACAddress()) + hs->hostbatch[hidx]->setSrcMACAddress(o.spoofMACAddress()); + else hs->hostbatch[hidx]->setSrcMACAddress(rnfo.ii.mac); } hs->hostbatch[hidx]->setSourceSockAddr(&rnfo.srcaddr, sizeof(rnfo.srcaddr)); if (hidx == 0) /* Because later ones can have different src addy and be cut off group */ @@ -430,8 +432,11 @@ if (hs->randomize) { initialize_timeout_info(&hs->hostbatch[i]->to); hs->hostbatch[i]->flags |= HOST_UP; /*hostbatch[i].up = 1;*/ } - } else if (!arpping_done) - massping(hs->hostbatch, hs->current_batch_sz, ports, *pingtype); + } else if (!arpping_done) + if (*pingtype & PINGTYPE_ARP) /* A host that we can't arp scan ... maybe localhost */ + massping(hs->hostbatch, hs->current_batch_sz, ports, DEFAULT_PING_TYPES); + else + massping(hs->hostbatch, hs->current_batch_sz, ports, *pingtype); return hs->hostbatch[hs->next_batch_no++]; }