sudo apt-get update
sudo apt-get install nmap
sudo yum update
sudo yum install nmap
sudo nmap 192.168.0.1
nmap www.hostname.com
– To scan a hostnmap 192.168.0.1-10
– To Scan a range of IP addresses (.1 – .10)nmap 192.168.0.1/13
– Runs Nmap on a subnetnmap –iL textlist.txt
– To scan targets from a text file.nmap –p 80 192.168.0.1
nmap –p 1-200 192.168.0.1
nmap –F 192.168.0.1
nmap –p– 192.168.0.1
nmap –sT 192.168.0.1
– This scan uses TCP connect – it takes longer, but is more likely to connectnmap –sS 192.168.0.1
– This is the default SYN scan – it tests by performing only half of the TCP handshake.nmap –sU –p 80,130,255 192.168.0.1
– This instructs Nmap to scan UDP ports instead of TCP ports (the –p switch specifies ports 80, 130, and 255 in this example.)nmap –Pn –F 192.168.0.1
– Run a Fast scan on the target system, but bypass host discovery. (Host discovery uses ping, but many server firewalls do not respond to ping requests. This option forces the test without waiting for a reply that may not be coming.)nmap –A 192.168.0.1
nmap –sV 192.168.0.1