Nmap (Network Mapper) is a free, open-source tool for network discovery and security auditing. Created by Gordon Lyon (Fyodor), it rapidly scans networks or individual hosts to identify live devices, open ports, running services (including versions), operating systems, firewalls, and more. It uses raw packets for accurate results and is widely used by system administrators for network inventory and by security professionals for penetration testing. Nmap supports advanced features like the Nmap Scripting Engine (NSE) and runs on multiple platforms.
Nmap is essential for:
sudo nmap -sn 192.168.1.0/24
# -sn : Ping scan - Disable port scan, only perform host discovery
# sudo : Required for certain scan types (e.g., raw packets)
# Tip: Quickly finds live hosts. Use -Pn globally to skip ping if firewalls block it
nmap 192.168.1.1
# (no flags needed) : Scans the top 1000 most common ports by default
# Tip: Add -p- to scan all 65,535 ports (slower but complete)
sudo nmap -sS 192.168.1.1
# -sS : TCP SYN scan (stealthy half-open scan)
# sudo : Required for raw packet privileges
# Tip: Fast and less likely to be logged. This is the default scan type when run as root
sudo nmap -sV 192.168.1.1
# -sV : Probe open ports to determine service/version info
# sudo : Recommended for more accurate results
# Tip: Combine with -sS: sudo nmap -sS -sV target