Apr 14, 2022 12:09 PM
(This post was last modified: Apr 14, 2022 12:22 PM by Sitrep.)
This is some common commands used for Nmap that I would like to share with you. Hope it is useful!
Tips: Copy and save it locally for quick access!
Nmap, short for "Network Mapper", is a free, open-source tool for vulnerability scanning and network discovery. Network administrators use Nmap to identify what devices are running on their systems, discovering hosts that are available and the services they offer, finding open ports and detecting security risks.
Scan a range of IP address:
Scan a range of IP address using a wildcard:
Scan an entire subnet:
Scan a list of hosts:
OS and Version Detection:
Find out if a Host/Network is protected by a firewall:
Scan a host when protected by a firewall:
Scan IPV6:
Host discovery/Ping scan:
Fast Scan:
Show only open ports:
Scan Specific Ports:
Fastest way to scan:
Identify remote host apps and OS "-O":
Scan for remote services & Versions:
Bypass firewall ICMP ping scans:
Bypass Firewalls blocking TCP scans with UDP:
Scan for UDP services:
Save scan results to output file:
Faster scans:
Tips: Copy and save it locally for quick access!
Nmap, short for "Network Mapper", is a free, open-source tool for vulnerability scanning and network discovery. Network administrators use Nmap to identify what devices are running on their systems, discovering hosts that are available and the services they offer, finding open ports and detecting security risks.
Scan a range of IP address:
Code
nmap 192.168.1.0 0 192.168.1.2Scan a range of IP address using a wildcard:
Code
nmap 192.168.1.0-20Scan an entire subnet:
Code
nmap 192.168.1.*Scan a list of hosts:
Code
nmap 192.168.1.0/24OS and Version Detection:
Code
nmap -iL /tmp/test.txtFind out if a Host/Network is protected by a firewall:
Code
nmap -A 192.168.1.254
nmap -v -A 0
nmap -A -iL /tmp/scanlist.txtScan a host when protected by a firewall:
Code
nmap -sA 192.168.1.254
nmap -sA example.comScan IPV6:
Code
nmap -PN 0
nmap -PN example.comHost discovery/Ping scan:
Code
("-6" enables IPv6 scanning.)
nmap -6 example.com
nmap -6 <IPv6 here>
nmap -v A -6 <IPv6 here>Fast Scan:
Code
nmap -sP 192.168.1.0/24Show only open ports:
Code
nmap -F 0Scan Specific Ports:
Code
nmap --open 0
nmap --open example.comFastest way to scan:
Code
nmap -p [port] hostName
# Scan port 80
nmap -p 80 0
# Scan TCP port 80
nmap -p T:80 0
# Scan UDP port 53
nmap -p U:53 0
# Scan two ports
nmap -p 80,443 0
# Scan port ranges
nmap -p 80-200 0
# Combine all options
nmap -p U:53,111,137,T:21-25,80,139,8080 0
nmap -p U:53,111,137,T:21-25,80,139,8080 example.com
nmap -v -sU -sT -p U:53,111,137,T:21-25,80,139,8080 192.168.1.254
# Scan all ports with * wildcard
nmap -p "*" 0
# Scan top ports i.e. scan $number most common ports
nmap --top-ports 5 0
nmap --top-ports 10 0Identify remote host apps and OS "-O":
Code
nmap -T5 192.168.1.0/24Scan for remote services & Versions:
Code
nmap -O 0
nmap -O --osscan-guess 0
nmap -v -O --osscan-guess 0Bypass firewall ICMP ping scans:
Code
nmap -sV 0Bypass Firewalls blocking TCP scans with UDP:
Code
nmap -PS 0
nmap -PS 80,21,443 0
nmap -PA 0
nmap -PA 80,21,200-512 0Scan for UDP services:
Code
nmap -PU 0
nmap -PU 2000.2001 0Code
nmap -sU nas03
nmap -sU 0Save scan results to output file:
Code
nmap -sO 0Faster scans:
Code
nmap 0 > output.txt
nmap -oN /path/to/filename 0
nmap -oN output.txt 0Code
nmap -v -sS -A -T4 <or T5> 192.168.2.0


![[Image: lolj.png]](https://i.ibb.co/1zYW3qZ/lolj.png)