Nmap Development mailing list archives

Re: Nmap host based registry


From: Djalal Harouni <tixxdz () opendz org>
Date: Fri, 17 Feb 2012 16:15:08 +0100

On Fri, Feb 17, 2012 at 12:09:48AM +0100, Patrik Karlsson wrote:
Hi all,
Hi Patrik,

I've been working on a patch to add a host based registry to Nmap.
One of the drivers behind it is to reduce memory usage and to allow Nmap to
clear out registry entries that are no longer needed once a scan of a host
group is completed.
These things are really welcome.


The patch is quite small and works by adding a registry entry to the host
table passed to the host- and portrule functions.
Just for curiosity, do you have some memory usage before/after the patch ?
(if not don't wast your time).

The documentation change I wrote (with a lot of help from David) in the
doc/scripting.xml file which should give you a clearer picture of what
we're trying to achieve.
I'm interested in any comments or suggestions in regards to this change
before I commit it. The patch is attached.


For the doc:
-      <para>
-       The registry is a Lua table (accessible
-       as <literal>nmap.registry</literal>) with the special property
-       that it is visible by all scripts and retains its state
-       between script executions.  The registry is transient&mdash;it
-       is not stored between Nmap executions. Every script can read
-       and write to the registry.  Scripts commonly use it to save
-       information for other instances of the same script.  For
-       example, the <literal>whois</literal>
-       and <literal>asn-query</literal> scripts may query one IP
-       address, but receive information which may apply to tens of
-       thousands of IPs on that network.  Saving the information in
-       the registry may prevent other script threads from having to
-       repeat the query.</para>
+       <para>Scripts can share information by stroring values in a
+       <firstterm>register</firstterm>, which is a special table that can be
+       accessed by all scripts. There is a global registry with the name
+       <varname>nmap.registry</varname>, shared by all scripts. Each host
+       additionally has its own registry called
+       <varname>host.registry</varname>, where <varname>host</varname> is the
+       <link linkend="nse-api-arguments">host table</link> passed to a script.
+       Information in the registries is not stored between Nmap
+       executions.</para>

I believe the last two lines should be:
Information in the <varname>host.registry</varname> is not stored between
Nmap executions.</para>


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


Current thread: