NMAP Cheat Sheet
NMAP Cheat Sheet
Public
School
Cheat
Sheet
HTTPS://CYBERPUBLICSCHOOL.COM/
NAMP Cheat Sheet
Cheat
Sheet
CYBER PUBLIC SCHOOL
https://cyberpublicschool.com/ PAGE||02
NAMP Cheat Sheet
Table of Contents
● Introduction to Nmap
● Target Selection
● Port Selection
● Scan Types
● Service and Operating System Detection
● Output Formats
● NSE Scripting
● Firewall / IDS Evasion and Spoofing
CYBER PUBLIC SCHOOL
● Helpful Nmap Output Examples
● Miscellaneous Nmap Flags
● Other Useful Nmap Commands
● Frequently Asked Questions
https://cyberpublicschool.com/ PAGE||03
NAMP Cheat Sheet
Introduction to Nmap
Nmap (Network Mapper) is a free and open-source utility for
network discovery and security auditing. It is used to scan
large networks, single hosts, or ranges of IP addresses to
identify active hosts and the services they are offering. Nmap
can also be used to detect operating systems, device types,
and open ports.
Target Selection
https://cyberpublicschool.com/ PAGE||04
NAMP Cheat Sheet
network that are running Windows, you would use the
following command:
nmap -sV -iL nmap-os-detect.nse .
To scan all hosts on a network that are offering the HTTP
service, you would use the following command:
nmap -sV -iL nmap-services.nse .
Reading targets from a file: You can also read targets from a
file. To do this, use the -iL option. The file should contain a list
of targets, one per line. For example, to scan all hosts in the
file targets.txt, you would use the following command:
nmap -iL targets.txt
https://cyberpublicschool.com/ PAGE||05
NAMP Cheat Sheet
Port Selection
Using port ranges: You can also specify port ranges to scan. To
do this, use the -p option with a hyphen (-) to separate the
beginning and end ports of the range. For example, to scan
ports 80 to 443, you would use the following command:
nmap -p 80-443 <target>
Using port lists: You can also specify port lists to scan. To do
this, use the -p CYBER PUBLIC
option with a commaSCHOOL
(,) to separate the port
numbers in the list. For example, to scan ports 80, 443, and
8080, you would use the following command:
nmap -p 80,443,8080 <target>
Scanning all ports: You can also scan all ports on a target. To
do this, use the -p- option. This will scan all 65,535 TCP ports
and UDP ports.
https://cyberpublicschool.com/ PAGE||06
NAMP Cheat Sheet
Using port selection scripts: Nmap includes a number of port
selection scripts that can be used to select ports based on
specific criteria, such as service type or operating system. For
example, to scan all ports that are associated with web
services, you would use the following command:
nmap -sV -iL nmap-top-ports-web.nse .
To scan all ports that are associated with SSH services, you
would use the following command:
nmap -sV -iL nmap-services.nse ssh
Once you have selected the ports to scan, you can start your
scan. Nmap will scan the specified ports on the target host
and report back on the results.
Scan Types
CYBER PUBLIC SCHOOL
TCP SYN scan (default): This is the most common scan type
and is relatively stealthy. It sends a SYN (synchronize) packet
to the target host and then waits for a response. If the port is
open, the target host will respond with a SYN-ACK
(synchronize/acknowledge) packet. If the port is closed, the
target host will respond with a RST (reset) packet. If the port is
filtered, the target host will not respond at all.
https://cyberpublicschool.com/ PAGE||07
NAMP Cheat Sheet
TCP FIN scan: This scan type is similar to the TCP SYN scan, but
it sends a FIN (finish) packet instead of a SYN packet. This scan
type is more stealthy than the TCP SYN scan, but it can also be
less reliable.
TCP NULL scan: This scan type sends a TCP packet with all of
the flags set to zero. This scan type is very stealthy, but it can
also be very unreliable.
UDP scan: This scan type sends a UDP packet to the target
host and then waits for a response. If the port is open, the
target host will respond with a UDP packet. If the port is
closed, the target host will not respond at all. UDP scans are
less reliable than TCP scans because UDP is a connectionless
protocol.
https://cyberpublicschool.com/ PAGE||08
NAMP Cheat Sheet
Service and Operating System Detection
Service Detection
https://cyberpublicschool.com/ PAGE||09
NAMP Cheat Sheet
Output Formats
NSE Scripting
https://cyberpublicschool.com/ PAGE||10
NAMP Cheat Sheet
Network troubleshooting: NSE scripts can be used to
troubleshoot network problems, such as connectivity issues
and performance problems. For example, there is an NSE
script that can be used to test the performance of a web
server.
Penetration testing: NSE scripts can be used to perform
penetration tests on networks and devices. For example, there
is an NSE script that can be used to brute-force the password
to a SSH server.
NSE scripts can be loaded into Nmap using the -sC flag.
https://cyberpublicschool.com/ PAGE||11
NAMP Cheat Sheet
Helpful Nmap Output Examples
● PORT STATE SERVICE This line indicates that the port is open
and the service running on it is identified.
Here are some miscellaneous Nmap flags that you may find
useful: CYBER PUBLIC SCHOOL
● -T4 This flag specifies a faster scan.
● -A This flag enables all Nmap's OS detection capabilities.
● -v This flag increases the verbosity of Nmap's output.
● -d This flag enables debug output.
https://cyberpublicschool.com/ PAGE||12
NAMP Cheat Sheet
Other Useful Nmap Commands
https://cyberpublicschool.com/ PAGE||13
NAMP Cheat Sheet
• What are some common Nmap commands?
https://cyberpublicschool.com/ PAGE||14
NAMP Cheat Sheet
• What are some tips for using Nmap?
https://cyberpublicschool.com/ PAGE||15
NAMP Cheat Sheet
running on that port. This could be because the service is new
or unusual, or because Nmap does not have a signature for
that service.
https://cyberpublicschool.com/ PAGE||16
Contacts us
https://cyberpublicschool.com/
https://www.instagram.com/cyberpublicschool/
https://cyberpublicschool.com/ PAGE||17