An XSL stylesheet for rendering Nmap XML output with a modernized UI using Tailwind CSS and DataTables.
nmap-tailwind-xsl
provides a streamlined interface to view Nmap scan results in a browser with enhanced, mobile-responsive styling using Tailwind CSS and interactive tables with DataTables.
- Modern UI: Styled with Tailwind CSS for a cleaner and more responsive layout.
- Interactive Data: Includes DataTables for easy sorting and pagination of Nmap scan results.
- Scan Report: Only displays hosts with open ports for a focused scan summary.
- Clear Section Navigation: Accessible navigation links for "Hosts" and "Services".
- Dark Mode: Toggle between light and dark mode comfortable viewing experience.
This project uses the following versions specified in the XSL file:
Dependency | Version |
---|---|
jQuery | v3.7.1 |
DataTables | v2.1.8 |
Tailwind CSS | Latest via Tailwind Play CDN |
Clone the Repository
git clone https://github.com/marksowell/nmap-tailwind-xsl.git
-
Run an Nmap Scan With XML Output
nmap -oX scan.xml [target]
Tip
If you have multiple XML files you can combine them
-
Install
xmlstarlet
(if not already installed)sudo apt-get install xmlstarlet
-
Create the Combined XML File
echo '<?xml version="1.0" encoding="UTF-8"?>' > combined_nmap_output.xml echo '<nmaprun>' >> combined_nmap_output.xml
-
Extract and Append Elements
for file in *.xml; do # Skip the combined output file if [ "$file" != "combined_nmap_output.xml" ]; then xmlstarlet sel -t -c "/nmaprun/host" "$file" >> combined_nmap_output.xml fi done
-
Close the Root Tag
echo '</nmaprun>' >> combined_nmap_output.xml
-
Use
xmllint
to Validate the Combined XML Filexmllint combined_nmap_output.xml --noout
-
Use the
nmap_tailwind_xsl.xsl
Stylesheet to Create a HTML Report Usingxsltproc
xsltproc -o scan_report.html ./nmap-tailwind.xsl combined_nmap_output.xml
This project is licensed under the Creative Commons BY-SA 4.0 License.
nmap-tailwind-xsl
is inspired by the original work nmap-bootstrap-xsl
by Andreas Hontzia, which is also licensed under CC BY-SA 4.0. This project includes modifications to update the UI and functionality.