# Quick scan of top 1000 ports
nmap <target>
# Full port scan with service version detection
nmap -p- -sV <target>
# Aggressive scan (OS detection, version detection, script scanning, and traceroute)
nmap -A <target>
# Quick scan of top 100 ports
nmap -F <target># Scan network range
nmap -sn 192.168.1.0/24
# Scan from file
nmap -sn -iL hosts.txt
# No ping scan
nmap -Pn <target># SYN scan (requires root)
sudo nmap -sS <target>
# TCP connect scan
nmap -sT <target>
# UDP scan
sudo nmap -sU <target>
# Specific ports
nmap -p 22,80,443 <target>
# All ports
nmap -p- <target># Version detection
nmap -sV <target>
# Version detection with intensity level
nmap -sV --version-intensity 5 <target>
# OS detection
sudo nmap -O <target># Save in all formats
nmap -oA filename <target>
# Save in normal format
nmap -oN filename.txt <target>
# Save in XML format
nmap -oX filename.xml <target>
# Grep-friendly output
nmap -oG filename.txt <target># Default scripts
nmap -sC <target>
# Specific script
nmap --script=<script-name> <target>
# Vulnerability scan
nmap --script vuln <target>
# Multiple scripts
nmap --script=http-title,http-headers <target># Fastest timing template
nmap -T5 <target>
# Set minimum rate
nmap --min-rate 300 <target>
# Parallel host scan
nmap --min-parallelism 100 <target>
# Aggressive timing + version detection
nmap -T4 -sV <target># Decoy scan
nmap -D RND:5 <target>
# Fragment packets
nmap -f <target>
# Specify specific source port
nmap --source-port 53 <target>
# MAC address spoofing
nmap --spoof-mac MAC <target># Comprehensive scan with timing template
sudo nmap -sS -sV -T4 -A -O -p- <target>
# Quiet scan with version detection
nmap -sV -T2 --version-intensity 0 <target>
# Advanced vulnerability scan
nmap -sV --script vuln -p- -T4 <target>
# Complete network enumeration
nmap -sn -T4 -PE -PM -PS80,443 -PA3389 -PU40125 -PY <target>/24