Essential network scanning techniques and commands
nmap 192.168.1.1Scan a single IP
nmap 192.168.1.1 192.168.2.1Scan specific IPs
nmap 192.168.1.1-254Scan an IP range
nmap 192.168.1.0/24Scan using CIDR notation
nmap -iL targets.txtScan targets from a file
nmap -sS 192.168.1.1TCP SYN port scan (Default)
nmap -sT 192.168.1.1TCP connect port scan
nmap -sU 192.168.1.1UDP port scan
nmap -sA 192.168.1.1TCP ACK port scan
nmap -sn 192.168.1.1/24Disable port scanning. Host discovery only
nmap -Pn 192.168.1.1-5Disable host discovery. Port scan only
nmap -PS22-25,80 192.168.1.1-5TCP SYN discovery on specific ports
nmap -PR 192.168.1.1/24ARP discovery on local network
nmap -p 21 192.168.1.1Scan specific port
nmap -p 21-100 192.168.1.1Scan port range
nmap -p- 192.168.1.1Scan all ports
nmap -p http,https 192.168.1.1Scan by service name
nmap --top-ports 2000 192.168.1.1Scan top 2000 ports
nmap -sV 192.168.1.1Detect service versions
nmap -sV --version-intensity 8 192.168.1.1Detailed version detection
nmap -A 192.168.1.1Aggressive detection (OS, version, scripts)