1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Reintegrate 7.97 changes

This commit is contained in:
dmiller
2025-05-15 15:42:03 +00:00
parent ef1c789f2a
commit ec3b1d264b
15 changed files with 69 additions and 59 deletions

View File

@@ -1,7 +1,17 @@
#Nmap Changelog ($Id$); -*-text-*-
Nmap 7.97 [2025-05-12]
o [Zenmap][GH#3087] Fix a crash when starting a scan on Windows in locales that
use non-latin character sets. Also changed Nmap to print the time zone as an
offset from UTC instead of as a localized string. [Daniel Miller]
o Fixed an issue with the parallel forward DNS resolver: it had not been
consulting /etc/hosts, nor did it correctly handle the 'localhost' name.
[Daniel Miller]
o [GH#3088] Mitigate a false-positive detection by replacing a malicious URL in
the example output of http-malware-host [nnposter]
Nmap 7.96 [2025-05-01]

View File

@@ -119,7 +119,7 @@ This options summary is printed when Nmap is run with no arguments, and the late
.RS 4
.\}
.nf
Nmap 7\&.96SVN ( https://nmap\&.org )
Nmap 7\&.97 ( https://nmap\&.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc\&.

View File

@@ -1,4 +1,4 @@
Nmap 7.96SVN ( https://nmap.org )
Nmap 7.97 ( https://nmap.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc.

View File

@@ -12,21 +12,6 @@ PKG_NAME = $(NAME_VERSION).mpkg
IMAGE_STAGING_DIR = $(NAME_VERSION)
NMAP_BUILD_DIR = nmap-build
NMAP_STAGING_DIR = nmap.app
ZENMAP_BUILD_DIR = zenmap-build
ZENMAP_STAGING_DIR = $(ZENMAP_BUILD_DIR)/zenmap/dist/Zenmap.app
NCAT_BUILD_DIR = ncat-build
NCAT_STAGING_DIR = ncat.app
NDIFF_BUILD_DIR = ndiff-build
NDIFF_STAGING_DIR = ndiff.app
NPING_BUILD_DIR = nping-build
NPING_STAGING_DIR = nping.app
JHBUILD_PREFIX=$(HOME)/gtk/inst
JHBUILD_SOURCE=$(HOME)/gtk/source
@@ -69,23 +54,25 @@ tool-checks: have-jhbuild have-gtk-mac-bundler
have-%:
which $*
#$(IMAGE_STAGING_DIR)/$(PKG_NAME): check-nmap check-ncat check-ndiff check-zenmap check-nping LICENSE.formatted
$(IMAGE_STAGING_DIR)/$(PKG_NAME): check-nmap check-ncat check-ndiff check-zenmap check-nping LICENSE.formatted
# Create packages (.pkg) for all the components to install in the installer (.mpkg)
PKGBUILD=pkgbuild --version $(NMAP_VERSION) --scripts Scripts --install-location /Applications --min-os-version $(OSX_MIN_VERSION)
%.pkg: check-%
$(PKGBUILD) --root $*-root --identifier org.insecure.nmap.$* $@
nmap.pkg: check-nmap
$(PKGBUILD) --root nmap-root --identifier org.insecure.nmap $@
zenmap.pkg: check-zenmap
$(PKGBUILD) --root zenmap-root --identifier org.insecure.nmap.zenmap $@
#$(IMAGE_STAGING_DIR)/$(PKG_NAME): nmap.pkg ncat.pkg ndiff.pkg zenmap.pkg nping.pkg LICENSE.formatted
$(IMAGE_STAGING_DIR)/$(PKG_NAME): nmap.pkg ncat.pkg zenmap.pkg nping.pkg LICENSE.formatted
rm -rf $(IMAGE_STAGING_DIR)
mkdir -p $(IMAGE_STAGING_DIR)
cp -rf $(EXTRA_DIST) $(IMAGE_STAGING_DIR)/
# Create packages (.pkg) for all the components to install in the installer (.mpkg)
pkgbuild --root $(NMAP_STAGING_DIR) --identifier org.insecure.nmap --version $(NMAP_VERSION) --install-location /Applications nmap.pkg
pkgbuild --root $(NCAT_STAGING_DIR) --identifier org.insecure.nmap.ncat --version $(NMAP_VERSION) --install-location /Applications ncat.pkg
pkgbuild --root $(NDIFF_STAGING_DIR) --identifier org.insecure.nmap.ndiff --version $(NMAP_VERSION) --install-location /Applications ndiff.pkg
pkgbuild --root $(NPING_STAGING_DIR) --identifier org.insecure.nmap.nping --version $(NMAP_VERSION) --install-location /Applications nping.pkg
pkgbuild --root $(ZENMAP_STAGING_DIR) --identifier org.insecure.nmap.zenmap --version $(NMAP_VERSION) --install-location /Applications zenmap.pkg
# Produce a .xml with packages information
productbuild --synthesize \
--package 'nmap.pkg' \
--package 'ncat.pkg' \
--package 'ndiff.pkg' \
--package 'nping.pkg' \
--package 'zenmap.pkg' \
distribution.xml
@@ -103,12 +90,12 @@ $(IMAGE_STAGING_DIR)/$(PKG_NAME): check-nmap check-ncat check-ndiff check-zenmap
mv $(NAME_VERSION).mpkg $(NAME_VERSION)/$(NAME_VERSION).mpkg
check-%: stage-%
(find $*.app -perm -a+x -type f | xargs otool -L | awk '/:$$/{e=$$0}index($$0,"$(JHBUILD_PREFIX)"){x=1;print e; print}END{exit x}') && echo "Libs are clean"
(find $*.app -perm -a+x -type f -exec otool -l {} \; | awk '/:$$/{e=$$0}$$1=="minos"&&$$2!="$(OSX_MIN_VERSION)"{x=1;print e; print}END{exit x}' ) && echo "Bins are clean"
(find $*-root -perm -a+x -type f | xargs otool -L | awk '/:$$/{e=$$0}index($$0,"$(JHBUILD_PREFIX)"){x=1;print e; print}END{exit x}') && echo "Libs are clean"
(find $*-root -perm -a+x -type f -exec otool -l {} \; | awk '/:$$/{e=$$0}$$1=="minos"&&$$2!="$(OSX_MIN_VERSION)"{x=1;print e; print}END{exit x}' ) && echo "Bins are clean"
check-zenmap: stage-zenmap
(find $(ZENMAP_BUILD_DIR) -perm -a+x -type f | xargs otool -L | awk '/:$$/{e=$$0}index($$0,"$(JHBUILD_PREFIX)"){x=1;print e; print}END{exit x}') && echo "Libs are clean"
(find $(ZENMAP_BUILD_DIR) -perm -a+x -type f -exec otool -l {} \; | awk '/:$$/{e=$$0}$$1=="minos"&&$$2!="$(OSX_MIN_VERSION)"{x=1;print e; print}END{exit x}' ) && echo "Bins are clean"
(find zenmap-build -perm -a+x -type f | xargs otool -L | awk '/:$$/{e=$$0}index($$0,"$(JHBUILD_PREFIX)"){x=1;print e; print}END{exit x}') && echo "Libs are clean"
(find zenmap-build -perm -a+x -type f -exec otool -l {} \; | awk '/:$$/{e=$$0}$$1=="minos"&&$$2!="$(OSX_MIN_VERSION)"{x=1;print e; print}END{exit x}' ) && echo "Bins are clean"
export-%:
rm -rf $*
@@ -134,8 +121,8 @@ build-%: $(NMAP_TARBALL) openssl.modules
stage-%: build-%
sh make-app.sh $* "$(JHBUILD_PREFIX)"
stage-zenmap: export-$(ZENMAP_BUILD_DIR)
cd $(ZENMAP_BUILD_DIR)/zenmap && jhbuild run install_scripts/macosx/make-bundle.sh
stage-zenmap: export-zenmap-build
jhbuild run zenmap-build/zenmap/install_scripts/macosx/make-bundle.sh
build-ndiff:
echo Nothing to do
@@ -146,16 +133,8 @@ LICENSE.formatted:
clean: clean-nmap clean-ncat clean-nping
rm -rf $(IMAGE_STAGING_DIR)
rm -rf $(NMAP_BUILD_DIR)
rm -rf $(NMAP_STAGING_DIR)
rm -rf $(ZENMAP_BUILD_DIR)
#rm -rf $(ZENMAP_STAGING_DIR)
rm -rf $(NCAT_BUILD_DIR)
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 -rf *-build/
rm -rf *-root/
rm -f LICENSE.formatted
rm -f $(IMAGE_NAME)
rm -rf distribution.xml finalDist.xml nmap.pkg ncat.pkg ndiff.pkg nping.pkg zenmap.pkg

12
macosx/Scripts/postinstall Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
#script_path=$0
#package_path=$1
target_path=$2
#target_vol=$3
pkg_name=${INSTALL_PKG_SESSION_ID##*.}
echo "$2/$pkg_name.app/Contents/Resources/bin" > /etc/paths.d/$INSTALL_PKG_SESSION_ID
exit 0

View File

@@ -14,7 +14,7 @@ if [ "x$2" == "x" ]; then
fi
JHBUILD_PREFIX=$2
bundle=$package.app
bundle=$package-root/$package.app
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
@@ -31,8 +31,9 @@ ESCAPED_PREFIX=$(echo "$JHBUILD_PREFIX" | sed 's/\([\/\\.]\)/\\\1/g')
function run_install_name_tool() {
bin=$1
otool -L "$bin" | awk "/$ESCAPED_PREFIX/{print \$1}" | while read dep; do
install_name_tool -change $dep $(echo $dep | sed "s/$ESCAPED_PREFIX\/lib/@executable_path\/..\/lib/") "$bin"
install_name_tool -change $dep $(echo $dep | sed "s/$ESCAPED_PREFIX\/lib/@rpath/") "$bin"
done
install_name_tool -add_rpath "@executable_path/../lib" "$bin" || true
}
function do_jhbuild_app() {

View File

@@ -8,10 +8,14 @@ for /f "usebackq delims=#" %%a in (`"%ProgramFiles(x86)%\Microsoft Visual Studio
@echo on
if "%TARGET%" == "Vars" ( goto :vars )
if "%TARGET%" == "Clean" (
rd /S /Q build-pcre2
) else (
mkdir build-pcre2
cd build-pcre2
cmake.exe -A Win32 -G "Visual Studio 16 2019" ..\..\libpcre\ || goto :QUIT
cd ..
)
msbuild -nologo nmap.sln -m -t:%TARGET% -p:Configuration="%VCCONFIG%" -p:Platform="Win32" -fl
goto :QUIT

View File

@@ -43,7 +43,7 @@ Among Ncat\*(Aqs vast number of features there is the ability to chain Ncats tog
.RS 4
.\}
.nf
Ncat 7\&.96SVN ( https://nmap\&.org/ncat )
Ncat 7\&.97 ( https://nmap\&.org/ncat )
Usage: ncat [options] [hostname] [port]
Options taking a time assume seconds\&. Append \*(Aqms\*(Aq for milliseconds,

View File

@@ -1,4 +1,4 @@
Ncat 7.96SVN ( https://nmap.org/ncat )
Ncat 7.97 ( https://nmap.org/ncat )
Usage: ncat [options] [hostname] [port]
Options taking a time assume seconds. Append 'ms' for milliseconds,

View File

@@ -79,7 +79,7 @@
/* Ncat information for output, etc. */
#define NCAT_NAME "Ncat"
#define NCAT_URL "https://nmap.org/ncat"
#define NCAT_VERSION "7.96SVN"
#define NCAT_VERSION "7.97"
#ifndef __GNUC__
#ifndef __attribute__

6
nmap.h
View File

@@ -123,10 +123,10 @@
/* Edit this definition only within the quotes, because it is read from this
file by the makefiles. */
#define NMAP_MAJOR 7
#define NMAP_MINOR 96
#define NMAP_BUILD 1
#define NMAP_MINOR 97
#define NMAP_BUILD 0
/* SVN, BETA, etc. */
#define NMAP_SPECIAL "SVN"
#define NMAP_SPECIAL ""
#define NMAP_VERSION STR(NMAP_MAJOR) "." STR(NMAP_MINOR) NMAP_SPECIAL
#define NMAP_NUM_VERSION STR(NMAP_MAJOR) "." STR(NMAP_MINOR) "." STR(NMAP_BUILD) ".0"

View File

@@ -112,6 +112,11 @@
// * Figure out best way to estimate completion time
// and display it in a ScanProgressMeter
#include <limits.h>
#include <list>
#include <fstream>
#include <istream>
#ifdef WIN32
#include "nmap_winconfig.h"
/* Need DnetName2PcapName */
@@ -128,11 +133,6 @@
#include "timing.h"
#include "Target.h"
#include <limits.h>
#include <list>
#include <fstream>
#include <istream>
extern NmapOps o;
@@ -1141,7 +1141,6 @@ static void parse_etchosts(const char *fname) {
else if (o.debugging)
log_write(LOG_STDOUT, "Unable to parse /etc/hosts address: %s\n", addr.c_str());
}
ifs.close();
}
static void etchosts_init(void) {

View File

@@ -265,7 +265,7 @@
/* General tunable defines **************************************************/
#define NPING_NAME "Nping"
#define NPING_URL "https://nmap.org/nping"
#define NPING_VERSION "0.7.96SVN"
#define NPING_VERSION "0.7.97"
#define DEFAULT_VERBOSITY VB_0

View File

@@ -63,6 +63,7 @@ import os
import os.path
import sys
import shutil
from glob import glob
from zenmapCore.BasePaths import base_paths
from zenmapCore.Name import APP_NAME
@@ -81,7 +82,11 @@ def get_extra_executable_search_paths():
"""Return a list of additional executable search paths as a convenience for
platforms where the default PATH is inadequate."""
if sys.platform == 'darwin':
return ["/usr/local/bin"]
extra = ["/usr/local/bin"]
for pf in glob("/etc/paths.d/org.insecure.nmap*"):
with open(pf, "r") as f:
extra.append(f.read().strip())
return extra
elif sys.platform == 'win32':
return [dirname(sys.executable)]
return []

View File

@@ -1 +1 @@
VERSION = "7.96+SVN"
VERSION = "7.97"