I was looking at a software to perform network discovery and security audits, where I discovered the open source utility Nmap (http://nmap.org/), OK I was already aware of it!
I was looking to install Nmap on an Ubuntu operating system, which requires the following to be run:
apt-get install nmap
I also required the ability to create HTML reports from the XML output, so I also installed xsltproc (http://xmlsoft.org/XSLT/):
apt-get install xsltproc
Nmap is quite simple to run from the command line interface to scan either single IP addresses, IP address ranges or network subnets, below are number of commands you can use, where -oX outputs the file to .xml format.
To perform an intense scan of the target IP address 18.104.22.168:
nmap -T4 -A -v 22.214.171.124 -oX <filename>.xml
To perform a quick scan of the subnet 126.96.36.199/16:
nmap -T4 -F 188.8.131.52/16 -oX <filename>.xml
To perform a slow comprehensive scan of the IP address range 184.108.40.206-8:
nmap -sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script "default or (discovery and safe)" 220.127.116.11-8 -oX <filename>.xml
As mentioned previously I require to create HTML reports from the XML output, which can be achieved by using xsltproc to convert the output generated in Nmap into a readable format for review.
xsltproc <filename>.xml -o <filename>.html