Skip to content

Nmap ​

TIP

Nmap (Network Mapper) is a powerful open-source tool for network discovery and security auditing.

πŸ”— Official Resources ​

πŸš€ Common Commands ​

TaskCommand
Scan a single IPnmap 192.168.1.1
Scan a range of IPsnmap 192.168.1.1-20
Scan a subnetnmap 192.168.1.0/24
Scan and detect OS/servicesnmap -A 192.168.1.1
Scan specific portsnmap -p 22,80,443 192.168.1.1

🏷️ Useful Flags ​

FlagDescription
-sSTCP SYN scan (default, stealthy)
-sUUDP scan
-AEnable OS detection, version detection, script scanning, and traceroute
-pSpecify ports
-OOS detection
-sVService version detection
-T4Set timing template (faster scan)
-PnTreat 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 (replace nmap/full_scan with your desired path/prefix)
  • 10.10.10.10 : Target IP (replace with the actual target)