Chapter 7. Formatting the Script Output

Formatting our Nmap Scripting Engine (NSE) scripts' output correctly is important because it provides greater flexibility to anyone working with them, specifically when reading or parsing results. This chapter covers the usage of the supported output mode and attempts to outline good practices regarding reporting data back to the users.

In version 6.20BETA1, a new feature was introduced to provide greater flexibility by allowing NSE scripts to return structured data in XML format. Before that, users needed to parse the results from a string stored in the file, while the new system allows users to navigate through a well-organized XML file. We will explore the different ways of producing this structured output. ...

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.