Nmap Basics
Discover hosts, find open ports, and identify services, legally.
Nmap is the standard tool for mapping networks. Only scan systems you own or have written permission to test: scanning other networks can be illegal (see the Rules page).
1
Port scans
nmap 10.10.10.5 # top 1000 TCP ports nmap -p 22,80,443 10.10.10.5 # specific ports nmap -p- 10.10.10.5 # all 65535 portsScan types:
-sSSYN scan (default as root): sends SYN, reads the reply, never completes the handshake. Fast and quiet.-sTconnect scan: completes the handshake. Used when you aren't root.-sUUDP scan: slow, but finds DNS, SNMP, and other UDP services.
By default Nmap scans the 1000 most common ports.
2
Services and operating systems
Knowing a port is open is good; knowing what runs there is better.
nmap -sV 10.10.10.5 # probe services for name and version nmap -O 10.10.10.5 # guess the operating system nmap -A 10.10.10.5 # -sV, -O, default scripts, and traceroutePORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 80/tcp open http Apache httpd 2.4.52Versions matter: you can look them up for known vulnerabilities (CVEs).
โ Report a problem with this room
Log in to report a problem.