Nmap β
TIP
Nmap (Network Mapper) is a powerful open-source tool for network discovery and security auditing.
π Official Resources β
π Common Commands β
| Task | Command |
|---|---|
| Scan a single IP | nmap 192.168.1.1 |
| Scan a range of IPs | nmap 192.168.1.1-20 |
| Scan a subnet | nmap 192.168.1.0/24 |
| Scan and detect OS/services | nmap -A 192.168.1.1 |
| Scan specific ports | nmap -p 22,80,443 192.168.1.1 |
π·οΈ Useful Flags β
| Flag | Description |
|---|---|
-sS | TCP SYN scan (default, stealthy) |
-sU | UDP scan |
-A | Enable OS detection, version detection, script scanning, and traceroute |
-p | Specify ports |
-O | OS detection |
-sV | Service version detection |
-T4 | Set timing template (faster scan) |
-Pn | Treat all hosts as online (skip host discovery) |
WARNING
Always have permission before scanning networks with Nmap. Unauthorized scanning is illegal and unethical.
π Resources β
π HTB CTF Go-To Command β
The following command is commonly used in Hack The Box (HTB) CTFs for a thorough initial scan:
bash
nmap -p- -sC -sV -oA nmap/full_scan 10.10.10.10-p-: Scan all 65535 ports-sC: Run default scripts-sV: Service/version detection-oA: Output in all formats (replacenmap/full_scanwith your desired path/prefix)10.10.10.10: Target IP (replace with the actual target)
