If you are stepping into the world of cybersecurity, NMAP is one of the most important tools you will ever learn. The NMAP Cheat Sheet you are about to explore is designed to help beginners, ethical hackers, penetration testers, and cybersecurity enthusiasts quickly understand and use one of the most powerful network scanning tools ever created.

NMAP (Network Mapper) is an open-source tool used for network discovery and security auditing. Security professionals use it to scan networks, detect open ports, identify services, and discover vulnerabilities.

Think of NMAP as a radar system for networks.

Just like an airport radar detects airplanes in the sky, NMAP detects devices and services running inside a network.

Cybersecurity professionals use NMAP for many real-world tasks:

  • discovering active devices on a network
  • identifying open ports
  • detecting running services
  • identifying operating systems
  • discovering vulnerabilities
  • mapping attack surfaces during penetration testing

If you want to become a penetration tester, bug bounty hunter, SOC analyst, or ethical hacker, learning NMAP is essential.

In this NMAP Cheat Sheet, you will learn:

This guide is structured to be extremely beginner-friendly, yet powerful enough for professional cybersecurity use.

Bookmark this NMAP Cheat Sheet, because it will become one of the most valuable references in your cybersecurity journey.



How to Install NMAP on Kali Linux

The good news is that Kali Linux already includes NMAP by default.

NMAP is maintained by the security community and you can download the latest version from the Official Nmap website.

Installing NMAP on Kali Linux using sudo apt install nmap command
Installing NMAP on Kali Linux using the apt package manager.

However, you should always ensure you are running the latest version.

Step 1 — Update Kali Linux

sudo apt update
NMAP Hands On lab - 1
Update Kali Linux

Step 2 — Upgrade Packages

sudo apt upgrade
NMAP Hands On lab - 2
Upgrade Kali Linux Packages

Step 3 — Verify NMAP Installation

nmap --version

Example output:

Nmap version 7.98
NMAP Hands On lab - 3
Check NMAP Version

Step 4 — Install NMAP (If Missing)

sudo apt install nmap

Step 5 — View NMAP Help Menu

nmap -h

This displays all available options.

NMAP Hands On lab - 4
See NMAP Help

You are now ready to start using the NMAP Cheat Sheet commands.


Basic NMAP Commands Cheat Sheet

The following NMAP Cheat Sheet table contains the most commonly used commands beginners must learn first.

Basic NMAP commands for network scanning and device discovery
Common NMAP Cheat Sheet commands used for beginner network scanning.

These commands help you perform network discovery, port scanning, and service detection.


BASIC COMMANDS OF NMAP

Command SyntaxPurpose of CommandDescription
nmap 192.168.1.1Basic ScanThis command performs a basic NMAP scan against a target IP address. It checks common ports and reports whether they are open, closed, or filtered, helping beginners quickly identify running services on a device.
nmap example.comDomain ScanScans a domain name instead of an IP address. NMAP resolves the domain to an IP and then performs a port scan to detect open services hosted on that web server.
nmap -v 192.168.1.1Verbose ScanEnables verbose output. This allows you to see detailed scanning progress and results in real time, helping beginners understand what NMAP is doing during the scanning process.
nmap -vv 192.168.1.1Very Verbose ScanDisplays extremely detailed information during scanning. Useful for troubleshooting or understanding network behavior when learning NMAP penetration testing techniques.
nmap -sn 192.168.1.0/24Ping ScanPerforms a ping sweep across a network range to discover active devices without scanning ports. Useful during reconnaissance phases of penetration testing.
nmap -p 80 192.168.1.1Scan Specific PortScans only port 80 on the target system to check whether a web server is running. This reduces scanning time and focuses on specific services.
nmap -p 1-1000 192.168.1.1Port Range ScanScans ports 1 through 1000 on the target machine. This helps identify which services are running on commonly used ports.
nmap -F 192.168.1.1Fast ScanPerforms a faster scan by checking only the most common 100 ports instead of scanning all ports.
nmap -p- 192.168.1.1Full Port ScanScans all 65,535 ports on a system to detect any open services. This is commonly used during deep penetration testing.
nmap -O 192.168.1.1OS DetectionAttempts to detect the operating system of the target device by analyzing network responses and fingerprinting techniques.
nmap -A 192.168.1.1Aggressive ScanPerforms OS detection, version detection, script scanning, and traceroute. Useful for gathering maximum information about a target.
nmap -sS 192.168.1.1SYN ScanPerforms a stealth TCP SYN scan often used in penetration testing to detect open ports without completing the full TCP handshake.
nmap -sT 192.168.1.1TCP Connect ScanPerforms a full TCP connection scan. This method completes the TCP handshake and is often used when SYN scans are restricted.
nmap -sU 192.168.1.1UDP ScanScans UDP ports on a system to identify services like DNS, SNMP, and DHCP that run on UDP protocol.
nmap -sV 192.168.1.1Service Version DetectionDetermines the exact version of services running on open ports. Useful for vulnerability research.
nmap -Pn 192.168.1.1Disable Host DiscoveryTreats the target as alive even if it does not respond to ping requests. Useful when firewalls block ICMP packets.
nmap -n 192.168.1.1Disable DNS ResolutionPrevents NMAP from resolving hostnames. This speeds up scans significantly.
nmap --open 192.168.1.1Show Open PortsDisplays only open ports in the scan results to simplify output analysis.
nmap -T4 192.168.1.1Faster Scan TimingIncreases scan speed by adjusting timing templates. Useful when scanning large networks quickly.
nmap -T0 192.168.1.1Slow ScanPerforms extremely slow scans to avoid detection by intrusion detection systems.
nmap --top-ports 10 192.168.1.1Top Ports ScanScans the top 10 most common ports used across networks.
nmap -iL targets.txtScan Target ListScans multiple targets listed inside a text file.
nmap -oN results.txtSave ResultsSaves scan results into a normal text output file for later analysis.
nmap -oX results.xmlXML OutputSaves results in XML format for integration with other security tools.
nmap -oG results.txtGrepable OutputSaves results in grep-friendly format useful for scripting.
nmap --reason 192.168.1.1Port State ReasonDisplays reasons why ports are classified as open, filtered, or closed.
nmap --stats-every 10s 192.168.1.1Progress StatsShows scanning progress every 10 seconds during long scans.
nmap --traceroute 192.168.1.1Network PathDisplays the route packets take to reach the target.
nmap --host-timeout 30s 192.168.1.1Timeout ControlStops scanning a host if it takes longer than specified time.
nmap -6 2001:db8::1IPv6 ScanAllows scanning IPv6 addresses instead of IPv4 networks.

Advanced NMAP Commands Cheat Sheet

These commands from the NMAP Cheat Sheet are used by penetration testers and advanced security professionals.

Advanced NMAP penetration testing commands for vulnerability detection
Advanced NMAP cheat sheet scanning techniques used by penetration testers.

ADVANCED COMMANDS OF NMAP

Command SyntaxPurposeDescription
nmap -sS -T4 192.168.1.1Stealth Fast ScanCombines stealth SYN scanning with faster timing template to quickly detect open ports during penetration testing engagements.
nmap -sV --script=vuln 192.168.1.1Vulnerability ScanRuns vulnerability detection scripts from the NMAP scripting engine to identify known security weaknesses in services running on the target machine.
nmap -p 80 --script=http-enum example.comWeb EnumerationEnumerates web server directories and resources using NSE scripts designed for HTTP reconnaissance.
nmap --script dns-brute example.comDNS BruteforceAttempts to discover subdomains using DNS brute force techniques.
nmap --script ftp-anon 192.168.1.1FTP Anonymous CheckTests whether an FTP server allows anonymous login access.
nmap --script smb-os-discovery 192.168.1.1SMB OS DiscoveryUses SMB protocol scripts to determine operating system details on Windows machines.
nmap --script ssh-auth-methods 192.168.1.1SSH Authentication CheckIdentifies supported authentication methods on SSH services.
nmap --script http-title 192.168.1.1Web Title DetectionRetrieves the title of web pages hosted on open HTTP ports.
nmap --script ssl-cert 192.168.1.1SSL Certificate InfoExtracts SSL certificate information from HTTPS servers.
nmap --script http-methods 192.168.1.1HTTP Methods DetectionDetects allowed HTTP methods such as GET, POST, PUT, DELETE that may expose vulnerabilities.
nmap --script=http-vuln* 192.168.1.1Web Vulnerability ScriptsExecutes multiple HTTP vulnerability detection scripts.
nmap -sA 192.168.1.1ACK ScanUsed to map firewall rulesets by analyzing responses to ACK packets.
nmap -sW 192.168.1.1Window ScanIdentifies open ports based on TCP window size differences.
nmap -sM 192.168.1.1Maimon ScanRare scan technique used against specific firewall configurations.
nmap -sN 192.168.1.1Null ScanSends packets without flags to bypass certain firewall filters.
nmap -sF 192.168.1.1FIN ScanSends FIN packets to detect open ports on Unix systems.
nmap --data-length 200 192.168.1.1Packet PaddingAdds random data to packets to evade detection.
nmap --spoof-mac 0 192.168.1.1MAC Address SpoofingChanges MAC address to disguise scanning identity.
nmap -D RND:10 192.168.1.1Decoy ScanUses decoy IP addresses to hide the attacker’s real IP.
nmap --script firewall-bypass 192.168.1.1Firewall TestingExecutes scripts designed to detect firewall misconfigurations.
nmap --script banner 192.168.1.1Banner GrabbingRetrieves service banners to identify software versions.
nmap --script brute 192.168.1.1Brute Force ScriptsExecutes brute force login attempts against services like SSH, FTP, and HTTP.

SecurityElites Hands-On Lab – Real Cybersecurity Scenarios

The following practical labs demonstrate how the NMAP Cheat Sheet commands are used in real penetration testing environments.


Scenario 1 — Discover Devices in a Network

Imagine you just joined a company as a security analyst. Your first task is to identify all active devices in the office network.

Command

nmap -sn 192.168.1.0/24

This command performs a ping sweep across the network.

NMAP Hands On lab -Scenario 1 — Discover Devices in a Network
Discover Devices in a Network

Example results may reveal:

  • routers
  • printers
  • laptops
  • servers
  • IoT devices

Once discovered, these systems become targets for deeper scanning.


Scenario 2 — Identify Open Ports on a Web Server

A company wants to check if unnecessary services are exposed on its public web server.

Command

nmap -p- example.com
NMAP Hands On lab -Scenario 1 — Identify Open Ports on a Web Server
Identify Open Ports on a Web Server

This performs a full port scan across all ports. it may take some time to complete so wait patiently.

You might discover:

  • Port 80 → HTTP
  • Port 443 → HTTPS
  • Port 22 → SSH

If SSH is exposed publicly, it may represent an attack surface.


Scenario 3 — Identify Software Versions

Knowing which software version is running is critical during vulnerability research.

Command

nmap -sV 192.168.1.1

Example output:

Apache 2.4.49
OpenSSH 7.2

Security researchers can now check whether those versions contain known vulnerabilities.


Scenario 4 — Detect Operating System

During penetration testing, identifying the operating system helps attackers choose the correct exploit.

Command

nmap -O 192.168.1.1

Example results:

Linux 5.x
Windows Server 2019
FreeBSD

Knowing the OS dramatically improves attack accuracy.


Scenario 5 — Detect Vulnerabilities Automatically

The NMAP scripting engine allows vulnerability detection.

Command

nmap --script vuln 192.168.1.1

This scans services and compares them with known vulnerability signatures.

It may reveal issues like:

  • outdated SSL configurations
  • weak encryption
  • known software vulnerabilities

Security teams can immediately begin patching those issues. Security professionals often combine Nmap scans with the OWASP cybersecurity resources to identify common web vulnerabilities.


FAQ – NMAP Cheat Sheet

What is NMAP used for?

NMAP is a network scanning and security auditing tool used by cybersecurity professionals to discover hosts, detect open ports, identify running services, and map network infrastructure. Ethical hackers and penetration testers rely heavily on NMAP to perform reconnaissance during security assessments. By analyzing network responses, NMAP can also detect operating systems and software versions. This information helps security teams identify vulnerabilities and protect systems from attackers.


Yes, NMAP is completely legal when used for legitimate purposes such as cybersecurity research, network administration, and penetration testing. However, scanning networks without permission may violate laws or organizational policies. Ethical hackers always obtain written authorization before performing NMAP scans on systems they do not own. Responsible use of NMAP is a core principle in cybersecurity practice.


Does Kali Linux include NMAP?

Yes, Kali Linux comes with NMAP pre-installed. Kali Linux is a cybersecurity-focused operating system that includes hundreds of penetration testing tools, and NMAP is one of the most important among them. Security professionals frequently use Kali Linux because it allows them to perform network discovery, vulnerability scanning, and ethical hacking tasks without installing additional tools.


Is NMAP used by hackers?

Yes. Both ethical hackers and malicious hackers use NMAP. Ethical hackers use it to identify security weaknesses and help organizations improve their defenses. Attackers may also use NMAP to map networks and discover vulnerable services. This is why security teams also use NMAP proactively to detect risks before attackers exploit them.


What are alternatives to NMAP?

Several tools provide network scanning capabilities similar to NMAP. Popular alternatives include Masscan, RustScan, and Angry IP Scanner. Masscan is extremely fast and capable of scanning millions of IP addresses quickly. RustScan is optimized for speed and integrates well with NMAP. Angry IP Scanner is beginner-friendly and often used for basic network discovery tasks.


Conclusion

NMAP remains one of the most powerful cybersecurity tools ever created.

This NMAP Cheat Sheet covered everything you need to start mastering network scanning:

  • Installing NMAP on Kali Linux
  • 60+ essential commands
  • Beginner and advanced scanning techniques
  • Real-world penetration testing scenarios
  • Practical cybersecurity labs

Whether you are a curious beginner, bug bounty hunter, SOC analyst, or penetration tester, learning NMAP will dramatically improve your ability to understand and secure networks.

The best way to master NMAP is simple:

Practice.

Set up cybersecurity labs using virtual machines and test these commands in safe environments.

Beginners who want to explore deeper features should also review the Nmap official documentation, which explains scanning techniques in detail.

If you found this NMAP Cheat Sheet helpful:

  • Bookmark this guide for future reference
  • Share it with your cybersecurity friends
  • Practice the commands in your labs
  • Explore more ethical hacking tutorials on SecurityElites

Your cybersecurity journey is just beginning.

LEAVE A REPLY

Please enter your comment!
Please enter your name here