Skip to content

Commit

Permalink
Add zlib binding for NSE. Fixes #532
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Sep 13, 2017
1 parent 30de163 commit b57d23f
Show file tree
Hide file tree
Showing 8 changed files with 1,123 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#s wa Nmap Changelog ($Id$); -*-text-*-

o [NSE][GH#532] Added zlib library for NSE. This was a leftover project from
GSOC 2014, and will be very useful. [Claudiu Perta, Daniel Miller]

o [NSE][GH#1004] Fixed handling of brute.retries variable. It was being treated
as the number of tries, not retries, and a value of 0 would result in
infinite retries. Instead, it is now the number of retries, defaulting to 2
Expand Down
5 changes: 5 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ NSE_SRC+=nse_libssh2.cc
NSE_HDRS+=nse_libssh2.h
NSE_OBJS+=nse_libssh2.o
endif
ifneq (@LIBZLIB_LIBS@,)
NSE_SRC+=nse_zlib.cc
NSE_HDRS+=nse_zlib.h
NSE_OBJS+=nse_zlib.o
endif
endif

export SRCS = charpool.cc FingerPrintResults.cc FPEngine.cc FPModel.cc idle_scan.cc MACLookup.cc main.cc nmap.cc nmap_dns.cc nmap_error.cc nmap_ftp.cc NmapOps.cc NmapOutputTable.cc nmap_tty.cc osscan2.cc osscan.cc output.cc payload.cc portlist.cc portreasons.cc protocols.cc scan_engine.cc scan_engine_connect.cc scan_engine_raw.cc scan_lists.cc service_scan.cc services.cc Target.cc NewTargets.cc TargetGroup.cc targets.cc tcpip.cc timing.cc traceroute.cc utils.cc xml.cc $(NSE_SRC)
Expand Down
2 changes: 2 additions & 0 deletions mswin32/nmap.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje
<ClCompile Include="..\nse_openssl.cc" />
<ClCompile Include="..\nse_pcrelib.cc" />
<ClCompile Include="..\nse_ssl_cert.cc" />
<ClCompile Include="..\nse_zlib.cc" />
<ClCompile Include="..\osscan.cc" />
<ClCompile Include="..\osscan2.cc" />
<ClCompile Include="..\output.cc" />
Expand Down Expand Up @@ -221,6 +222,7 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje
<ClInclude Include="..\nse_openssl.h" />
<ClInclude Include="..\nse_pcrelib.h" />
<ClInclude Include="..\nse_ssl_cert.h" />
<ClInclude Include="..\nse_zlib.h" />
<ClInclude Include="..\osscan.h" />
<ClInclude Include="..\osscan2.h" />
<ClInclude Include="..\output.h" />
Expand Down
4 changes: 4 additions & 0 deletions nse_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "nse_debug.h"
#include "nse_lpeg.h"
#include "nse_libssh2.h"
#include "nse_zlib.h"

#include <math.h>

Expand Down Expand Up @@ -551,6 +552,9 @@ static void set_nmap_libraries (lua_State *L)
#endif
#ifdef HAVE_OPENSSL
{OPENSSLLIBNAME, luaopen_openssl},
#endif
#ifdef HAVE_LIBZ
{NSE_ZLIBNAME, luaopen_zlib},
#endif
{NULL, NULL}
};
Expand Down
Loading

0 comments on commit b57d23f

Please sign in to comment.