Diniz Martins

May 16, 20221 min

NMAP | XML TO CSV & HTML

XML (Extensible Markup Language) is a markup language similar to HTML, but without predefined tags to use. Instead, you define your own tags designed specifically for your needs. This is a powerful way to store data in a format that can be stored, searched, and shared. Most importantly, since the fundamental format of XML is standardized, if you share or transmit XML across systems or platforms, either locally or over the internet, the recipient can still parse the data due to the standardized XML syntax. The whole structure of XML and XML-based languages is built on tags.

HTML stands for Hyper Text Markup Language. HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page. HTML consists of a series of elements. HTML elements tell the browser how to display the content.

CSV:

Download:

git clone https://github.com/NetsecExplained/Nmap-XML-to-CSV.git

Syntax:

nmap <target-ip> <-oX file.xml>

Convert:

python3 xml2csv.py -f <xml-file> -csv <new-file-name.csv>

And when we open it up in Excel, we see the following:

HTML:

This is where the xsltproc comes in. This tool can be used to convert the XML file into a nicely formatted HTML file. To perform this conversion, run the following command:

xsltproc <file-name>.xml -o <new-file-name>.html

    7520
    2