Skip to content

Instantly share code, notes, and snippets.

@AvasDream
Last active August 13, 2019 10:09
Show Gist options
  • Save AvasDream/1ff3f56c1b76f3949d9762586746d17e to your computer and use it in GitHub Desktop.
Save AvasDream/1ff3f56c1b76f3949d9762586746d17e to your computer and use it in GitHub Desktop.
Bash script to convert nmap xml output to html
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied!"
echo "Usage:"
echo "./nmap_to_html <IP Range>"
exit 1
fi
echo "[*] Starting scan"
nmap -sP -oX scan.xml $1
if [ $? -ne 0 ]; then
echo "[!] Error while executing nmap"
exit 1
fi
xsltproc scan.xml -o scan.html
if [ $? -ne 0 ]; then
echo "[!] Error while converting xml to html"
exit 1
fi
echo "[*] Html file created"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment