Nmap Development mailing list archives

Re: Updated output for scripts


From: Ron <ron () skullsecurity net>
Date: Tue, 10 Nov 2009 13:41:47 -0600

DePriest, Jason R. wrote:
Gmail wrapped it so it looks sort of strange, but I'm sure it looks
fine in the real world.

My question is how are you sending the data to the function?

Can you post a lua snippet?

I'm on a CDMA connection and don't want to update my svn at this speed.

-Jason

Yeah, they shouldn't be wrapped. :)

Here is probably the simplest example:

    table.insert(response, string.format("OS: %s (%s)",
get_windows_version(result['os']), result['lanmanager']))
    table.insert(response, string.format("Name: %s\\%s",
result['domain'], result['server']))
    table.insert(response, string.format("System time: %s %s",
result['date'], result['timezone_str']))
    return stdnse.format_output(true, response)

Sorry for what will probably end up being bad wrapping again.

Note the first parameter to format_output() -- if you set it to 'false',
if debugging() is turned on it'll prefix each line with ERROR:. If
debugging is turned off, it won't output anything. That's based on a
request I had a lonnnng time ago, where errors don't display unless
debugging is enabled.

Ron

-- 
Ron Bowes
http://www.skullsecurity.org/
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: