Nmap Development mailing list archives

[Patch] as a possible fix for minor presentational issue in nse_main.cc affecting script debugging output.


From: jah <jah () zadkiel plus com>
Date: Tue, 04 Mar 2008 00:34:03 +0000

Hello.

I noticed that when script scanning a single target and specifying
either hostname or IP address along with "-n" and "--script-trace" on
the command line, the output contains the following on both windows and
linux:

    SCRIPT ENGINE: Initiating script scanning.
    SCRIPT ENGINE: Script scanning .

whereas, when name resolution is permitted (and succeeds) the second of
the above lines reads:

    SCRIPT ENGINE: Script scanning some.hostname.com.


The attached nse_main.cc.patch adds a check for an empty string for
(*targets.begin())->HostName() and instead displays:

    SCRIPT ENGINE: Script scanning 1 host.

which seems in keeping with the behaviour seen with multiple targets and
is the best I can do for now.



Whilst I was looking at this issuette, I noticed that the Visual Studio
solution for nmap doesn't show Target.h in it's list of header files
(i.e there isn't an entry for it in nmap.vcproj).  It seems to make no
difference whether it's added or not, but I thought I'd mention it.  I
haven't checked what other omissions there might be, but I did notice
that there's an entry for mswin32\NETINET\TCP.H which doesn't actually
exist in my svn working copy and doesn't appear to be included anywhere.


Regards,

jah
--- nse_main.cc.orig    Mon Mar  3 15:21:45 2008
+++ nse_main.cc Mon Mar  3 23:49:35 2008
@@ -159,6 +159,9 @@
                if(tlen > 1)
                        log_write(LOG_STDOUT, "%s: Script scanning %d hosts.\n", 
                                SCRIPT_ENGINE, tlen);
+               else if((*targets.begin())->HostName() == "")
+                       log_write(LOG_STDOUT, "%s: Script scanning 1 host.\n",
+                               SCRIPT_ENGINE);
                else
                        log_write(LOG_STDOUT, "%s: Script scanning %s.\n", 
                                SCRIPT_ENGINE, (*targets.begin())->HostName());

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

Current thread: