2.4 KiB
Executable File
2.4 KiB
Executable File
How to Install Nmap and Use Nmap for Scanning
- Update your system:
sudo apt-get update
- Install Nmap:
sudo apt install nmap
- Scan a single IP address:
nmap [your_IP]
- Scan multiple IP addresses:
nmap [your_IP1,your_IP2]
- Scan a range of IP addresses:
nmap [your_IP1-your_IP100]
- Scan targets from a text file:
nmap -iL filename.txt
- Check for live systems:
nmap -sn [your_IP]
- Ping sweep:
nmap -sP [your_IP]
- If ICMP is blocked:
nmap -PN [your_IP]
- Scan specific port:
nmap -p [your_port] [your_IP]
If ICMP is blocked:
nmap -PN [your_IP] -p [your_port]
- Scan multiple ports:
nmap -p [port1,port2,port3-port6] [your_IP]
- Specify protocol:
nmap -p http,https,ftp [your_IP]
- Scan TCP ports:
nmap -p T:[port,port2] [your_IP]
- Get more information:
nmap -p [your_port] -sV [your_IP]
- Detect operating system:
nmap -O [your_IP] -p [your_port]
- Fast scan (top 100 ports):
nmap -F [your_IP]
- Aggressive scan:
nmap -A [your_IP] -p [your_port]
- Whois lookup:
nmap -p [your_port] --script whois-ip [your_IP_or_domain]
- IP geolocation:
nmap -p [your_port] --script ip-geolocation-* [IP]
- Detect Web Application Firewall (WAF):
nmap -p [your_port] --script http-waf-detect [your_domain]
- Save results to a text file:
nmap -Pn -p [your_port] [your_IP] -oN your_filename.txt
- Save results to an XML file:
nmap -Pn -p [your_port] [your_IP] -oX filename.xml
- Save results to a grepable file:
nmap -Pn -p [your_port] [your_IP] -oG filename.gnmap
- Save results to all formats:
nmap -Pn -p [your_port] [your_IP] -oA filename
- Scan top ports:
nmap --top-ports [number] [your_domain]
- Scan top ports and show open ones:
nmap --top-ports [number] [your_domain] --open
- Check for open ports using different scan types:
nmap -sT [your_IP] # TCP Scan
nmap -sS [your_IP] # SYN Scan
nmap -sX [your_IP] # XMAS Scan
nmap -sF [your_IP] # FIN Scan
nmap -sN [your_IP] # Null Scan