From d0a2ec9d50da0940692ddb16b67253900661edff Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 3 Jul 2008 04:11:42 +0000 Subject: [PATCH] Adding support for NSE + Ping Scan (-sP) for executing host scripts. So "-sPC", "-sP --script all" and "-sP --script ripeQuery" all work correctly --- CHANGELOG | 2 ++ nmap.cc | 2 +- output.cc | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 118a1e151..76de324f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,8 @@ o Fixed the "resolution errors not showing up" bug. Actually, from now stderr is also redirected there (until now, only stdout was displayed). [Vladimir] +o NSE now works with the Ping Scan (-sP) to execute host scripts. [Kris] + Nmap 4.68 [2008-6-28] o Doug integrated all of your version detection submissions and diff --git a/nmap.cc b/nmap.cc index ca28d732b..45bed960f 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1622,7 +1622,7 @@ int nmap_main(int argc, char *argv[]) { if (currenths->flags & HOST_UP && !o.listscan) o.numhosts_up++; - if ((o.pingscan && !o.traceroute) || o.listscan) { + if ((o.pingscan && !o.traceroute && !o.script) || o.listscan) { /* We're done with the hosts */ log_write(LOG_XML, ""); write_host_status(currenths, o.resolve_all); diff --git a/output.cc b/output.cc index cc048280f..1dd718edc 100644 --- a/output.cc +++ b/output.cc @@ -509,6 +509,9 @@ void printportoutput(Target *currenths, PortList *plist) { vector saved_servicefps; + if (o.pingscan) + return; + log_write(LOG_XML, ""); int prevstate = PORT_UNKNOWN; int istate;