Nmap Development mailing list archives

Re: Verbose data file path reporting


From: Fyodor <fyodor () insecure org>
Date: Wed, 6 Jun 2007 16:05:21 -0700

On Wed, Jun 06, 2007 at 04:04:08PM -0600, David Fifield wrote:
I have checked into /nmap-exp/soc07/nmap a revision that allows Nmap to
show which data files it loaded and where it loaded them from. Right
now, this information is displayed only in verbose mode. Here are some
examples:

Hi David.  This looks great!  It works in my initial testing.  One
change I would make relates to this situation:

      # nmap -v -A 192.168.0.0/24
      Read from /usr/local/share/nmap: nmap-mac-prefixes nmap-os-db nmap-os-fingerprints nmap-rpc nmap-service-probes 
nmap-services.

For this case where all the files are ready from one directory (which
will be true 99% of the time), I'd rather just print something shorter
like:

"Read data files from: /usr/local/share/nmap"

This way users who don't change data file locations need not deal with
as much output complexity or length.

The patch doesn't say if a different file name, rather than just a
different directory, is used. The user has to know, for example, that
my-services was loaded instead of nmap-services.

Thats OK.  A different filename is only used if they explicity request
it, so the user better know what is going on :).

This code involves splitting a path into its directory and file
components. There are POSIX functions dirname and basename that do this,
but they are exceedingly nasty and hard to use, not to mention not
available on Windows. I wrote short reimplementations of those functions
and put them in output.cc. I noticed, though, that a similar problem has
been solved at least twice before: in main.cc:main to get the nmap
executable name, and in nse_init.cc:get_filename. Is this something that
should be moved into utils.cc or nbase?

Sure, please do!  Nbase sounds like a good place for it.  While you
are it it, would you remove the interactive_names nonsense?  I'm
embarassed that feature even exists!

Is the placement of this
new information in the output right? It has to be near the end (after
the port tables) because not all data files have been opened until then.

The beginning would be best, but that doesn't work for the
implementation reasons you noted.  So I think putting the info at the
end as you have done is fine.

Cheers,
Fyodor

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


Current thread: