diff --git a/docs/scripting.xml b/docs/scripting.xml index 8cdde3b99..445fa6a54 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -1436,19 +1436,22 @@ try(socket:send(result)) The Registry registry (NSE) - The registry is a Lua table with the special property that it - is visible by all scripts and retains its state between script - executions. The registry is transient—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 whois and asn-query - 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 same query. The - registry may also be used to hand information to completely - different scripts. For example, + The registry is a Lua table (accessible + as nmap.registry) with the special property + that it is visible by all scripts and retains its state + between script executions. The registry is transient—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 whois + and asn-query 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. + + The registry may also be used to hand + information to completely different scripts. For example, the snmp-brute script saves a discovered community name in the registry where it may be used by other SNMP scripts. Scripts which leave information behind for a @@ -1458,10 +1461,9 @@ try(socket:send(result)) scripts - 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 nmap.registry. + Because every script can write to the registry table, it + is important to avoid conflicts by choosing keys wisely + (uniquely.