update nmap to 7.94
This commit is contained in:
parent
c7556dea95
commit
6a1ece0eb3
@ -6,35 +6,34 @@ Subject: [PATCH] Remove nse_pcrelib from build.
|
|||||||
Conflict: NA
|
Conflict: NA
|
||||||
Reference: https://github.com/nmap/nmap/commit/d131a096a869195be36ef7d4fa36739373346cb2
|
Reference: https://github.com/nmap/nmap/commit/d131a096a869195be36ef7d4fa36739373346cb2
|
||||||
---
|
---
|
||||||
Makefile.in | 6 +++---
|
Makefile.in | 6 +++---
|
||||||
mswin32/nmap.vcxproj | 2 --
|
nse_main.cc | 2 --
|
||||||
nse_main.cc | 2 --
|
nse_main.lua | 2 +-
|
||||||
nse_main.lua | 2 +-
|
nselib/unittest.lua | 1 -
|
||||||
nselib/unittest.lua | 1 -
|
4 files changed, 4 insertions(+), 7 deletions(-)
|
||||||
5 files changed, 4 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Makefile.in b/Makefile.in
|
diff --git a/Makefile.in b/Makefile.in
|
||||||
index ccfceda..8c19056 100644
|
index 2b13e86..a924301 100644
|
||||||
--- a/Makefile.in
|
--- a/Makefile.in
|
||||||
+++ b/Makefile.in
|
+++ b/Makefile.in
|
||||||
@@ -88,9 +88,9 @@ UNINSTALLNDIFF=@UNINSTALLNDIFF@
|
@@ -88,9 +88,9 @@ UNINSTALLNDIFF=@UNINSTALLNDIFF@
|
||||||
UNINSTALLNPING=@UNINSTALLNPING@
|
UNINSTALLNPING=@UNINSTALLNPING@
|
||||||
|
|
||||||
ifneq (@NOLUA@,yes)
|
ifneq (@NOLUA@,yes)
|
||||||
-NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_lpeg.cc
|
-NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_db.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_lpeg.cc
|
||||||
-NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_pcrelib.h nse_lpeg.h
|
-NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_db.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_pcrelib.h nse_lpeg.h
|
||||||
-NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_lpeg.o
|
-NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_db.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_lpeg.o
|
||||||
+NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_lpeg.cc
|
+NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_db.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_lpeg.cc
|
||||||
+NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_lpeg.h
|
+NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_db.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_lpeg.h
|
||||||
+NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_lpeg.o
|
+NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_db.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_lpeg.o
|
||||||
ifneq (@OPENSSL_LIBS@,)
|
ifneq (@OPENSSL_LIBS@,)
|
||||||
NSE_SRC+=nse_openssl.cc nse_ssl_cert.cc
|
NSE_SRC+=nse_openssl.cc nse_ssl_cert.cc
|
||||||
NSE_HDRS+=nse_openssl.h nse_ssl_cert.h
|
NSE_HDRS+=nse_openssl.h nse_ssl_cert.h
|
||||||
diff --git a/nse_main.cc b/nse_main.cc
|
diff --git a/nse_main.cc b/nse_main.cc
|
||||||
index 110291f..b946c7c 100644
|
index d5d460e..2382688 100644
|
||||||
--- a/nse_main.cc
|
--- a/nse_main.cc
|
||||||
+++ b/nse_main.cc
|
+++ b/nse_main.cc
|
||||||
@@ -14,7 +14,6 @@
|
@@ -15,7 +15,6 @@
|
||||||
#include "nse_fs.h"
|
#include "nse_fs.h"
|
||||||
#include "nse_nsock.h"
|
#include "nse_nsock.h"
|
||||||
#include "nse_nmaplib.h"
|
#include "nse_nmaplib.h"
|
||||||
@ -42,19 +41,19 @@ index 110291f..b946c7c 100644
|
|||||||
#include "nse_openssl.h"
|
#include "nse_openssl.h"
|
||||||
#include "nse_debug.h"
|
#include "nse_debug.h"
|
||||||
#include "nse_lpeg.h"
|
#include "nse_lpeg.h"
|
||||||
@@ -557,7 +556,6 @@ static int panic (lua_State *L)
|
@@ -562,7 +561,6 @@ static int panic (lua_State *L)
|
||||||
static void set_nmap_libraries (lua_State *L)
|
static void set_nmap_libraries (lua_State *L)
|
||||||
{
|
{
|
||||||
static const luaL_Reg libs[] = {
|
static const luaL_Reg libs[] = {
|
||||||
- {NSE_PCRELIBNAME, luaopen_pcrelib},
|
- {NSE_PCRELIBNAME, luaopen_pcrelib},
|
||||||
{NSE_NMAPLIBNAME, luaopen_nmap},
|
{NSE_NMAPLIBNAME, luaopen_nmap},
|
||||||
|
{NSE_DBLIBNAME, luaopen_db},
|
||||||
{LFSLIBNAME, luaopen_lfs},
|
{LFSLIBNAME, luaopen_lfs},
|
||||||
{LPEGLIBNAME, luaopen_lpeg},
|
|
||||||
diff --git a/nse_main.lua b/nse_main.lua
|
diff --git a/nse_main.lua b/nse_main.lua
|
||||||
index af5f611..7fba46e 100644
|
index 24c9d2a..596aba9 100644
|
||||||
--- a/nse_main.lua
|
--- a/nse_main.lua
|
||||||
+++ b/nse_main.lua
|
+++ b/nse_main.lua
|
||||||
@@ -285,7 +285,7 @@ local REQUIRE_ERROR = {};
|
@@ -292,7 +292,7 @@ local REQUIRE_ERROR = {};
|
||||||
rawset(stdnse, "silent_require", function (...)
|
rawset(stdnse, "silent_require", function (...)
|
||||||
local status, mod = pcall(require, ...);
|
local status, mod = pcall(require, ...);
|
||||||
if not status then
|
if not status then
|
||||||
@ -64,7 +63,7 @@ index af5f611..7fba46e 100644
|
|||||||
else
|
else
|
||||||
return mod;
|
return mod;
|
||||||
diff --git a/nselib/unittest.lua b/nselib/unittest.lua
|
diff --git a/nselib/unittest.lua b/nselib/unittest.lua
|
||||||
index ac90c31..d780b85 100644
|
index b22de05..aaf5fce 100644
|
||||||
--- a/nselib/unittest.lua
|
--- a/nselib/unittest.lua
|
||||||
+++ b/nselib/unittest.lua
|
+++ b/nselib/unittest.lua
|
||||||
@@ -107,7 +107,6 @@ local libs = {
|
@@ -107,7 +107,6 @@ local libs = {
|
||||||
@ -75,6 +74,3 @@ index ac90c31..d780b85 100644
|
|||||||
"pgsql",
|
"pgsql",
|
||||||
"pop3",
|
"pop3",
|
||||||
"pppoe",
|
"pppoe",
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
|
|||||||
@ -24,21 +24,21 @@ Reference: https://github.com/nmap/nmap/commit/828ab48764b82d0226e860c73c5dac5b1
|
|||||||
delete mode 100644 nselib/pcre.luadoc
|
delete mode 100644 nselib/pcre.luadoc
|
||||||
|
|
||||||
diff --git a/checklibs.sh b/checklibs.sh
|
diff --git a/checklibs.sh b/checklibs.sh
|
||||||
index ff58326..6483358 100644
|
index 2048e2a..26e9d8a 100644
|
||||||
--- a/checklibs.sh
|
--- a/checklibs.sh
|
||||||
+++ b/checklibs.sh
|
+++ b/checklibs.sh
|
||||||
@@ -11,13 +11,13 @@ trim_version() {
|
@@ -11,13 +11,13 @@ trim_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_libpcre() {
|
check_libpcre() {
|
||||||
- PCRE_SOURCE="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/"
|
- PCRE_SOURCE="https://sourceforge.net/projects/pcre/files/latest/download"
|
||||||
+ PCRE_SOURCE="https://github.com/PCRE2Project/pcre2/releases/latest"
|
+ PCRE_SOURCE="https://github.com/PCRE2Project/pcre2/releases/latest"
|
||||||
PCRE_MAJOR=""
|
PCRE_MAJOR=""
|
||||||
PCRE_MINOR=""
|
PCRE_MINOR=""
|
||||||
- eval $(grep '^PCRE_MAJOR=' $NDIR/libpcre/configure)
|
- eval $(grep '^PCRE_MAJOR=' $NDIR/libpcre/configure)
|
||||||
- eval $(grep '^PCRE_MINOR=' $NDIR/libpcre/configure)
|
- eval $(grep '^PCRE_MINOR=' $NDIR/libpcre/configure)
|
||||||
- PCRE_VERSION="$PCRE_MAJOR.$PCRE_MINOR"
|
- PCRE_VERSION="$PCRE_MAJOR.$PCRE_MINOR"
|
||||||
- PCRE_LATEST=$(curl -ls $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).tar.gz$/){print $1}' | newest)
|
- PCRE_LATEST=$(curl -s -I $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).zip/){print $1}' | newest)
|
||||||
+ eval $(grep '^PCRE2_MAJOR=' $NDIR/libpcre/configure)
|
+ eval $(grep '^PCRE2_MAJOR=' $NDIR/libpcre/configure)
|
||||||
+ eval $(grep '^PCRE2_MINOR=' $NDIR/libpcre/configure)
|
+ eval $(grep '^PCRE2_MINOR=' $NDIR/libpcre/configure)
|
||||||
+ PCRE_VERSION="$PCRE2_MAJOR.$PCRE2_MINOR"
|
+ PCRE_VERSION="$PCRE2_MAJOR.$PCRE2_MINOR"
|
||||||
@ -47,7 +47,7 @@ index ff58326..6483358 100644
|
|||||||
echo "Newer version of libpcre available"
|
echo "Newer version of libpcre available"
|
||||||
echo " Current:" $PCRE_VERSION
|
echo " Current:" $PCRE_VERSION
|
||||||
diff --git a/configure b/configure
|
diff --git a/configure b/configure
|
||||||
index f8e1358..26cb1f6 100755
|
index d1d2f19..12764ee 100755
|
||||||
--- a/configure
|
--- a/configure
|
||||||
+++ b/configure
|
+++ b/configure
|
||||||
@@ -1451,8 +1451,8 @@ Optional Packages:
|
@@ -1451,8 +1451,8 @@ Optional Packages:
|
||||||
@ -61,7 +61,7 @@ index f8e1358..26cb1f6 100755
|
|||||||
--with-libpcre=included Always use the version included with Nmap
|
--with-libpcre=included Always use the version included with Nmap
|
||||||
--with-libz=DIR Use specific copy of libz
|
--with-libz=DIR Use specific copy of libz
|
||||||
--with-libz=included Always use version included with Nmap
|
--with-libz=included Always use version included with Nmap
|
||||||
@@ -6421,58 +6421,19 @@ fi
|
@@ -6437,58 +6437,19 @@ fi
|
||||||
|
|
||||||
# If they didn't specify it, we try to find it
|
# If they didn't specify it, we try to find it
|
||||||
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
|
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
|
||||||
@ -128,7 +128,7 @@ index f8e1358..26cb1f6 100755
|
|||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
@@ -6482,35 +6443,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
@@ -6498,35 +6459,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
@ -171,7 +171,7 @@ index f8e1358..26cb1f6 100755
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -6520,8 +6476,8 @@ fi
|
@@ -6536,8 +6492,8 @@ fi
|
||||||
if test $have_pcre != yes ; then
|
if test $have_pcre != yes ; then
|
||||||
subdirs="$subdirs libpcre"
|
subdirs="$subdirs libpcre"
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ index f8e1358..26cb1f6 100755
|
|||||||
PCRE_BUILD="build-pcre"
|
PCRE_BUILD="build-pcre"
|
||||||
PCRE_CLEAN="clean-pcre"
|
PCRE_CLEAN="clean-pcre"
|
||||||
PCRE_DIST_CLEAN="distclean-pcre"
|
PCRE_DIST_CLEAN="distclean-pcre"
|
||||||
@@ -6530,19 +6486,19 @@ $as_echo "#define PCRE_INCLUDED 1" >>confdefs.h
|
@@ -6546,19 +6502,19 @@ $as_echo "#define PCRE_INCLUDED 1" >>confdefs.h
|
||||||
|
|
||||||
else
|
else
|
||||||
# We only need to check for and use this if we are NOT using included pcre
|
# We only need to check for and use this if we are NOT using included pcre
|
||||||
@ -208,10 +208,10 @@ index f8e1358..26cb1f6 100755
|
|||||||
PCRE_CLEAN=""
|
PCRE_CLEAN=""
|
||||||
PCRE_DIST_CLEAN=""
|
PCRE_DIST_CLEAN=""
|
||||||
diff --git a/configure.ac b/configure.ac
|
diff --git a/configure.ac b/configure.ac
|
||||||
index ac123af..6e695f3 100644
|
index 7835d9b..c25fb04 100644
|
||||||
--- a/configure.ac
|
--- a/configure.ac
|
||||||
+++ b/configure.ac
|
+++ b/configure.ac
|
||||||
@@ -507,7 +507,7 @@ LIBPCREDIR=libpcre
|
@@ -510,7 +510,7 @@ LIBPCREDIR=libpcre
|
||||||
|
|
||||||
# First we test whether they specified libpcre explicitly
|
# First we test whether they specified libpcre explicitly
|
||||||
AC_ARG_WITH(libpcre,
|
AC_ARG_WITH(libpcre,
|
||||||
@ -220,7 +220,7 @@ index ac123af..6e695f3 100644
|
|||||||
AC_HELP_STRING([--with-libpcre=included], [Always use the version included with Nmap]),
|
AC_HELP_STRING([--with-libpcre=included], [Always use the version included with Nmap]),
|
||||||
[ case "$with_libpcre" in
|
[ case "$with_libpcre" in
|
||||||
yes)
|
yes)
|
||||||
@@ -525,27 +525,28 @@ AC_HELP_STRING([--with-libpcre=included], [Always use the version included with
|
@@ -528,27 +528,28 @@ AC_HELP_STRING([--with-libpcre=included], [Always use the version included with
|
||||||
|
|
||||||
# If they didn't specify it, we try to find it
|
# If they didn't specify it, we try to find it
|
||||||
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
|
if test $have_pcre != yes -a $requested_included_pcre != yes ; then
|
||||||
@ -260,10 +260,10 @@ index ac123af..6e695f3 100644
|
|||||||
PCRE_CLEAN=""
|
PCRE_CLEAN=""
|
||||||
PCRE_DIST_CLEAN=""
|
PCRE_DIST_CLEAN=""
|
||||||
diff --git a/nmap.cc b/nmap.cc
|
diff --git a/nmap.cc b/nmap.cc
|
||||||
index f1b8bf9..62984a5 100644
|
index e4c65e7..96f0230 100644
|
||||||
--- a/nmap.cc
|
--- a/nmap.cc
|
||||||
+++ b/nmap.cc
|
+++ b/nmap.cc
|
||||||
@@ -2764,10 +2764,12 @@ static void display_nmap_version() {
|
@@ -2803,10 +2803,12 @@ static void display_nmap_version() {
|
||||||
without.push_back("libz");
|
without.push_back("libz");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -279,10 +279,10 @@ index f1b8bf9..62984a5 100644
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
diff --git a/nmap_config.h.in b/nmap_config.h.in
|
diff --git a/nmap_config.h.in b/nmap_config.h.in
|
||||||
index c9ac750..10fdda9 100644
|
index 67dbeda..1dae65a 100644
|
||||||
--- a/nmap_config.h.in
|
--- a/nmap_config.h.in
|
||||||
+++ b/nmap_config.h.in
|
+++ b/nmap_config.h.in
|
||||||
@@ -105,8 +105,6 @@
|
@@ -103,8 +103,6 @@
|
||||||
|
|
||||||
#undef HAVE_TERMIOS_H
|
#undef HAVE_TERMIOS_H
|
||||||
|
|
||||||
@ -292,10 +292,10 @@ index c9ac750..10fdda9 100644
|
|||||||
|
|
||||||
#undef IN_ADDR_DEEPSTRUCT
|
#undef IN_ADDR_DEEPSTRUCT
|
||||||
diff --git a/nping/nping_config.h.in b/nping/nping_config.h.in
|
diff --git a/nping/nping_config.h.in b/nping/nping_config.h.in
|
||||||
index 9d4ccb4..2e4377f 100644
|
index 98638cb..9b6f971 100644
|
||||||
--- a/nping/nping_config.h.in
|
--- a/nping/nping_config.h.in
|
||||||
+++ b/nping/nping_config.h.in
|
+++ b/nping/nping_config.h.in
|
||||||
@@ -103,8 +103,6 @@
|
@@ -101,8 +101,6 @@
|
||||||
|
|
||||||
#undef HAVE_TERMIOS_H
|
#undef HAVE_TERMIOS_H
|
||||||
|
|
||||||
@ -867,10 +867,10 @@ index c442a96..0000000
|
|||||||
--- local n = regex:gmatch("string to be searched", match)
|
--- local n = regex:gmatch("string to be searched", match)
|
||||||
-function pcre_obj:gmatch(string, func, n, ef)
|
-function pcre_obj:gmatch(string, func, n, ef)
|
||||||
diff --git a/service_scan.cc b/service_scan.cc
|
diff --git a/service_scan.cc b/service_scan.cc
|
||||||
index 66e0d92..8b57d9a 100644
|
index cf13d8b..473b3a6 100644
|
||||||
--- a/service_scan.cc
|
--- a/service_scan.cc
|
||||||
+++ b/service_scan.cc
|
+++ b/service_scan.cc
|
||||||
@@ -247,7 +247,7 @@ ServiceProbeMatch::ServiceProbeMatch() {
|
@@ -250,7 +250,7 @@ ServiceProbeMatch::ServiceProbeMatch() {
|
||||||
product_template = version_template = info_template = NULL;
|
product_template = version_template = info_template = NULL;
|
||||||
hostname_template = ostype_template = devicetype_template = NULL;
|
hostname_template = ostype_template = devicetype_template = NULL;
|
||||||
regex_compiled = NULL;
|
regex_compiled = NULL;
|
||||||
@ -879,10 +879,10 @@ index 66e0d92..8b57d9a 100644
|
|||||||
isInitialized = false;
|
isInitialized = false;
|
||||||
matchops_ignorecase = false;
|
matchops_ignorecase = false;
|
||||||
matchops_dotall = false;
|
matchops_dotall = false;
|
||||||
@@ -268,8 +268,21 @@ ServiceProbeMatch::~ServiceProbeMatch() {
|
@@ -269,8 +269,21 @@ ServiceProbeMatch::~ServiceProbeMatch() {
|
||||||
|
if (devicetype_template) free(devicetype_template);
|
||||||
for (it = cpe_templates.begin(); it != cpe_templates.end(); it++)
|
for (it = cpe_templates.begin(); it != cpe_templates.end(); it++)
|
||||||
free(*it);
|
free(*it);
|
||||||
matchstrlen = 0;
|
|
||||||
- if (regex_compiled) pcre_free(regex_compiled);
|
- if (regex_compiled) pcre_free(regex_compiled);
|
||||||
- if (regex_extra) pcre_free(regex_extra);
|
- if (regex_extra) pcre_free(regex_extra);
|
||||||
+ if (regex_compiled)
|
+ if (regex_compiled)
|
||||||
@ -901,12 +901,12 @@ index 66e0d92..8b57d9a 100644
|
|||||||
+ match_context=NULL;
|
+ match_context=NULL;
|
||||||
+ }
|
+ }
|
||||||
isInitialized = false;
|
isInitialized = false;
|
||||||
matchops_anchor = -1;
|
|
||||||
}
|
}
|
||||||
@@ -347,9 +360,9 @@ static bool next_template(const char **matchtext, char **modestr, char **tmplt,
|
|
||||||
void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
@@ -350,9 +363,9 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
||||||
const char *p;
|
char *tmptemplate;
|
||||||
char *modestr, *tmptemplate, *flags;
|
char modestr[4];
|
||||||
|
char flags[4];
|
||||||
- int pcre_compile_ops = 0;
|
- int pcre_compile_ops = 0;
|
||||||
- const char *pcre_errptr = NULL;
|
- const char *pcre_errptr = NULL;
|
||||||
- int pcre_erroffset = 0;
|
- int pcre_erroffset = 0;
|
||||||
@ -916,7 +916,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
char **curr_tmp = NULL;
|
char **curr_tmp = NULL;
|
||||||
|
|
||||||
if (isInitialized) fatal("Sorry ... %s does not yet support reinitializion", __func__);
|
if (isInitialized) fatal("Sorry ... %s does not yet support reinitializion", __func__);
|
||||||
@@ -405,38 +418,40 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
@@ -405,41 +418,42 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
||||||
|
|
||||||
// Next we compile and study the regular expression to match
|
// Next we compile and study the regular expression to match
|
||||||
if (matchops_ignorecase)
|
if (matchops_ignorecase)
|
||||||
@ -935,7 +935,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
if (regex_compiled == NULL)
|
if (regex_compiled == NULL)
|
||||||
- fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %d): %s\n", __func__, lineno, pcre_erroffset, pcre_errptr);
|
- fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %d): %s\n", __func__, lineno, pcre_erroffset, pcre_errptr);
|
||||||
+ fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %ld): %d\n", __func__, lineno, pcre2_erroffset, pcre2_errcode);
|
+ fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %ld): %d\n", __func__, lineno, pcre2_erroffset, pcre2_errcode);
|
||||||
|
|
||||||
- // Now study the regexp for greater efficiency
|
- // Now study the regexp for greater efficiency
|
||||||
- regex_extra = pcre_study(regex_compiled, 0
|
- regex_extra = pcre_study(regex_compiled, 0
|
||||||
-#ifdef PCRE_STUDY_EXTRA_NEEDED
|
-#ifdef PCRE_STUDY_EXTRA_NEEDED
|
||||||
@ -977,16 +977,18 @@ index 66e0d92..8b57d9a 100644
|
|||||||
+ pcre2_set_recursion_limit(match_context, 10000);
|
+ pcre2_set_recursion_limit(match_context, 10000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free(modestr);
|
-
|
||||||
@@ -502,7 +517,6 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle
|
/* OK! Now we look for any templates of the form ?/.../
|
||||||
|
* where ? is either p, v, i, h, o, or d. / is any
|
||||||
|
* delimiter character and ... is a template */
|
||||||
|
@@ -509,34 +523,29 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle
|
||||||
static char devicetype[32];
|
static char devicetype[32];
|
||||||
static char cpe_a[80], cpe_h[80], cpe_o[80];
|
static char cpe_a[80], cpe_h[80], cpe_o[80];
|
||||||
char *bufc = (char *) buf;
|
char *bufc = (char *) buf;
|
||||||
- int ovector[150]; // allows 50 substring matches (including the overall match)
|
- int ovector[150]; // allows 50 substring matches (including the overall match)
|
||||||
assert(isInitialized);
|
assert(isInitialized);
|
||||||
|
|
||||||
assert (matchtype == SERVICEMATCH_REGEX);
|
// Clear out the output struct
|
||||||
@@ -511,27 +525,23 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle
|
|
||||||
memset(&MD_return, 0, sizeof(MD_return));
|
memset(&MD_return, 0, sizeof(MD_return));
|
||||||
MD_return.isSoft = isSoft;
|
MD_return.isSoft = isSoft;
|
||||||
|
|
||||||
@ -1019,7 +1021,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
hostname, sizeof(hostname), ostype, sizeof(ostype), devicetype, sizeof(devicetype),
|
hostname, sizeof(hostname), ostype, sizeof(ostype), devicetype, sizeof(devicetype),
|
||||||
cpe_a, sizeof(cpe_a), cpe_h, sizeof(cpe_h), cpe_o, sizeof(cpe_o));
|
cpe_a, sizeof(cpe_a), cpe_h, sizeof(cpe_h), cpe_o, sizeof(cpe_o));
|
||||||
if (*product) MD_return.product = product;
|
if (*product) MD_return.product = product;
|
||||||
@@ -680,18 +690,17 @@ static char *transform_cpe(const char *s) {
|
@@ -685,18 +694,17 @@ static char *transform_cpe(const char *s) {
|
||||||
// This function does the substitution of a placeholder like $2 or $P(4). It
|
// This function does the substitution of a placeholder like $2 or $P(4). It
|
||||||
// returns a newly allocated string, or NULL if it fails. tmplvar is a template
|
// returns a newly allocated string, or NULL if it fails. tmplvar is a template
|
||||||
// variable, such as "$P(2)". We set *tmplvarend to the character after the
|
// variable, such as "$P(2)". We set *tmplvarend to the character after the
|
||||||
@ -1043,7 +1045,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
struct substargs command_args;
|
struct substargs command_args;
|
||||||
char *result;
|
char *result;
|
||||||
size_t n, len;
|
size_t n, len;
|
||||||
@@ -723,6 +732,8 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -728,6 +736,8 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmplvarend) *tmplvarend = tmplvar;
|
if (tmplvarend) *tmplvarend = tmplvar;
|
||||||
@ -1052,7 +1054,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
|
|
||||||
strbuf_init(&result, &n, &len);
|
strbuf_init(&result, &n, &len);
|
||||||
if (!*substcommand) {
|
if (!*substcommand) {
|
||||||
@@ -730,9 +741,10 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -735,9 +745,10 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
if (subnum > 9 || subnum <= 0) return NULL;
|
if (subnum > 9 || subnum <= 0) return NULL;
|
||||||
if (subnum >= nummatches) return NULL;
|
if (subnum >= nummatches) return NULL;
|
||||||
offstart = ovector[subnum * 2];
|
offstart = ovector[subnum * 2];
|
||||||
@ -1065,7 +1067,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
// A plain-jane copy
|
// A plain-jane copy
|
||||||
strbuf_append(&result, &n, &len, (const char *) subject + offstart, offend - offstart);
|
strbuf_append(&result, &n, &len, (const char *) subject + offstart, offend - offstart);
|
||||||
} else if (strcmp(substcommand, "P") == 0) {
|
} else if (strcmp(substcommand, "P") == 0) {
|
||||||
@@ -744,13 +756,14 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -749,13 +760,14 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
if (subnum > 9 || subnum <= 0) return NULL;
|
if (subnum > 9 || subnum <= 0) return NULL;
|
||||||
if (subnum >= nummatches) return NULL;
|
if (subnum >= nummatches) return NULL;
|
||||||
offstart = ovector[subnum * 2];
|
offstart = ovector[subnum * 2];
|
||||||
@ -1083,7 +1085,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
if (isprint((int) subject[i]))
|
if (isprint((int) subject[i]))
|
||||||
strbuf_append(&result, &n, &len, (const char *) subject + i, 1);
|
strbuf_append(&result, &n, &len, (const char *) subject + i, 1);
|
||||||
}
|
}
|
||||||
@@ -767,14 +780,15 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -772,14 +784,15 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
if (subnum > 9 || subnum <= 0) return NULL;
|
if (subnum > 9 || subnum <= 0) return NULL;
|
||||||
if (subnum >= nummatches) return NULL;
|
if (subnum >= nummatches) return NULL;
|
||||||
offstart = ovector[subnum * 2];
|
offstart = ovector[subnum * 2];
|
||||||
@ -1102,7 +1104,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
if (memcmp(subject + i, findstr, findstrlen) != 0) {
|
if (memcmp(subject + i, findstr, findstrlen) != 0) {
|
||||||
strbuf_append(&result, &n, &len, (const char *) subject + i, 1); // no match
|
strbuf_append(&result, &n, &len, (const char *) subject + i, 1); // no match
|
||||||
i++;
|
i++;
|
||||||
@@ -800,8 +814,9 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -805,8 +818,9 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
if (subnum > 9 || subnum <= 0) return NULL;
|
if (subnum > 9 || subnum <= 0) return NULL;
|
||||||
if (subnum >= nummatches) return NULL;
|
if (subnum >= nummatches) return NULL;
|
||||||
offstart = ovector[subnum * 2];
|
offstart = ovector[subnum * 2];
|
||||||
@ -1113,7 +1115,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
|
|
||||||
// overflow
|
// overflow
|
||||||
if (offend - offstart > 8) {
|
if (offend - offstart > 8) {
|
||||||
@@ -819,11 +834,11 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -824,11 +838,11 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (bigendian) {
|
if (bigendian) {
|
||||||
@ -1127,7 +1129,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
val = (val<<8) + subject[i];
|
val = (val<<8) + subject[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -842,16 +857,16 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
@@ -847,16 +861,16 @@ static char *substvar(char *tmplvar, char **tmplvarend,
|
||||||
|
|
||||||
// This function takes a template string (tmpl) which can have
|
// This function takes a template string (tmpl) which can have
|
||||||
// placeholders in it such as $1 for substring matches in a regexp
|
// placeholders in it such as $1 for substring matches in a regexp
|
||||||
@ -1148,7 +1150,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
int newstrlen,
|
int newstrlen,
|
||||||
char *(*transform)(const char *) = NULL) {
|
char *(*transform)(const char *) = NULL) {
|
||||||
int newlen;
|
int newlen;
|
||||||
@@ -890,7 +905,7 @@ static int dotmplsubst(const u8 *subject, int subjectlen,
|
@@ -895,7 +909,7 @@ static int dotmplsubst(const u8 *subject, int subjectlen,
|
||||||
dst += newlen;
|
dst += newlen;
|
||||||
}
|
}
|
||||||
srcstart = srcend;
|
srcstart = srcend;
|
||||||
@ -1157,7 +1159,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
if (subst == NULL)
|
if (subst == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
/* Apply transformation if requested. */
|
/* Apply transformation if requested. */
|
||||||
@@ -932,14 +947,14 @@ static int dotmplsubst(const u8 *subject, int subjectlen,
|
@@ -937,14 +951,14 @@ static int dotmplsubst(const u8 *subject, int subjectlen,
|
||||||
// for a string, that string will have zero length after the function
|
// for a string, that string will have zero length after the function
|
||||||
// call (assuming the corresponding length passed in is at least 1)
|
// call (assuming the corresponding length passed in is at least 1)
|
||||||
|
|
||||||
@ -1180,7 +1182,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
assert(productlen >= 0 && versionlen >= 0 && infolen >= 0 &&
|
assert(productlen >= 0 && versionlen >= 0 && infolen >= 0 &&
|
||||||
@@ -958,9 +973,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -963,9 +977,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
|
|
||||||
// Now lets get this started! We begin with the product name
|
// Now lets get this started! We begin with the product name
|
||||||
if (product_template) {
|
if (product_template) {
|
||||||
@ -1192,7 +1194,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(product_template)? product_template : "",
|
(product_template)? product_template : "",
|
||||||
(version_template)? version_template : "",
|
(version_template)? version_template : "",
|
||||||
(info_template)? info_template : "");
|
(info_template)? info_template : "");
|
||||||
@@ -970,9 +985,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -975,9 +989,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version_template) {
|
if (version_template) {
|
||||||
@ -1204,7 +1206,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(product_template)? product_template : "",
|
(product_template)? product_template : "",
|
||||||
(version_template)? version_template : "",
|
(version_template)? version_template : "",
|
||||||
(info_template)? info_template : "");
|
(info_template)? info_template : "");
|
||||||
@@ -982,9 +997,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -987,9 +1001,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info_template) {
|
if (info_template) {
|
||||||
@ -1216,7 +1218,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(product_template)? product_template : "",
|
(product_template)? product_template : "",
|
||||||
(version_template)? version_template : "",
|
(version_template)? version_template : "",
|
||||||
(info_template)? info_template : "");
|
(info_template)? info_template : "");
|
||||||
@@ -994,9 +1009,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -999,9 +1013,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostname_template) {
|
if (hostname_template) {
|
||||||
@ -1228,7 +1230,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(hostname_template)? hostname_template : "");
|
(hostname_template)? hostname_template : "");
|
||||||
if (hostnamelen > 0) *hostname = '\0';
|
if (hostnamelen > 0) *hostname = '\0';
|
||||||
retval = -1;
|
retval = -1;
|
||||||
@@ -1004,9 +1019,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -1009,9 +1023,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ostype_template) {
|
if (ostype_template) {
|
||||||
@ -1240,7 +1242,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(ostype_template)? ostype_template : "");
|
(ostype_template)? ostype_template : "");
|
||||||
if (ostypelen > 0) *ostype = '\0';
|
if (ostypelen > 0) *ostype = '\0';
|
||||||
retval = -1;
|
retval = -1;
|
||||||
@@ -1014,9 +1029,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -1019,9 +1033,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devicetype_template) {
|
if (devicetype_template) {
|
||||||
@ -1252,7 +1254,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
(devicetype_template)? devicetype_template : "");
|
(devicetype_template)? devicetype_template : "");
|
||||||
if (devicetypelen > 0) *devicetype = '\0';
|
if (devicetypelen > 0) *devicetype = '\0';
|
||||||
retval = -1;
|
retval = -1;
|
||||||
@@ -1027,7 +1042,7 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -1032,7 +1046,7 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
store in cpe_a, cpe_h, or cpe_o as appropriate. */
|
store in cpe_a, cpe_h, or cpe_o as appropriate. */
|
||||||
for (unsigned int i = 0; i < cpe_templates.size(); i++) {
|
for (unsigned int i = 0; i < cpe_templates.size(); i++) {
|
||||||
char *cpe;
|
char *cpe;
|
||||||
@ -1261,7 +1263,7 @@ index 66e0d92..8b57d9a 100644
|
|||||||
int part;
|
int part;
|
||||||
|
|
||||||
part = cpe_get_part(cpe_templates[i]);
|
part = cpe_get_part(cpe_templates[i]);
|
||||||
@@ -1050,9 +1065,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
@@ -1055,9 +1069,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen,
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1274,10 +1276,10 @@ index 66e0d92..8b57d9a 100644
|
|||||||
if (cpelen > 0) *cpe = '\0';
|
if (cpelen > 0) *cpe = '\0';
|
||||||
retval = -1;
|
retval = -1;
|
||||||
diff --git a/service_scan.h b/service_scan.h
|
diff --git a/service_scan.h b/service_scan.h
|
||||||
index de2dfad..650a891 100644
|
index 7723d81..8ebdee7 100644
|
||||||
--- a/service_scan.h
|
--- a/service_scan.h
|
||||||
+++ b/service_scan.h
|
+++ b/service_scan.h
|
||||||
@@ -71,16 +71,8 @@
|
@@ -69,16 +69,8 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -1296,10 +1298,10 @@ index de2dfad..650a891 100644
|
|||||||
|
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -162,8 +154,9 @@ class ServiceProbeMatch {
|
@@ -155,8 +147,9 @@ class ServiceProbeMatch {
|
||||||
int matchtype; // SERVICEMATCH_REGEX or SERVICESCAN_STATIC
|
bool isInitialized; // Has InitMatch yet been called?
|
||||||
char *matchstr; // Regular expression text, or static string
|
const char *servicename;
|
||||||
int matchstrlen; // Because static strings may have embedded NULs
|
char *matchstr; // Regular expression text
|
||||||
- pcre *regex_compiled;
|
- pcre *regex_compiled;
|
||||||
- pcre_extra *regex_extra;
|
- pcre_extra *regex_extra;
|
||||||
+ pcre2_code *regex_compiled;
|
+ pcre2_code *regex_compiled;
|
||||||
@ -1308,7 +1310,7 @@ index de2dfad..650a891 100644
|
|||||||
bool matchops_ignorecase;
|
bool matchops_ignorecase;
|
||||||
bool matchops_dotall;
|
bool matchops_dotall;
|
||||||
bool isSoft; // is this a soft match? ("softmatch" keyword in nmap-service-probes)
|
bool isSoft; // is this a soft match? ("softmatch" keyword in nmap-service-probes)
|
||||||
@@ -189,14 +182,14 @@ class ServiceProbeMatch {
|
@@ -179,14 +172,14 @@ class ServiceProbeMatch {
|
||||||
// are sufficient). Returns zero for success. If no template is available
|
// are sufficient). Returns zero for success. If no template is available
|
||||||
// for a string, that string will have zero length after the function
|
// for a string, that string will have zero length after the function
|
||||||
// call (assuming the corresponding length passed in is at least 1)
|
// call (assuming the corresponding length passed in is at least 1)
|
||||||
@ -1331,6 +1333,3 @@ index de2dfad..650a891 100644
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
12
nmap.spec
12
nmap.spec
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Name: nmap
|
Name: nmap
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 7.92
|
Version: 7.94
|
||||||
Release: 5
|
Release: 1
|
||||||
License: Nmap
|
License: Nmap
|
||||||
Summary: A tool for network discovery and security auditing.
|
Summary: A tool for network discovery and security auditing.
|
||||||
Requires: %{name}-ncat = %{epoch}:%{version}-%{release}
|
Requires: %{name}-ncat = %{epoch}:%{version}-%{release}
|
||||||
@ -33,7 +33,7 @@ auditing. It was designed to rapidly scan large networks, but works fine against
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version} -p1
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
rm -rf libpcap macosx mswin32 libssh2 libz
|
rm -rf libpcap libpcre macosx mswin32 libssh2 libz
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
|
||||||
@ -68,6 +68,12 @@ ln -s ncat %{buildroot}%{_bindir}/nc
|
|||||||
%{_mandir}/man1/*.1.gz
|
%{_mandir}/man1/*.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jul 27 2023 xingwei <xingwei14@h-partners.com> - 2:7.94-1
|
||||||
|
- Type:requirement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:update nmap to 7.94
|
||||||
|
|
||||||
* Thu Jul 06 2023 xingwei <xingwei14@h-partners.com> - 2:7.92-5
|
* Thu Jul 06 2023 xingwei <xingwei14@h-partners.com> - 2:7.92-5
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:
|
- CVE:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user