Nmap Development mailing list archives

Re: Script suggestions, take #3


From: Patrick Donnelly <batrick () batbytes com>
Date: Tue, 7 Feb 2012 00:17:00 -0500

Hi Martin,

On Sat, Feb 4, 2012 at 4:28 PM, Martin Holst Swende <martin () swende se> wrote:
I consider this feature finished, but would like some more eyes on it,
especially where I've touched the nse core stuff. Hoping to make this
stuff my first commit :)

Good work with this patch! I have a couple implementation comments:

o I don't think it's worth adding setVectorfield until we have more
than one call site.
o All functions in nse_main.lua should be local.
o string.len is not used in favor of the length operator (#)

General comments:

I'd rather see "suggest" scripts be a special case of a regular
"Script" (the class in the nse_main.lua). In that case, scripts would
"run" normally but the action function would be replaced with a
function that returns tailored output specific to the script-suggest
feature. Then, the majority of the engine remains unaffected and the
tailored script output would simply be "script-suggest: yadda yadda".

I also think that parsing the two sets of rules could be done
simultaneously. You could add a prefix [1] which specifies a suggest
flag similar to the force flag. The script-suggest rule set would
presumably always follow the rule set specified in --script. So
scripts which match --script-suggest are only loaded if they didn't
match a rule in --script.

That should eliminate a lot of the redundant code...

[1] http://seclists.org/nmap-dev/2011/q4/467

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


Current thread: