Nmap Development mailing list archives

Re: Lua bugfixes and a new buffering feature


From: Diman Todorov <diman.todorov () chello at>
Date: Tue, 3 Jul 2007 10:38:28 +0200

Perhaps it would be useful to look for an init function which is  
called
only once per script per nmap invocation and only right before  
action()
is called? Another solution we should consider is passing a table  
to the
action function that scripts can use for cross-invocation  
persistent data

Actually variables defined (either as local or not) outside of  
functions in
a nse-script keep their value during multiple invocations of the  
script.
So if you define an empty table right before the action function  
and fill
it during the first run of the action, the data saved in it will be
still there during the next invocation(s).

that sounds more like a task for the nmap registry ;)

structures. This would avoid any possible registry conflict problems
(every script would have its own table if it wanted it). I don't  
know if
better registry naming is required or not.

I think as long as each script, which uses the registry, uses its  
'id' as
part of the key, we should be rather save.

Maybe it would be a good practice if every script using the  
registry would
create its own table in the registry using its 'id' as key.

perhaps scripts would like to share compiled regular expressions?

cheers,
Diman

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


Current thread: