A few weeks ago I discovered this neat little trick that helps you see your saved nmap results in HTML formats, locally. This can be very helpful when you are performing large scans, like on an enterprise or a university for example.
nmap -oX <filename>for XML output file.
xsltprocutility in this format: xsltproc <
input.xml> -o <
nmap -A -oX nmapoutput -T5 192.168.0.1 xsltproc nmapoutput.xml -o scanme.html
Output HTML file: Click here to see the HTML file in action
Keep reading for creating beautiful CSS based HTML pages like this:
nmap-bootstrap.xsl based HTML file
Explanation, Examples and Details
xsltproc is a command line tool that is found in most of the *nix systems. It is an XSLT processor actually which applies XSLT stylesheets to XML files and saves the output.
The above command uses the default stylesheet for the desired HTML file. If you want to have bootstrap3 based theme for your nmap-HTML results, you’d need to apply a custom xslt stylesheetto your nmap scan.
There are 2 ways of doing it:
- Add the
nmap-bootstrap.xslas stylesheet to your Nmap scan. Example command that I ran on my system:
nmap -sS -T4 -A -sC -oA scanme --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl 192.168.0.1
scanme.html with your Web Browser. It should look like the
- Download the xsl stylesheet and use
xsltprocfor post processing
Then you can always simply apply this stylesheet to your nmap scans using the following command:
xsltproc -o scanme.html nmap-bootstrap.xsl scanme.xml
Here’s my output for this command:
and links to both the HTML files:
Hope it helps somebody here
All the credit goes to a Twitter user named Andreas Hontzia (@honze_net) created this XSL file and used the
xsltproc utility with the nmap scans to create those beautiful HTMLs.
Link to his GitHub Repository from where we downloaded the xsl file:
nmap-bootstrap.xsl : https://github.com/honze-net/nmap-bootstrap-xsl/