Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: [NSE] Verbosity/debugging info for scripts

[NSE] Verbosity/debugging info for scripts

From: Kris Katterjohn <katterjohn_at_gmail.com>
Date: Thu, 13 Sep 2007 18:59:42 -0500

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
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos