-
Book Overview & Buying
-
Table Of Contents
Mastering the Nmap Scripting Engine
By :
The objective of the XML structured output is to return data to users in structures that are easier to parse than the blob of text returned by the older scripts. The best part is that we can take advantage of this feature transparently in our scripts using the standard functions provided by the Nmap API and the stdnse library. If you are considering sending your NSE script to get it included with official Nmap releases, I highly recommend making your scripts support the structured output.
The official documentation of the stdnse and nmap libraries can be found here:
Lua tables are perfect data structures to represent output, so they were the obvious choice to be used as return values by NSE. NSE scripts can implement structured output by returning one of the following values:
A Lua table
A Lua table and a string
A Lua table with a __tostring() metamethod...
Change the font size
Change margin width
Change background colour