Apr 17 2008

nmap – Network exploration tool and security / port scanner

Category: Ubuntu tips and TricksBipin Balakrishnan @ 7:02 pm

Nmap is a tool that can be used to check the network status as well as the status of a particular port.

To install nmap issue

sudo apt-get install nmap

eg:

To check the status of a particular port in the local host we can issue

nmap -p 80 localhost

will give

Starting Nmap 4.53 ( http://insecure.org ) at 2008-04-17 18:58 IST
Interesting ports on localhost (127.0.0.1):
PORT STATE SERVICE
80/tcp open http

if its open.Similarly we can give any host name.

For scanning a network is live or not we can give

nmap -sP -vv 192.168.0.* | grep up

Host 192.168.0.1 appears to be up.
Host 192.168.0.100 appears to be up.
Host 192.168.0.101 appears to be up.
Host 192.168.0.102 appears to be up.
Host 192.168.0.103 appears to be up.
Host 192.168.0.104 appears to be up.
Host 192.168.0.111 appears to be up.
Host 192.168.0.112 appears to be up.
Host 192.168.0.115 appears to be up.
Host 192.168.0.117 appears to be up.
Nmap done: 256 IP addresses (10 hosts up) scanned in 4.630 seconds

will give this if all are up

Tags: , ,