From 59b2c8323492fca8937d41751abc379f9ea2c87c Mon Sep 17 00:00:00 2001 From: batrick Date: Sat, 18 Jul 2009 14:56:07 +0000 Subject: [PATCH] If neither --script nor -sV is present, then do not load NSE. Before, NSE would load despite script scanning not being activated. See [1] for preliminary patch from Solar Designer and motivation. [1] http://seclists.org/nmap-dev/2009/q3/0207.html --- nmap.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nmap.cc b/nmap.cc index 69cff0c29..af64fe866 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1681,7 +1681,8 @@ int nmap_main(int argc, char *argv[]) { } if (o.servicescan) o.scriptversion = 1; - open_nse(); + if (o.scriptversion || o.script) + open_nse(); #endif /* Time to create a hostgroup state object filled with all the requested @@ -2017,7 +2018,8 @@ void nmap_free_mem() { if (o.extra_payload) free(o.extra_payload); if (o.ipoptions) free(o.ipoptions); #ifndef NOLUA - close_nse(); + if (o.scriptversion || o.script) + close_nse(); free(o.scriptargs); #endif }