Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: How is whois.nse coming along?
From: jah <jah () zadkiel plus com>
Date: Mon, 30 Jun 2008 04:37:44 +0100

On 30/06/2008 03:32, Kris Katterjohn wrote:
jah wrote:
The script now uses a locally cached copy of IANA's IPv4 Global Unicast
Address Assignments [1] to determine which service to query by matching
the target against the assignment prefix ( nnn/8 ). The file is
currently being stored alongside nmap-services et al. since the script
uses nmap.fetchfile() to get a directory path.  I wonder if anyone has
any opinions on whether this is a good or bad place to store it - it's
certainly the most convenient and should be satisfactory across all
platforms, but if Kris introduces a data directory for nselib data files
[2], maybe it could go there.


Maybe there can be a data directory for NSElibs and one for scripts?
That sounds like a good idea and possibly a good place for script
specific wordlists.

Or maybe your address space parsing code can be placed in the Datafiles
library for use by other scripts, thus allowing ipv4-address-space to be
logically placed in a NSElib data directory?  It's not strictly an
Nmap data
file, but maybe that can slide if it's sufficiently useful.
"Parsing" is perhaps a bit strong a word!  Much of the code that deals
with the file is for doing a conditional HTTP GET using
if-modified-since and the file is prepended with the modified date which
can be read each time the script is run to allow an update to the cached
copy only if it's out of date.  Also, to prevent this conditional get
happening every time the script is run (which takes precious time), a
timestamp is prepended to the cached copy each time the get is done and
the get is performed only when a period of time has elapsed since the
timestamp (currently defaults to 16 hours, but the variable will accept
up to 7 days).  I'm not sure if these would be useful in a wider
context, but the datafiles library might be a good place for this stuff.

Or, better yet, maybe it can extend the ipOps library since it's already
presenting an isPrivate() function.  I recall a discussion on
presenting an
ip_is_reserved()-esque function (a la nmap.cc) to scripts, and this could
present that and more.
Yes, especially as we could also be needing ipv6 reserved space info soon.

Of course, these last two ideas could easily be beyond the scope of
the code
you've already written, in which case they can be saved for the future :)
Yeah, I really need to make sure whois is still working properly...

Generally though, on OSes other than windows, with which I'm all too
familiar, are the libraries in a subdir of that in which the datafiles
reside?  I gather that on linux the datafiles and script and nselib
directories are under /usr/local/share/nmap - is that pretty much standard?

jah




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


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]