Nmap Development mailing list archives

[PATCH] Very minor bug in output.cc


From: Ron <iago () valhallalegends com>
Date: Sat, 30 Sep 2006 22:04:30 -0500

If I attempt to do a OS or Version scan on a down host, I get this message:

ron@slayer:~$ sudo nmap -O -sV -sS [insert down host]

Starting Nmap 4.20ALPHA7 ( http://Insecure.Org ) at 2006-09-30 21:51 CDT
Note: Host seems down. If it is really up, but blocking our ping probes,
try -P0
OS and Service detection performed. Please report any incorrect results
at http://insecure.org/nmap/submit/ .
Nmap finished: 1 IP address (0 hosts up) scanned in 4.091 seconds

Since no OS or Service detection was done, that's a little confusing, so
I wrote a little patch to fix it.

Ron
--- output.cc.orig      2006-09-30 22:02:40.000000000 -0500
+++ output.cc   2006-09-30 21:59:18.000000000 -0500
@@ -1613,13 +1613,14 @@
   if (o.numhosts_scanned == 1 && o.numhosts_up == 0 && !o.listscan && 
       o.pingtype != PINGTYPE_NONE)
     log_write(LOG_STDOUT, "Note: Host seems down. If it is really up, but blocking our ping probes, try -P0\n");
-
-  if (o.osscan && o.servicescan)
-    log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "OS and Service detection performed. Please report any incorrect results 
at http://insecure.org/nmap/submit/ .\n");
-  else if (o.osscan)
-    log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "OS detection performed. Please report any incorrect results at 
http://insecure.org/nmap/submit/ .\n");
-  else if (o.servicescan)
-    log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "Service detection performed. Please report any incorrect results at 
http://insecure.org/nmap/submit/ .\n");
+  else {
+    if (o.osscan && o.servicescan)
+      log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "OS and Service detection performed. Please report any incorrect 
results at http://insecure.org/nmap/submit/ .\n");
+    else if (o.osscan)
+      log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "OS detection performed. Please report any incorrect results at 
http://insecure.org/nmap/submit/ .\n");
+    else if (o.servicescan)
+      log_write(LOG_STDOUT|LOG_NORMAL|LOG_SKID, "Service detection performed. Please report any incorrect results at 
http://insecure.org/nmap/submit/ .\n");
+  }
 
   log_write(LOG_STDOUT|LOG_SKID, "Nmap finished: %d %s (%d %s up) scanned in %.3f seconds\n", o.numhosts_scanned, 
(o.numhosts_scanned == 1)? "IP address" : "IP addresses", o.numhosts_up, (o.numhosts_up == 1)? "host" : "hosts",  
o.TimeSinceStartMS(&tv) / 1000.0);
   if (o.verbose && o.isr00t && o.RawScan()) 

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: