From a669c3a39f9baf8328fa6b809d3d4cc10a4a2b54 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 17 Feb 2010 01:46:34 +0000 Subject: [PATCH] Merge r16779:16804 from /nmap-exp/david/nmap-nping. This adds Nping into the standard distribution. --- Makefile.in | 23 +++++++++++-- configure | 45 +++++++++++++++++++++++--- configure.ac | 19 +++++++++++ macosx/Makefile | 19 ++++++++--- macosx/README | 6 ++-- macosx/nmap.pmdoc/05nping-contents.xml | 3 ++ macosx/nmap.pmdoc/05nping.xml | 25 ++++++++++++++ macosx/nmap.pmdoc/index.xml | 6 ++++ mswin32/Makefile | 3 +- mswin32/nmap.sln | 6 ++++ mswin32/nsis/Nmap.nsi | 12 +++++-- 11 files changed, 149 insertions(+), 18 deletions(-) create mode 100644 macosx/nmap.pmdoc/05nping-contents.xml create mode 100644 macosx/nmap.pmdoc/05nping.xml diff --git a/Makefile.in b/Makefile.in index 75c49ac35..d4aed1fbb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,6 +29,7 @@ LIBPCREDIR = @LIBPCREDIR@ export LIBDNETDIR = @LIBDNETDIR@ ZENMAPDIR = zenmap NDIFFDIR = ndiff +NPINGDIR = nping PYTHON = @PYTHON@ DEFS = @DEFS@ -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\" # With GCC, add extra security checks to source code. @@ -72,9 +73,12 @@ TARGET = nmap INSTALLNSE=@INSTALLNSE@ BUILDZENMAP=@BUILDZENMAP@ BUILDNDIFF=@BUILDNDIFF@ +BUILDNPING=@BUILDNPING@ INSTALLZENMAP=@INSTALLZENMAP@ INSTALLNDIFF=@INSTALLNDIFF@ +INSTALLNPING=@INSTALLNPING@ UNINSTALLZENMAP=@UNINSTALLZENMAP@ +UNINSTALLNPING=@UNINSTALLNPING@ ifneq (@LIBLUA_LIBS@,) NSE_SRC=nse_main.cc nse_nsock.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_binlib.cc nse_bit.cc @@ -98,7 +102,7 @@ OBJS = main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ all: @LUA_BUILD@ @PCAP_BUILD@ @PCRE_BUILD@ @DNET_BUILD@ @NBASE_BUILD@ @NSOCK_BUILD@ @NCAT_BUILD@ - $(MAKE) $(TARGET) $(BUILDZENMAP) $(BUILDNDIFF) + $(MAKE) $(TARGET) $(BUILDZENMAP) $(BUILDNDIFF) $(BUILDNPING) $(TARGET): @LUA_DEPENDS@ @PCAP_DEPENDS@ @PCRE_DEPENDS@ @DNET_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(OBJS) @echo Compiling nmap @@ -179,6 +183,8 @@ zenmap_clean: -cd $(ZENMAPDIR) && $(PYTHON) setup.py clean --all ndiff_clean: -cd $(NDIFFDIR) && $(PYTHON) setup.py clean --all +nping_clean: + -cd $(NPINGDIR) && $(MAKE) clean pcap_dist_clean: -cd $(LIBPCAPDIR) && $(MAKE) distclean pcre_dist_clean: @@ -197,6 +203,8 @@ zenmap_dist_clean: zenmap_clean -cd $(ZENMAPDIR) && rm -rf MANIFEST build/ dist/ ndiff_dist_clean: ndiff_clean -cd $(NDIFFDIR) && rm -rf build/ dist/ +nping_dist_clean: + -cd $(NPINGDIR) && $(MAKE) distclean debugclean: rm -f *.gcov *.gcda *.gcno gmon.out @@ -266,6 +274,9 @@ install-zenmap: $(ZENMAPDIR)/setup.py build-ndiff: cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)") +build-nping: $(NPINGDIR)/Makefile nbase_build nsock_build + @cd $(NPINGDIR) && $(MAKE) + install-ndiff: cd $(NDIFFDIR) && $(PYTHON) setup.py install --prefix "$(prefix)" $(if $(DESTDIR),--root "$(DESTDIR)") @@ -293,10 +304,13 @@ install-nse: $(TARGET) install-ncat: $(NCATDIR)/ncat @cd $(NCATDIR) && $(MAKE) install -install: install-nmap $(INSTALLNSE) $(INSTALLZENMAP) @NCAT_INSTALL@ $(INSTALLNDIFF) +install-nping: $(NPINGDIR)/nping + @cd $(NPINGDIR) && $(MAKE) install + +install: install-nmap $(INSTALLNSE) $(INSTALLZENMAP) @NCAT_INSTALL@ $(INSTALLNDIFF) $(INSTALLNPING) @echo "NMAP SUCCESSFULLY INSTALLED" -uninstall: uninstall-nmap $(UNINSTALLZENMAP) @NCAT_UNINSTALL@ +uninstall: uninstall-nmap $(UNINSTALLZENMAP) @NCAT_UNINSTALL@ $(UNINSTALLNPING) uninstall-nmap: rm -f $(DESTDIR)$(bindir)/$(TARGET) @@ -316,6 +330,9 @@ uninstall-zenmap: uninstall-ncat: @cd $(NCATDIR) && $(MAKE) uninstall +uninstall-nping: + @cd $(NPINGDIR) && $(MAKE) uninstall + ${srcdir}/configure: configure.ac cd ${srcdir} && autoconf diff --git a/configure b/configure index 5530942b6..5c8b31189 100755 --- a/configure +++ b/configure @@ -669,13 +669,18 @@ PCRE_BUILD PCRE_DEPENDS LIBPCREDIR LIBPCRE_LIBS -subdirs LIBPCAP_LIBS PCAP_DIST_CLEAN PCAP_CLEAN PCAP_BUILD PCAP_DEPENDS OPENSSL_LIBS +NPING_DIST_CLEAN +NPING_CLEAN +UNINSTALLNPING +INSTALLNPING +BUILDNPING +subdirs ZENMAP_DIST_CLEAN ZENMAP_CLEAN UNINSTALLZENMAP @@ -769,6 +774,7 @@ enable_nls with_localdirs with_ndiff with_zenmap +with_nping with_openssl with_libpcap with_libpcre @@ -790,7 +796,8 @@ CXX CXXFLAGS CCC CPP' -ac_subdirs_all='libpcap +ac_subdirs_all='nping +libpcap libpcre libdnet-stripped nbase @@ -1427,6 +1434,7 @@ Optional Packages: /usr/local/{include,libs} if they exist --without-ndiff Skip installation of the Ndiff utility --without-zenmap Skip installation of the Zenmap graphical frontend + --without-nping Skip installation of the Nping utility --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. @@ -6351,6 +6359,35 @@ fi +# Do they want Nping? + +# Check whether --with-nping was given. +if test "${with_nping+set}" = set; then + withval=$with_nping; +else + with_nping=check +fi + + +if test "$with_nping" = "no"; then + BUILDNPING="" + INSTALLNPING="" + UNINSTALLNPING="" +else + BUILDNPING=build-nping + INSTALLNPING=install-nping + UNINSTALLNPING=uninstall-nping + + +subdirs="$subdirs nping" + +fi + + + + + + # We test whether they specified openssl desires explicitly use_openssl="yes" specialssldir="" @@ -7243,9 +7280,7 @@ fi if test $have_libpcap != yes ; then - - -subdirs="$subdirs libpcap" + subdirs="$subdirs libpcap" fi diff --git a/configure.ac b/configure.ac index 67e9387d5..880f09597 100644 --- a/configure.ac +++ b/configure.ac @@ -236,6 +236,25 @@ AC_SUBST(UNINSTALLZENMAP) AC_SUBST(ZENMAP_CLEAN) AC_SUBST(ZENMAP_DIST_CLEAN) +# Do they want Nping? +AC_ARG_WITH(nping, AC_HELP_STRING([--without-nping], [Skip installation of the Nping utility]), [], [with_nping=check]) + +if test "$with_nping" = "no"; then + BUILDNPING="" + INSTALLNPING="" + UNINSTALLNPING="" +else + BUILDNPING=build-nping + INSTALLNPING=install-nping + UNINSTALLNPING=uninstall-nping + AC_CONFIG_SUBDIRS(nping) +fi +AC_SUBST(BUILDNPING) +AC_SUBST(INSTALLNPING) +AC_SUBST(UNINSTALLNPING) +AC_SUBST(NPING_CLEAN) +AC_SUBST(NPING_DIST_CLEAN) + # We test whether they specified openssl desires explicitly use_openssl="yes" specialssldir="" diff --git a/macosx/Makefile b/macosx/Makefile index 42968a147..62bffb311 100644 --- a/macosx/Makefile +++ b/macosx/Makefile @@ -23,6 +23,9 @@ NCAT_STAGING_DIR = Ncat NDIFF_BUILD_DIR = ndiff-build NDIFF_STAGING_DIR = Ndiff +NPING_BUILD_DIR = nping-build +NPING_STAGING_DIR = Nping + PREFIX = /usr/local PACKAGEMAKER = /Developer/usr/bin/packagemaker @@ -55,7 +58,7 @@ $(IMAGE_NAME): $(IMAGE_STAGING_DIR)/$(PKG_NAME) $(EXTRA_DIST_FILES) rm -f $@ hdiutil create -imagekey zlib-level=9 -srcfolder $(IMAGE_STAGING_DIR) $@ -$(IMAGE_STAGING_DIR)/$(PKG_NAME): stage-nmap stage-ncat stage-ndiff stage-zenmap README COPYING.formatted +$(IMAGE_STAGING_DIR)/$(PKG_NAME): stage-nmap stage-ncat stage-ndiff stage-zenmap stage-nping README COPYING.formatted mkdir -p $(IMAGE_STAGING_DIR) $(PACKAGEMAKER) --doc nmap.pmdoc --title "Nmap $(NMAP_VERSION)" -o $@ @@ -65,17 +68,23 @@ export-%: svn export ..@BASE $* stage-nmap: export-$(NMAP_BUILD_DIR) - cd $(NMAP_BUILD_DIR) && ./configure --without-zenmap --without-ncat --without-ndiff $(CONFIGURE_ARGS) + cd $(NMAP_BUILD_DIR) && ./configure --without-zenmap --without-ncat --without-ndiff --without-nping $(CONFIGURE_ARGS) make -C $(NMAP_BUILD_DIR) rm -rf $(NMAP_STAGING_DIR) make -C $(NMAP_BUILD_DIR) install DESTDIR="`pwd`/$(NMAP_STAGING_DIR)" stage-ncat: export-$(NCAT_BUILD_DIR) - cd $(NCAT_BUILD_DIR) && ./configure --without-zenmap --with-ncat --without-ndiff $(CONFIGURE_ARGS) + cd $(NCAT_BUILD_DIR) && ./configure --without-zenmap --with-ncat --without-ndiff --without-nping $(CONFIGURE_ARGS) make -C $(NCAT_BUILD_DIR) rm -rf $(NCAT_STAGING_DIR) make -C $(NCAT_BUILD_DIR) install-ncat DESTDIR="`pwd`/$(NCAT_STAGING_DIR)" +stage-nping: export-$(NPING_BUILD_DIR) + cd $(NPING_BUILD_DIR) && ./configure --without-zenmap --without-ncat --without-ndiff --with-nping $(CONFIGURE_ARGS) + make -C $(NPING_BUILD_DIR) + rm -rf $(NPING_STAGING_DIR) + make -C $(NPING_BUILD_DIR) install-nping DESTDIR="`pwd`/$(NPING_STAGING_DIR)" + # make-bundle.sh uses these to build its authorization wrapper. export CC CPPFLAGS CFLAGS CXXFLAGS LDFLAGS @@ -86,7 +95,7 @@ stage-zenmap: export-$(ZENMAP_BUILD_DIR) cp -rf $(ZENMAP_BUILD_DIR)/zenmap/dist/Zenmap.app $(ZENMAP_STAGING_DIR)/Applications/ stage-ndiff: export-$(NDIFF_BUILD_DIR) - cd $(NDIFF_BUILD_DIR) && ./configure --without-zenmap --without-ncat --with-ndiff $(CONFIGURE_ARGS) + cd $(NDIFF_BUILD_DIR) && ./configure --without-zenmap --without-ncat --with-ndiff --without-nping $(CONFIGURE_ARGS) make -C $(NDIFF_BUILD_DIR) build-ndiff rm -rf $(NDIFF_STAGING_DIR) make -C $(NDIFF_BUILD_DIR) install-ndiff DESTDIR="`pwd`/$(NDIFF_STAGING_DIR)" @@ -113,6 +122,8 @@ clean: rm -rf $(NCAT_STAGING_DIR) rm -rf $(NDIFF_BUILD_DIR) rm -rf $(NDIFF_STAGING_DIR) + rm -rf $(NPING_BUILD_DIR) + rm -rf $(NPING_STAGING_DIR) rm -f COPYING.formatted rm -f $(IMAGE_NAME) diff --git a/macosx/README b/macosx/README index 7bab9ff88..bf61e7e0b 100644 --- a/macosx/README +++ b/macosx/README @@ -1,7 +1,7 @@ -Nmap is a free and open source utility for network exploration and security auditing. Zenmap is a multi-platform graphical frontend and results viewer for Nmap. Ncat is a general-purpose network sending and receiving utility, a reimplementation of Netcat. Ndiff is a an Nmap scan comparison utility. +Nmap is a free and open source utility for network exploration and security auditing. Zenmap is a multi-platform graphical frontend and results viewer for Nmap. Ncat is a general-purpose network sending and receiving utility, a reimplementation of Netcat. Ndiff is a an Nmap scan comparison utility. Nping is a tool for packet generation and sending. -This package contains Nmap, Zenmap, Ncat, and Ndiff. It is intended to work on Intel and PowerPC Macs running Mac OS X 10.4 or later. +This package contains Nmap, Zenmap, Ncat, Ndiff, and Nping. It is intended to work on Intel and PowerPC Macs running Mac OS X 10.4 or later. Installation of all packages is optional. Unselect Zenmap to get just the command-line tool. Unselect Nmap if you prefer to use a copy of Nmap that is already installed. Zenmap will not work without Nmap. -The nmap, ncat, and ndiff command-line binaries will be installed in /usr/local/bin, and additional support files will be installed in /usr/local/share. The Zenmap application bundle will be installed in /Applications/Zenmap.app. +The nmap, ncat, ndiff, and nping command-line binaries will be installed in /usr/local/bin, and additional support files will be installed in /usr/local/share. The Zenmap application bundle will be installed in /Applications/Zenmap.app. diff --git a/macosx/nmap.pmdoc/05nping-contents.xml b/macosx/nmap.pmdoc/05nping-contents.xml new file mode 100644 index 000000000..9138f050c --- /dev/null +++ b/macosx/nmap.pmdoc/05nping-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/05nping.xml b/macosx/nmap.pmdoc/05nping.xml new file mode 100644 index 000000000..21bd0a011 --- /dev/null +++ b/macosx/nmap.pmdoc/05nping.xml @@ -0,0 +1,25 @@ + + + org.insecure.nping.nping.pkg + 1 + + + + Nping + / + + + + + parent + installFrom.isRelativeType + + + 01nping-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/index.xml b/macosx/nmap.pmdoc/index.xml index 292193253..1c41e274f 100644 --- a/macosx/nmap.pmdoc/index.xml +++ b/macosx/nmap.pmdoc/index.xml @@ -31,6 +31,11 @@ starts_enabled="true" starts_hidden="false"> + + + @@ -43,6 +48,7 @@ 02zenmap.xml 03ncat.xml 04ndiff.xml + 05nping.xml properties.customizeOption properties.title properties.anywhereDomain diff --git a/mswin32/Makefile b/mswin32/Makefile index 9c2de0c24..029476049 100644 --- a/mswin32/Makefile +++ b/mswin32/Makefile @@ -32,6 +32,7 @@ winbuild: cp vcredist_x86.exe nmap-$(NMAP_VERSION) cp ../ncat/Release/ncat.exe nmap-$(NMAP_VERSION) cp ../ncat/Release/ca-bundle.crt nmap-$(NMAP_VERSION) + cp ../nping/Release/nping.exe nmap-$(NMAP_VERSION) # Install the ndiff batch file wrapper in the zip distribution. cp ../ndiff/ndiff nmap-$(NMAP_VERSION)/ndiff.py cp python-wrap.bat nmap-$(NMAP_VERSION)/ndiff.bat @@ -48,5 +49,5 @@ winbuild: mv nmap-$(NMAP_VERSION)/NmapInstaller.exe nmap-$(NMAP_VERSION)-setup.exe clean: - $(VCEXPRESS) nmap.sln /clean + "$(VCEXPRESS)" nmap.sln /clean rm -rf Debug Release nmapbuild.log diff --git a/mswin32/nmap.sln b/mswin32/nmap.sln index 3b476f8e9..f840087e9 100644 --- a/mswin32/nmap.sln +++ b/mswin32/nmap.sln @@ -28,6 +28,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ncat", "..\ncat\ncat.vcproj {B630C8F7-3138-43E8-89ED-78742FA2AC5F} = {B630C8F7-3138-43E8-89ED-78742FA2AC5F} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nping", "..\nping\nping.vcproj", "{CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -62,6 +64,10 @@ Global {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|Win32.Build.0 = Debug|Win32 {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|Win32.ActiveCfg = Release|Win32 {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|Win32.Build.0 = Release|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|Win32.ActiveCfg = Debug|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|Win32.Build.0 = Debug|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|Win32.ActiveCfg = Release|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/mswin32/nsis/Nmap.nsi b/mswin32/nsis/Nmap.nsi index 7893db5e5..768b382dd 100644 --- a/mswin32/nsis/Nmap.nsi +++ b/mswin32/nsis/Nmap.nsi @@ -24,8 +24,8 @@ ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Nmap" "" - !define VERSION "5.10BETA2" - VIProductVersion "5.10.0.2" + !define VERSION "5.21" + VIProductVersion "5.21.0.0" VIAddVersionKey /LANG=1033 "FileVersion" "${VERSION}" VIAddVersionKey /LANG=1033 "ProductName" "Nmap" VIAddVersionKey /LANG=1033 "CompanyName" "Insecure.org" @@ -287,6 +287,12 @@ Section "Ndiff (Scan comparison tool)" SecNdiff File ..\nmap-${VERSION}\python26.dll File /r ..\nmap-${VERSION}\py2exe SectionEnd + +Section "Nping (Packet generator)" SecNping + SetOutPath "$INSTDIR" + SetOverwrite on + File ..\nmap-${VERSION}\nping.exe +SectionEnd ;-------------------------------- ;Descriptions @@ -299,6 +305,7 @@ SectionEnd LangString DESC_SecZenmap ${LANG_ENGLISH} "Installs Zenmap, the official Nmap graphical user interface. Recommended." LangString DESC_SecNcat ${LANG_ENGLISH} "Installs Ncat, Nmap's Netcat replacement." LangString DESC_SecNdiff ${LANG_ENGLISH} "Installs Ndiff, a tool for comparing Nmap XML files." + LangString DESC_SecNping ${LANG_ENGLISH} "Installs Nping, a packet generation tool." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN @@ -309,6 +316,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecZenmap} $(DESC_SecZenmap) !insertmacro MUI_DESCRIPTION_TEXT ${SecNcat} $(DESC_SecNcat) !insertmacro MUI_DESCRIPTION_TEXT ${SecNdiff} $(DESC_SecNdiff) + !insertmacro MUI_DESCRIPTION_TEXT ${SecNping} $(DESC_SecNping) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section