Nmap Development mailing list archives
[Patch] v2
From: jah <jah () zadkiel plus com>
Date: Tue, 04 Mar 2008 03:07:05 +0000
On 04/03/2008 01:04, Fyodor wrote:
On Tue, Mar 04, 2008 at 12:34:03AM +0000, jah wrote: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.Hi Jah. Thanks for your notes. There is a function which gives the hostname if available, otherwise the IP address. That is probably best to use here.
I believe the attached uses the function you alluded to and which displays the IP address and, if name resolution is permitted, the hostname. I found its use in osscan2.cc and have tested it, but should the patch be deficient in some respect, I'd be happy to do some more background reading before having another crack at it...
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. IMaybe it is used for dependency checking? Or maybe it is just for convenience of opening the files. If you want to sync the .h files with the vcproject files (remove the .h files which no longer exist and add missing nmap .h files), and send me a patch against svn, that would be great!
If only for the convenience of being able to "Go to Definition" and, as you say, open the file in Visual Studio it's probably worth doing, so I'll get on it! Regards, jah
--- nse_main.cc.orig Mon Mar 3 15:21:45 2008 +++ nse_main.cc Tue Mar 4 02:35:38 2008 @@ -156,12 +156,13 @@ SCRIPT_ENGINE_DEBUGGING( unsigned int tlen = targets.size(); + char targetstr[128]; if(tlen > 1) log_write(LOG_STDOUT, "%s: Script scanning %d hosts.\n", SCRIPT_ENGINE, tlen); else log_write(LOG_STDOUT, "%s: Script scanning %s.\n", - SCRIPT_ENGINE, (*targets.begin())->HostName()); + SCRIPT_ENGINE, (*targets.begin())->NameIP(targetstr, sizeof(targetstr))); ) l = lua_open();
_______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- [Patch] as a possible fix for minor presentational issue in nse_main.cc affecting script debugging output. jah (Mar 03)
- Re: [Patch] as a possible fix for minor presentational issue in nse_main.cc affecting script debugging output. Fyodor (Mar 03)
- [Patch] v2 jah (Mar 03)
- Re: [Patch] as a possible fix for minor presentational issue in nse_main.cc affecting script debugging output. Fyodor (Mar 03)