You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-sn tells nmap to perform host discovery only without any additional port scanning and prints out details of any hosts that responded.
nmap -sn 10.11.1.0/24
nmap also has the -Pn option which will disable the host discovery stage altogether on a scan. The -Pn option is best used in combination with other scans.
TCP Connect Scan
The TCP connect scan in Nmap is the alternative TCP scan to use when a SYN scan is not an option.
TCP connect scan should be used when nmap does not have raw packet privileges which is required for a SYN scan.
nmap -sT [target host]
TCP SYN Scan
Does not complete the 3 way handshake
nmap -sS [target host]
UDP Port Scanning
Always check for UDP ports will pick up DNS, NTP, SNMP
nmap -sU [target host]
nmap -sU -F [target host]
Fingerprint Services
To figure out what services are running on target ports we use:
nmap -sV [target ip address]
The following command will use nmap port scan to detect the service and OS:
nmap -sV -O [target ip address]
Can also use the -A option in Nmap. The A stands for aggressive scan options and enables OS detection, script scanning and traceroute.
nmap -A [target ip address]
Scanning port ranges with Nmap
By default nmap will only scan the most 1000 common ports. To override the default use the -p
nmap -p 80 --script=all $ip - Scan a target using all NSE scripts. May take an hour to complete.
nmap -p 80 --script=*vuln* $ip - Scan a target using all NSE vuln scripts.
nmap -p 80 --script=http*vuln* $ip - Scan a target using all HTTP vulns NSE scripts.
nmap -p 21 --script=ftp-anon $ip/24 - Scan entire network for FTP servers that allow anonymous access.
nmap -p 80 --script=http-vuln-cve2010-2861 $ip/24 - Scan entire network for a directory traversal vulnerability. It can even retrieve admin's password hash.