XML structured output

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.

Note

The official documentation of the stdnse and nmap libraries can be found here:

Implementing structured output in your scripts

Lua tables are perfect data structures ...

Get Mastering the Nmap Scripting Engine now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.