PasswordGeeks
Tool Guide

Nmap: Network Scanning & Security Analysis

Discover hosts, open ports, and running services on a network — the standard first step in most security assessments.

What is Nmap?

Nmap (Network Mapper) is a free and open-source network scanning tool used to discover hosts and services on a computer network. It's widely used for network auditing, penetration testing, and security assessments.

With Nmap, you can identify live systems, detect open ports, determine running services, and even guess operating systems used by devices.

Why Nmap Matters for Cybersecurity

Basic Nmap Commands

The examples below use private network addresses (192.168.x.x) and IANA's reserved documentation domain — safe for learning. Only run these against your own devices or a lab environment.

Scan a Single IP

nmap 192.168.1.1

Scans a single device and shows open ports.

Scan a Range of IPs

nmap 192.168.1.1-100

Scan a Website

nmap example.com

example.com is reserved by IANA for documentation and testing — never run this against a live site you don't own.

Service Version Detection

nmap -sV 192.168.1.1

Scan Specific Ports

nmap -p 80,443 192.168.1.1

Scan All 65,535 Ports

nmap -p- 192.168.1.1

Understanding Nmap Output

A "filtered" state usually means a firewall is blocking probes; "closed" means the port is reachable but nothing's listening.

Advanced Nmap Features

These scans are more invasive — stealth scanning in particular is designed to evade detection. Only use against systems you own or a lab environment.

OS Detection

nmap -O 192.168.1.1

Aggressive Scan

nmap -A 192.168.1.1

Stealth Scan

nmap -sS 192.168.1.1

Nmap Scripting Engine (NSE)

Extends functionality with community scripts grouped into categories like default, discovery, safe, and vuln. Beginners should stick to "safe" scripts.

Nmap Timing Templates

Timing templates control scan speed, numbered T0 (slowest, stealthiest) to T5 (fastest, most aggressive).

TemplateSpeedTypical Use
-T0ParanoidExtremely slow, avoids detection
-T1SneakySlow, IDS evasion
-T2PoliteReduces network load
-T3NormalDefault speed
-T4AggressiveFaster, stable networks
-T5InsaneFastest, may lose accuracy
nmap -T4 192.168.1.1

Saving and Exporting Results

nmap -oA my_scan 192.168.1.1

Real-World Use Cases

Nmap is often the first tool used in a security assessment. Once you've mapped open ports and services, the next step is usually deeper analysis — Wireshark for inspecting the actual traffic those services generate, or Metasploit if you've identified a service with a known vulnerability worth testing further. If Nmap turns up a login service like SSH or FTP, Hydra is the natural next step for authorized authentication testing.

Nmap vs. Other Scanning Tools

ToolPrimary UseBest For
NmapPort and network scanningGeneral-purpose discovery and auditing
MasscanHigh-speed port scanningScanning very large IP ranges quickly
NessusVulnerability scanningIn-depth vulnerability identification
ZenmapGUI for NmapBeginners preferring a visual interface

Frequently Asked Questions

Is Nmap legal to use?

Yes. What matters is what you scan — unauthorized targets can be illegal regardless of the tool.

Is Nmap free?

Yes, free and open-source for Windows, Linux, and macOS.

Do I need Linux to use Nmap?

No — it runs natively on Windows and macOS too.

Can Nmap detect all vulnerabilities?

No — it's a discovery/mapping tool, typically paired with a dedicated scanner like Nessus.

What's the difference between Nmap and Zenmap?

Zenmap is Nmap's official GUI — same engine, visual results.

Conclusion

Nmap is essential for anyone interested in networking or cybersecurity, always used with proper authorization.