Skip to content

Commit

Permalink
libdnet stripped and integrated, ARP ping scan starting to work prett…
Browse files Browse the repository at this point in the history
…y well
  • Loading branch information
fyodor committed Apr 30, 2005
1 parent 3922128 commit 4d2beed
Show file tree
Hide file tree
Showing 106 changed files with 65,969 additions and 23 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ o Changed from CVS to Subversion source control system (which

o Added 'leet ASCII art to the confugrator! ARTIST NOTE: If you
think the ASCII art sucks, feel free to send me alternatives. Note
that only people compiling the UNIX source code get the ASCII art.
that only people compiling the UNIX source code get the ASCII
art. (ASCII artist unknown).

Nmap 3.81

Expand Down
17 changes: 13 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CXX = @CXX@
CCOPT =
LIBPCAPDIR = @libpcapdir@
LIBPCREDIR = @LIBPCREDIR@
LIBDNETDIR = @LIBDNETDIR@
INCLS = -I$(LIBPCAPDIR)
DEFS = @DEFS@ -DNMAP_VERSION=\"$(NMAP_VERSION)\" -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
# For mtrace debugging -- see MTRACE define in main.cc for instructions
Expand All @@ -29,7 +30,7 @@ CPPFLAGS = @CPPFLAGS@
# CFLAGS = $(DEFS) $(INCLS)
STATIC =
LDFLAGS = @LDFLAGS@ $(STATIC)
LIBS = @LIBNBASE_LIBS@ @LIBNSOCK_LIBS@ @LIBPCRE_LIBS@ @LIBPCAP_LIBS@ @OPENSSL_LIBS@ @LIBS@
LIBS = @LIBNBASE_LIBS@ @LIBNSOCK_LIBS@ @LIBPCRE_LIBS@ @LIBPCAP_LIBS@ @OPENSSL_LIBS@ @LIBDNET_LIBS@ @LIBS@
# LIBS = -lefence @LIBS@
# LIBS = -lrmalloc @LIBS@
SHTOOL = ./shtool
Expand Down Expand Up @@ -59,7 +60,7 @@ export DEPS = nmap.h nmap_amigaos.h nmap_error.h targets.h idle_scan.h osscan.h

all: $(TARGET) $(TARGETNMAPFE)

$(TARGET): $(DEPS) @PCAP_DEPENDS@ @PCRE_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(OBJS)
$(TARGET): $(DEPS) @PCAP_DEPENDS@ @PCRE_DEPENDS@ @LIBDNET_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(OBJS)
@echo Compiling nmap
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
Expand All @@ -71,6 +72,9 @@ FORCE:
$(LIBPCREDIR)/libpcre.a: $(LIBPCREDIR)/Makefile FORCE
@echo Compiling libpcre; cd $(LIBPCREDIR) && $(MAKE)

$(LIBDNETDIR)/src/.libs/libdnet.a: $(LIBDNETDIR)/Makefile FORCE
@echo Compiling libdnet; cd $(LIBDNETDIR) && $(MAKE)

$(LIBPCAPDIR)/libpcap.a: $(LIBPCAPDIR)/Makefile FORCE
@echo Compiling libpcap; cd $(LIBPCAPDIR) && $(MAKE)

Expand Down Expand Up @@ -101,14 +105,16 @@ distro:
web:
cd scripts && $(MAKE) web

clean: @PCAP_CLEAN@ @PCRE_CLEAN@ nmapfe_clean nsock_clean nbase_clean my_clean
clean: @PCAP_CLEAN@ @PCRE_CLEAN@ @DNET_CLEAN@ nmapfe_clean nsock_clean nbase_clean my_clean

my_clean:
rm -f $(OBJS) $(TARGET) config.cache
pcap_clean:
-cd $(LIBPCAPDIR) && $(MAKE) clean
pcre_clean:
-cd $(LIBPCREDIR) && $(MAKE) clean
dnet_clean
-cd $(LIBDNETDIR) && $(MAKE) clean
nmapfe_clean:
-cd nmapfe && $(MAKE) clean
nbase_clean:
Expand All @@ -119,8 +125,11 @@ pcap_dist_clean:
-cd $(LIBPCAPDIR) && $(MAKE) distclean
pcre_dist_clean:
-cd $(LIBPCREDIR) && $(MAKE) distclean
dnet_dist_clean:
-cd $(LIBDNETDIR) && $(MAKE) distclean

distclean: my_clean my_distclean @PCAP_DIST_CLEAN@ @PCRE_DIST_CLEAN@ @DNET_DIST_CLEAN@

distclean: my_clean my_distclean @PCAP_DIST_CLEAN@ @PCRE_DIST_CLEAN@
my_distclean:
rm -f Makefile Makefile.bak config.h stamp-h stamp-h.in \
config.cache config.log config.status
Expand Down
55 changes: 54 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ ac_includes_default="\
#endif"

ac_subdirs_all="$ac_subdirs_all libpcre"
ac_subdirs_all="$ac_subdirs_all libdnet-stripped"
ac_subdirs_all="$ac_subdirs_all $nmap_cfg_subdirs"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libpcapdir pcredir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CXXPROG COMPAT_OBJS COMPAT_SRCS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP TARGETNMAPFE INSTALLNMAPFE OPENSSL_LIBS PCAP_DEPENDS PCAP_CLEAN PCAP_DIST_CLEAN LIBPCAP_LIBS subdirs LIBPCRE_LIBS LIBPCREDIR PCRE_DEPENDS PCRE_CLEAN PCRE_DIST_CLEAN NBASEDIR LIBNBASE_LIBS NSOCKDIR LIBNSOCK_LIBS GTK_CONFIG LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libpcapdir pcredir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CXXPROG COMPAT_OBJS COMPAT_SRCS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP TARGETNMAPFE INSTALLNMAPFE OPENSSL_LIBS PCAP_DEPENDS PCAP_CLEAN PCAP_DIST_CLEAN LIBPCAP_LIBS subdirs LIBPCRE_LIBS LIBPCREDIR PCRE_DEPENDS PCRE_CLEAN PCRE_DIST_CLEAN LIBDNET_LIBS LIBDNETDIR DNET_DEPENDS DNET_CLEAN DNET_DIST_CLEAN NBASEDIR LIBNBASE_LIBS NSOCKDIR LIBNSOCK_LIBS GTK_CONFIG LIBOBJS LTLIBOBJS'
ac_subst_files=''

# Initialize some variables set by options.
Expand Down Expand Up @@ -859,6 +860,7 @@ Optional Packages:
--with-openssl=DIR Use optional openssl libs and includes from DIR/lib/ and DIR/include/openssl/)
--with-libpcap=DIR Look for pcap in DIR/include and DIR/libs
--with-libpcre=DIR Use an existing (compiled) pcre lib from DIR/include and DIR/lib. Specify --with-libpcre=included to always use the version included with Nmap
--with-libdnet=DIR Use an existing (compiled) dnet lib from DIR/include and DIR/lib.
--with-libnbase=DIR Look for nbase include/libs in DIR
--with-libnsock=DIR Compile and link to libnsock in DIR
Expand Down Expand Up @@ -6308,6 +6310,52 @@ fi
have_dnet=no
requested_included_dnet=no
LIBDNETDIR=libdnet-stripped
# First we test whether they specified libdnet explicitly
# Check whether --with-libdnet or --without-libdnet was given.
if test "${with_libdnet+set}" = set; then
withval="$with_libdnet"
case "$with_libdnet" in
yes)
;;
included)
;;
*)
CXXFLAGS="-I$with_libdnet/include $CXXFLAGS"
LDFLAGS="-L$with_libdnet/lib $LDFLAGS"
have_dnet=yes
;;
esac
fi;
# If they didn't provide location, we use the included one
if test $have_dnet != yes ; then
subdirs="$subdirs libdnet-stripped "
CXXFLAGS="-I$LIBDNETDIR/include $CXXFLAGS"
LIBDNET_LIBS="$LIBDNETDIR/src/.libs/libdnet.a"
DNET_DEPENDS="$LIBDNETDIR/libdnet.a"
DNET_CLEAN="dnet_clean"
DNET_DIST_CLEAN="dnet_dist_clean"
else
LIBDNET_LIBS="-ldnet"
DNET_DEPENDS=""
DNET_CLEAN=""
DNET_DIST_CLEAN=""
fi
echo "$as_me:$LINENO: checking struct ip" >&5
Expand Down Expand Up @@ -8329,6 +8377,11 @@ s,@LIBPCREDIR@,$LIBPCREDIR,;t t
s,@PCRE_DEPENDS@,$PCRE_DEPENDS,;t t
s,@PCRE_CLEAN@,$PCRE_CLEAN,;t t
s,@PCRE_DIST_CLEAN@,$PCRE_DIST_CLEAN,;t t
s,@LIBDNET_LIBS@,$LIBDNET_LIBS,;t t
s,@LIBDNETDIR@,$LIBDNETDIR,;t t
s,@DNET_DEPENDS@,$DNET_DEPENDS,;t t
s,@DNET_CLEAN@,$DNET_CLEAN,;t t
s,@DNET_DIST_CLEAN@,$DNET_DIST_CLEAN,;t t
s,@NBASEDIR@,$NBASEDIR,;t t
s,@LIBNBASE_LIBS@,$LIBNBASE_LIBS,;t t
s,@NSOCKDIR@,$NSOCKDIR,;t t
Expand Down
40 changes: 40 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,46 @@ AC_SUBST(PCRE_DEPENDS)
AC_SUBST(PCRE_CLEAN)
AC_SUBST(PCRE_DIST_CLEAN)

have_dnet=no
requested_included_dnet=no
LIBDNETDIR=libdnet-stripped

# First we test whether they specified libdnet explicitly
AC_ARG_WITH(libdnet,
[ --with-libdnet=DIR Use an existing (compiled) dnet lib from DIR/include and DIR/lib.],
[ case "$with_libdnet" in
yes)
;;
included)
;;
*)
CXXFLAGS="-I$with_libdnet/include $CXXFLAGS"
LDFLAGS="-L$with_libdnet/lib $LDFLAGS"
have_dnet=yes
;;
esac]
)

# If they didn't provide location, we use the included one
if test $have_dnet != yes ; then
AC_CONFIG_SUBDIRS( libdnet-stripped )
CXXFLAGS="-I$LIBDNETDIR/include $CXXFLAGS"
LIBDNET_LIBS="$LIBDNETDIR/src/.libs/libdnet.a"
DNET_DEPENDS="$LIBDNETDIR/libdnet.a"
DNET_CLEAN="dnet_clean"
DNET_DIST_CLEAN="dnet_dist_clean"
else
LIBDNET_LIBS="-ldnet"
DNET_DEPENDS=""
DNET_CLEAN=""
DNET_DIST_CLEAN=""
fi

AC_SUBST(LIBDNET_LIBS)
AC_SUBST(LIBDNETDIR)
AC_SUBST(DNET_DEPENDS)
AC_SUBST(DNET_CLEAN)
AC_SUBST(DNET_DIST_CLEAN)

dnl AC_HEADER_TIME

Expand Down
2 changes: 1 addition & 1 deletion docs/leet-nmap-ascii-art.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
(__ ' /x / x _/ ( \___' \ /
, x / ( ' . / . / | \ /
/ / _/ / + / \/
' (__/ / (artist unknown) \
' (__/ / \
NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND REPONSIBLY
59 changes: 59 additions & 0 deletions libdnet-stripped/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

*BSD, MacOS X, Linux
--------------------

./configure && make

Solaris, IRIX, BSD/OS, HP-UX, Tru64
-----------------------------------

For firewall support, install Darren Reed's IP Filter package:

http://coombs.anu.edu.au/~avalon/

For tunnel support on Solaris, install the Universal TUN/TAP Driver:

http://vtun.sourceforge.net/tun/

Unixware, AIX
-------------

These ports are incomplete. If anyone can set me up with legitimate
root access to these platforms, it would be most appreciated. :-)

Windows 2000/XP
---------------

For raw Ethernet sending, install the WinPcap driver and DLLs, and
extract their developer pack to a build directory:

http://winpcap.polito.it/install/default.htm

# XXX - unsupported for now
# For tunnel interface support, install the OpenVPN "TAP-Win32 Virtual
# Ethernet Adapter" component (their Windows installer will let you
# install it alone):
#
# http://openvpn.sourceforge.net/

For firewall support, install HSC's PktFilter service:

http://www.hsc.fr/ressources/outils/pktfilter/index.html.en

Most Windows developers should just use the libdnet developer's pack
(with MinGW and MSVC++ libraries) instead of building it themselves.
But for those who really want to know...

To build a MinGW native library (under Cygwin+MinGW):

./configure && make

To build a Microsoft Visual C++ native library and Python module
(again, under Cygwin+MinGW):

./configure
cd python && C:/Python23/python.exe setup.py build
cd ../src && lib /out:dnet.lib *.obj


# $Id: INSTALL,v 1.4 2005/02/15 07:38:19 dugsong Exp $
28 changes: 28 additions & 0 deletions libdnet-stripped/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Copyright (c) 2000-2004 Dug Song <dugsong@monkey.org>
All rights reserved, all wrongs reversed.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of the authors and copyright holders may not be used to
endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Loading

0 comments on commit 4d2beed

Please sign in to comment.