When analyzing or sharing Nmap results with your customers, it’s helpful to have the output exported in a human readable way. This tip explains how to use Nmap and the HTML parses to generate a fancy report.

You can have Nmap’s output saved as XML by adding the -oX option to your Nmap command, as in:

To organize and make the XML output nicer, you can use the stylesheet option (–stylesheet). The XML file will point to a stylesheet for formatting and transformation using the eXtensible Stylesheet Language (XSL). Nmap includes a default XSL stylesheet called nmap.xsl.

Once you generated the XML file (in this case network.xml) you’ll invoke xsltproc to convert (-o option) from XML to HTML.