mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 09:49:05 +00:00
Rewrite most of the registry section. Also standardized on lowercase as in 'the registry' or 'NSE registry'. It seems like a proper noun so I was planning to capitalize. But lowercase seems to be used just as often for the Windows registry -- even MS does so at http://support.microsoft.com/kb/256986. Wikipedia is inconsistent, but tends to lowercase the Windows registry.
This commit is contained in:
@@ -1292,9 +1292,9 @@ socket:close()
|
|||||||
the <literal>whois</literal> problem above is to have each
|
the <literal>whois</literal> problem above is to have each
|
||||||
thread block on a mutex using a common string, thus ensuring
|
thread block on a mutex using a common string, thus ensuring
|
||||||
that only one thread is querying whois servers at once. That
|
that only one thread is querying whois servers at once. That
|
||||||
thread can store the results in the NSE Registry before
|
thread can store the results in the NSE registry before
|
||||||
releasing unlocking the mutex. The next script in the waiting
|
releasing unlocking the mutex. The next script in the waiting
|
||||||
queue can then run. It will first check the Registry and only
|
queue can then run. It will first check the registry and only
|
||||||
query whois servers if the previous results were insufficient.
|
query whois servers if the previous results were insufficient.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -1436,29 +1436,33 @@ try(socket:send(result))
|
|||||||
<title>The Registry</title>
|
<title>The Registry</title>
|
||||||
<indexterm><primary>registry (NSE)</primary></indexterm>
|
<indexterm><primary>registry (NSE)</primary></indexterm>
|
||||||
<para>
|
<para>
|
||||||
The registry is a normal Lua table. What is special about it
|
The registry is a Lua table with the special property that it
|
||||||
is that it is visible by all scripts and it retains its state
|
is visible by all scripts and retains its state between script
|
||||||
between script executions. The registry
|
executions. The registry is transient—it is not stored
|
||||||
is transient—it is not stored between Nmap executions. Every
|
between Nmap executions. Every script can read and write to
|
||||||
script can read the registry and write to it. If a script is
|
the registry. Scripts commonly use it to save information for
|
||||||
running after another script, it can read some information in
|
other instances of the same script. For example,
|
||||||
the registry which was left by the first script. This feature
|
the <literal>whois</literal> and <literal>asn-query</literal>
|
||||||
is particularly powerful in combination with the run level
|
scripts may query one IP address, but receive information
|
||||||
concept. A script with a higher run level can rely on entries
|
which may apply to tens of thousands of IPs on that network.
|
||||||
left behind for it by scripts with lower run levels.
|
Saving the information in the registry may prevent other
|
||||||
<indexterm><primary>run level of scripts</primary></indexterm>
|
script threads from having to repeat the same query. The
|
||||||
Remember
|
registry may also be used to hand information to completely
|
||||||
however that the registry can be written by all scripts
|
different scripts. For example,
|
||||||
equally, so choose the keys for your entries wisely. The
|
the <literal>snmp-brute</literal> script saves a discovered
|
||||||
registry is stored in <literal>nmap.registry</literal>. The
|
community name in the registry where it may be used by other
|
||||||
behavior of the registry allows caching of already calculated
|
SNMP scripts. Scripts which leave information behind for a
|
||||||
data. The cache can be seen by all scripts until the registry
|
second script must have a lower <literal>runlevel</literal>
|
||||||
is rebuilt with the next target group. <!-- If for example you have
|
than that second script, or there is no guarantee that they
|
||||||
compiled a regular expression, you can store the compiled
|
will run first.<indexterm><primary>run level of
|
||||||
expression in the registry so that scripts which need the same
|
scripts</primary></indexterm>
|
||||||
pattern do not have to recompile it. -->
|
</para>
|
||||||
|
|
||||||
|
<para>Keep in mind that the
|
||||||
|
registry can be written by all scripts equally, so choose
|
||||||
|
keys for your entries wisely. The registry is stored
|
||||||
|
in <literal>nmap.registry</literal>.</para>
|
||||||
|
|
||||||
</para>
|
|
||||||
</sect2>
|
</sect2>
|
||||||
<indexterm class="endofrange" startref="nse-nmap-indexterm"/>
|
<indexterm class="endofrange" startref="nse-nmap-indexterm"/>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|||||||
Reference in New Issue
Block a user