Nmap (Network Mapper) is a powerful open-source tool for network discovery and security auditing. This guide covers essential techniques for effective network scanning and analysis.
Key areas covered:
# Basic ping scan
nmap -sn 192.168.1.0/24
# TCP SYN ping scan
nmap -PS 192.168.1.1
# UDP ping scan
nmap -PU 192.168.1.1
# ARP ping scan
nmap -PR 192.168.1.0/24
# No ping scan
nmap -Pn 192.168.1.1
# List scan (no port scan)
nmap -sL 192.168.1.0/24
# TCP SYN scan (default)
nmap -sS 192.168.1.1
# TCP connect scan
nmap -sT 192.168.1.1
# UDP scan
nmap -sU 192.168.1.1
# Version detection
nmap -sV 192.168.1.1
# Specific ports
nmap -p 80,443 192.168.1.1
# Port ranges
nmap -p 1-1000 192.168.1.1
# All ports
nmap -p- 192.168.1.1
# OS detection
nmap -O 192.168.1.1
# Aggressive OS detection
nmap -A 192.168.1.1
# Limit OS detection
nmap --osscan-limit 192.168.1.1
# OS detection guess
nmap --osscan-guess 192.168.1.1
# Version intensity
nmap -sV --version-intensity 5 192.168.1.1
# Combined scan
nmap -sS -O -sV 192.168.1.1
# Timing templates
nmap -T0 192.168.1.1 # Paranoid
nmap -T1 192.168.1.1 # Sneaky
nmap -T2 192.168.1.1 # Polite
nmap -T3 192.168.1.1 # Normal
nmap -T4 192.168.1.1 # Aggressive
nmap -T5 192.168.1.1 # Insane
# Custom timing
nmap --min-rate 100 192.168.1.1
nmap --max-rate 100 192.168.1.1
nmap --min-parallelism 10 192.168.1.1
nmap --max-parallelism 10 192.168.1.1
# Default scripts
nmap -sC 192.168.1.1
# All scripts
nmap --script=all 192.168.1.1
# Specific categories
nmap --script=vuln 192.168.1.1
nmap --script=auth 192.168.1.1
nmap --script=default,safe 192.168.1.1
# Multiple scripts
nmap --script "http-* and not http-brute" 192.168.1.1
# Script arguments
nmap --script http-title --script-args http.useragent="Mozilla 5.0" 192.168.1.1
# SSL/TLS analysis
nmap --script ssl-enum-ciphers -p 443 192.168.1.1
# Vulnerability scanning
nmap --script vuln 192.168.1.1
# SMB enumeration
nmap --script smb-enum-shares 192.168.1.1
# DNS enumeration
nmap --script dns-brute domain.com
# HTTP enumeration
nmap --script http-enum 192.168.1.1
# Banner grabbing
nmap --script banner 192.168.1.1
# Normal output
nmap -oN scan.txt 192.168.1.1
# XML output
nmap -oX scan.xml 192.168.1.1
# Grepable output
nmap -oG scan.grep 192.168.1.1
# All formats
nmap -oA scan 192.168.1.1
# Script output
nmap --script-trace 192.168.1.1
# Verbose output
nmap -v 192.168.1.1
nmap -vv 192.168.1.1
Nmap is an essential tool for network administrators and security professionals. By mastering its features and following best practices, you can effectively discover and analyze network services and potential security issues.
Remember to always obtain proper authorization before scanning and follow security policies and best practices.