Performing network discovery and security audits with Nmap

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 7.7.7.7:

nmap -T4 -A -v 7.7.7.7 -oX <filename>.xml

To perform a quick scan of the subnet 7.7.7.0/16:

nmap -T4 -F 7.7.7.0/16 -oX <filename>.xml

To perform a slow comprehensive scan of the IP address range 7.7.7.0-8:

nmap -sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script "default or (discovery and safe)" 7.7.7.0-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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s