Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques, version detection (determine service protocols and application versions listening behind ports), and TCP/IP fingerprinting (remote host OS or device identification). Nmap also offers flexible target and port specification, decoy/stealth scanning, sunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and commandline modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ.
open a terminal and enter:
apt-get install nmap
how to use nmap:
sudo nmap domainname (or IP address) is the most simple syntax to scan the open ports on the remote system. The other switches are used for more selective scans.
Command Line
How to use it
Nmap has lots of options, so we are going to focus on only some of them.
sudo nmap -sS -O 127.0.0.1
-sS
TCP SYN scan
-O
Enable Operating System detection
sudo nmap -sU 127.0.0.1
-sU
UDP ports scan
sudo nmap -sS -O -p 20-25 127.0.0.1
-sS
TCP SYN scan
-p 20-25
Scan on ports 20 to 25
sudo nmap -sS -F 127.0.0.1
-sS
TCP SYN scan
-F
Fast (limited port) scan
you can check the long nmap man page