Nmap cheat sheet

Nmap cheat sheet – We saw about Nmap scanning in the previous post, if you have not read that post yet read that post first. In this post, I am going to divide all the commands that we can use in Nmap into sections and give them for you to understand.

What is Nmap?

The full name of Nmap is network mapper. Using this Nmap tool you can know the complete details about a network and also about that networking security. Simply put, Nmap is an information-gathering tool.

How to use Nmap?

Nmap can be used in a variety of ways depending on the user’s level of technical expertise.

Beginner – Zenmap the graphical user interface for Nmap

Intermediate – Command Line

Advanced – Python scripting with the Python-Nmap package

Nmap cheat sheet

Basic Scanning Techniques

The -s switch determines the type of scan to perform.

-sA – ACK scan
-sF – FIN scan
-sI – IDLE scan
-sL – DNS scan (a.k.a. list scan)
-sN – NULL scan
-sO – Protocol scan
-sP – Ping scan
-sR – RPC scan
-sS – SYN scan
-sT – TCP connect scan
-sW – Windows scan
-sX – XMAS scan

									Scan a Single Target >> nmap [target]Scan Multiple Targets >> nmap [target1, target2, etc]Scan a List of Targets >> nmap -iL [list.txt]Scan a Range of Hosts >> nmap [range of IP addresses]Scan an Entire Subnet >> nmap [ip address/cdir]Scan Random Hosts >> nmap -iR [number]Exclude Targets From a Scan >>nmap [targets] --exclude [targets]Exclude Targets Using a List >> nmap [targets] --excludefile [list.txt]Perform an Aggressive Scan >> nmap -A [target]Scan an IPv6 Target >> nmap -6 [target]				

Port Scanning Options

The Nmap tool will scan the port first but the default setting will scan the open TCP port. If you want to scan the other port you have to do it manually. All port scanning commands are given below.

									Perform a Fast Scan >> nmap -F [target]Scan Specific Ports >> nmap -p [port(s)] [target]Scan Ports by Name >> nmap -p [port name(s)] [target]Scan Ports by Protocol >> nmap -sU -sT -p U:[ports],T:[ports] [target]Scan All Ports >> nmap -p 1-65535 [target]Scan Top Ports >> nmap --top-ports [number] [target]Perform a Sequential Port Scan >> nmap -r [target]Attempt to Guess an Unknown OS >> nmap -O --osscan-guess [target]Service Version Detection >> nmap -sV [target]Troubleshoot Version Scan >> nmap -sV --version-trace [target]Perform a RPC Scan >> nmap -sR [target]				

Discovery options

Host Discovery The -p switch determines the type of ping to perform.

-PI  – ICMP ping
-Po  – No ping
-PS  – SYN ping
-PT  – TCP ping

Perform a Ping Only Scan
Do Not Ping
TCP SYN Ping
TCP ACK Ping
UDP Ping
SCTP INIT Ping
ICMP Echo Ping
ICMP Timestamp Ping
ICMP Address Mask Ping
IP Protocol Ping
ARP ping
Traceroute
Force Reverse DNS Resolution
Disable Reverse DNS Resolution
Alternative DNS Lookup
Manually Specify DNS Server
Create a Host List

nmap -sn [target]
nmap -Pn [target]
nmap -PS [target]
nmap -PA [target]
nmap -PU [target]
nmap -PY [target]
nmap -PE [target]
nmap -PP [target]
nmap -PM [target]
nmap -PO [target]
nmap -PR [target]
nmap –traceroute [target]
nmap -R [target]
nmap -n [target]
nmap –system-dns [target]
nmap –dns-servers [servers] [target]
nmap -sL [targets]

Timing and Performance

Switch

Example

Description
-T0nmap 192.168.1.1 -T0Paranoid (0) Intrusion Detection
System evasion
-T1nmap 192.168.1.1 -T1Sneaky (1) Intrusion Detection System
evasion
-T2nmap 192.168.1.1 -T2Polite (2) slows down the scan to use
less bandwidth and use less target
machine resources
-T3nmap 192.168.1.1 -T3Normal (3) which is default speed
-T4nmap 192.168.1.1 -T4Aggressive (4) speeds scans; assumes
you are on a reasonably fast and
reliable network
-T5nmap 192.168.1.1 -T5Insane (5) speeds scan; assumes you
are on an extraordinarily fast network
   
Switch

Example input

Description
–host-timeout <time>1s; 4m; 2hGive up on target after this long
–min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout <time>1s; 4m; 2hSpecifies probe round trip time
–min-hostgroup/max-hostgroup <size<size>50; 1024Parallel host scan group
sizes
–min-parallelism/max-parallelism <numprobes>10; 1Probe parallelization
–scan-delay/–max-scan-delay <time>20ms; 2s; 4m; 5hAdjust delay between probes
–max-retries <tries>3Specify the maximum number
of port scan probe retransmissions
–min-rate <number>100Send packets no slower than <numberr> per second
–max-rate <number>100Send packets no faster than <number> per second

OS Detection

Switch

Example

Description
-Onmap 192.168.1.1 -ORemote OS detection using TCP/IP
stack fingerprinting
-O –osscan-limitnmap 192.168.1.1 -O –osscan-limitIf at least one open and one closed
TCP port are not found it will not try
OS detection against host
-O –osscan-guessnmap 192.168.1.1 -O –osscan-guessMakes Nmap guess more aggressively
-O –max-os-triesnmap 192.168.1.1 -O –max-os-tries 1Set the maximum number x of OS
detection tries against a target
-Anmap 192.168.1.1 -AEnables OS detection, version detection, script scanning, and traceroute

Output

Switch

Example

Description
-oNnmap 192.168.1.1 -oN normal.fileNormal output to the file normal.file
-oXnmap 192.168.1.1 -oX xml.fileXML output to the file xml.file
-oGnmap 192.168.1.1 -oG grep.fileGrepable output to the file grep.file
-oAnmap 192.168.1.1 -oA resultsOutput in the three major formats at once
-oG –nmap 192.168.1.1 -oG –Grepable output to screen. -oN -, -oX – also usable
–append-outputnmap 192.168.1.1 -oN file.file –append-outputAppend a scan to a previous scan file
-vnmap 192.168.1.1 -vIncrease the verbosity level (use -vv or more for greater effect)
-dnmap 192.168.1.1 -dIncrease debugging level (use -dd or more for greater effect)
–reasonnmap 192.168.1.1 –reasonDisplay the reason a port is in a particular state, same output as -vv
–opennmap 192.168.1.1 –openOnly show open (or possibly open) ports
–packet-tracenmap 192.168.1.1 -T4 –packet-traceShow all packets sent and received
–iflistnmap –iflistShows the host interfaces and routes
–resumenmap –resume results.fileResume a scan

Conclusion

I hope I have given all kinds of Nmap commands in this post, let me know through the command section if you know of any commands that are missing.

I hope you find this Nmap cheat sheet useful. I would also like to share this post with your friends.

# Nmap Cheat Sheet # Nmap Cheat Sheet

Post a Comment

أحدث أقدم