Hey everyone!
As far as I know, there is no way for scripts to get Nmap's verbosity or
debugging values (o.verbose and o.debugging). I have attached a patch
to give this info to scripts and a test script to illustrate it's usage.
nmap.verbosity() gives you the o.verbose value and nmap.debugging()
gives you the o.debugging value.
Everything seems to work fine for me, all as expected.
Please give it a try, and let me now what you think! Any suggestions on
better names than "nmap.verbosity()" and "nmap.debugging()" are welcome,
but these just made the most sense to me.
Thanks,
Kris Katterjohn
id = "test"
author = "me"
description = "testing"
categories = {"safe"}
require "stdnse"
portrule = function(host, port)
return true
end
action = function(host, port)
local v = nmap.verbosity()
local d = nmap.debugging()
stdnse.print_debug("Verbosity: " .. v)
stdnse.print_debug("Debugging: " .. d)
if v > 1 then
stdnse.print_debug("v > 1 works as expected")
end
if d > 5 then
stdnse.print_debug("d > 5 works as expected")
end
return
end
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Sep 13 2007