Information Gathering
Network Mapper - A powerful open-source tool for network discovery and security auditing. Nmap uses raw IP packets to determine what hosts are available on the network, what services those hosts are offering, and what operating systems they are running.
apt-get install nmap
nmap [Scan Type] [Options] {target specification}Nmap (Network Mapper) is a free, open-source utility for network discovery and security auditing. It uses raw IP packets to identify active hosts, open ports, running services, and operating systems across any TCP/IP network.
Created by Gordon Lyon in 1997, Nmap has become the industry-standard tool for network reconnaissance. Security professionals, system administrators, and penetration testers rely on it for asset discovery, vulnerability assessment, and compliance verification.
The Nmap Scripting Engine (NSE) extends core scanning with over 700 Lua scripts for automated vulnerability detection, brute-force testing, and service enumeration. Combined with Zenmap, its graphical interface, Nmap serves both beginners and advanced users.
nmap 192.168.1.1Basic scan of a single IP addressnmap -sV 192.168.1.1Probe open ports to determine service/version infonmap -sn 192.168.1.0/24Ping scan - disable port scan (discover active hosts)nmap -p 80,443 192.168.1.1Scan specific ports (80 and 443)nmap -sS 192.168.1.1TCP SYN scan (stealth scan)nmap -sT 192.168.1.1TCP connect scannmap -sU 192.168.1.1UDP scannmap -p- 192.168.1.1Scan all 65535 portsnmap -O 192.168.1.1Enable OS detectionnmap -A 192.168.1.1Aggressive scan (OS, version, script scanning, traceroute)nmap -sS -sV -O -p- -T4 192.168.1.1Comprehensive fast scan (SYN, version, OS, all ports, T4 timing)nmap --script vuln 192.168.1.1Run all vulnerability scanning scriptsnmap --script=http-enum 192.168.1.1Enumerate common web application directories and filesnmap --script=smb-vuln* 192.168.1.1Run all SMB vulnerability scriptsnmap -sV --script=banner 192.168.1.1Grab banners for detected servicesIdentify active devices on any network segment. Find live hosts before deeper scanning.
Map open ports on target systems. Detect TCP/UDP services accepting connections.
Fingerprint running services and version numbers. Identify outdated software.
Determine operating system through TCP/IP stack fingerprinting.
Run NSE scripts to detect known CVEs and misconfigurations.
Visualize entire network topologies. Document infrastructure layout.
Identify firewall rules and packet filtering behavior using different scan types and response analysis.
Evaluate encryption configurations, certificate validity, and supported cipher suites on web servers.
Test common default usernames and passwords on discovered services using NSE brute-force scripts.
Discover DNS records, zone transfers, and subdomains associated with target domains.
Build a comprehensive asset database of all devices, operating systems, and services across the infrastructure.
Find unauthorized devices and services connected to the network that bypass official IT management.
A SYN scan (-sS) sends SYN packets without completing the TCP handshake, making it faster and stealthier — it is the default when running as root. A TCP connect scan (-sT) completes the full three-way handshake using the OS connect() call, which is more reliable but slower and fully logged by the target. Use -sS for stealthy authorized engagements; use -sT only when -sS is unavailable (non-root).
A default scan of the top 1000 ports on a single host completes in 1-5 seconds. A full port scan (-p-) covering all 65535 ports takes 2-10 minutes per host depending on the timing template (-T0 through -T5) and network conditions. Aggressive timing (-T5) is faster but more likely to miss ports or trigger IDS alerts.
Yes. Use nmap -O [target] for OS detection. Nmap analyzes TCP/IP stack responses, TCP window sizes, IP ID sequences, and other fingerprinting techniques to determine the target's operating system and version with high accuracy. OS detection requires at least one open and one closed port on the target.
NSE is a Lua-based framework that extends Nmap's scanning capabilities with over 700 scripts. Scripts automate vulnerability detection (vuln category), brute-force testing (brute category), network discovery (discovery category), and more. Run scripts with nmap --script [category or script name] [target]. Categories include auth, broadcast, brute, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, and vuln.
Nmap itself is legal software. However, scanning networks or systems without explicit written permission from the owner is illegal in most jurisdictions. Unauthorized scanning violates laws like the CFAA (US), Computer Misuse Act (UK), and similar legislation worldwide. Always obtain proper authorization before performing any network scans.
Yes, but with limitations. Nmap can use fragmentation (-f), decoys (-D), source port spoofing (--source-port), and idle scans (-sI) to bypass some firewall rules. However, stateful firewalls that track connections will block many evasion techniques. Use nmap -sN (Null scan) or -sF (FIN scan) to bypass stateless packet filters.
nmap -sS (SYN scan) sends SYN packets without completing the TCP handshake — it is faster, stealthier, and the default scan when running as root. nmap -sT (TCP connect scan) completes the full three-way handshake using the OS connect() call, making it more reliable but slower and fully logged by the target. Use -sS for stealth; use -sT only when -sS is unavailable (non-root).
Yes. Use nmap -6 [target] to scan IPv6 addresses. Nmap supports IPv6 scanning for most scan types including SYN, connect, and UDP scans. IPv6 scanning is especially useful in modern enterprise networks and cloud environments that use dual-stack or IPv6-only configurations.
Sniffing & Spoofing
Deep packet inspection and protocol analysis. Inspect the traffic Nmap discovers on open ports.
Exploitation
Exploitation framework that uses Nmap results to launch attacks against discovered services.
Web Application
Web server scanner that complements Nmap's port scanning with web vulnerability detection.
Web Application
Directory and subdomain brute-forcer for web targets identified by Nmap.
Web Application
SQL injection detection and exploitation for web apps found via Nmap port scanning.
Password Attacks
Online password brute-forcer for services Nmap identifies as open.
Information Gathering
SMB/CIFS client for accessing shared resources on Windows and Samba systems. Use after Nmap discovers SMB ports (445/139) to enumerate shares, transfer files, and extract data.
Vulnerability Scanning
NSE script that cross-references detected service versions against the Vulners vulnerability database for known CVEs.
Information Gathering
Ultra-fast port scanner that complements Nmap by quickly identifying live ports before detailed Nmap analysis.
Information Gathering
SMB/Samba enumeration tool for detailed Windows domain information after Nmap identifies SMB ports.
Nmap output shows: PORT (port number/protocol), STATE (open/closed/filtered), and SERVICE (what's running). "open" means the port accepts connections. "filtered" means a firewall is blocking. "closed" means no service is listening.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.