# Nmap Cheat Sheet ⚡

Anshulchoudhary
2 min readJul 17, 2023

--

Are you ready to embark on a thrilling journey through the vast realms of network exploration and security auditing? Hold on tight as we unveil the secrets of Nmap, the legendary tool that can map out hidden treasures within your network! ⚡

Here’s a cheat sheet for Nmap, a popular network scanning tool used for security auditing and network exploration:

Basic Scanning Techniques:

Scan a single target: nmap <target>
Scan multiple targets: nmap <target1> <target2> …
Scan a range of IP addresses: nmap <startIP>-<endIP>
Scan a subnet: nmap <CIDR>
Example: nmap 192.168.1.0/24
Port Specification:

Scan specific ports: nmap -p <port1,port2,…> <target>
Example: nmap -p 80,443 192.168.1.1
Scan common ports: nmap -F <target> or nmap — top-ports <number> <target>
Example: nmap -F 192.168.1.1 or nmap — top-ports 100 192.168.1.1
Scan Techniques:

TCP SYN scan: nmap -sS <target>
TCP Connect scan: nmap -sT <target>
UDP scan: nmap -sU <target>
TCP ACK scan: nmap -sA <target>
ICMP Echo scan: nmap -PE <target>
IP Protocol scan: nmap -sO <target>
Service and OS Detection:

Service version detection: nmap -sV <target>
OS detection: nmap -O <target>
Output Options:

Normal output: nmap -oN <file> <target>
XML output: nmap -oX <file> <target>
Grepable output: nmap -oG <file> <target>
Interactive output: nmap -oA <basename> <target>
Other Useful Options:

Run scripts: nmap -sC -sV <target>
Traceroute: nmap — traceroute <target>
Aggressive scan: nmap -A <target>
Firewall evasion: nmap -f <target>

## Basic Commands

* `nmap -sn 192.168.1.0/24` : Ping sweep to discover hosts
* `nmap -sT 192.168.1.1` : TCP connect scan to a single host
* `nmap -sV 192.168.1.1` : TCP connect scan with service and version detection
* `nmap -sP -p 80 192.168.1.0/24` : Ping sweep for hosts listening on port 80
* `nmap -F 192.168.1.0/24` : Fast scan of all 65535 ports

## Useful Flags

* `-T4` : Use aggressive timing template (faster scans)
* `-O` : OS detection
* `-p` : Scan specific ports (e.g. `-p 22,80,443`)
* `-v` : Increase verbosity
* `-Pn` : Skip host discovery (useful for firewalls)

## More Resources

* [Nmap website](https://nmap.org/)
* [Nmap documentation](https://nmap.org/docs/)
* [Nmap cheat sheet](https://nmap.org/cheat-sheet.html)

# Happy scanning! 🔬

These are just a few commonly used commands and options in Nmap. For more detailed information and advanced techniques, refer to the Nmap documentation

Read More At : https://www.linkedin.com/in/anshul-choudhary227/

--

--

Anshulchoudhary

Hey, my name is Anshul Choudhary, A convergent Thinker who values processes as well as a dependable individual who enjoys learning. A man who enjoys innovating