Athena Wiki

Nmap

toolsbeginner

Nmap commands, workflows, and cheatsheets for CTF network enumeration, service discovery, and script scans.

toolsnmapnetworkreconenumerationscanningport-scan

Nmap

Nmap is the first pass for almost every network-facing CTF target. It helps you discover live hosts, open ports, service versions, and scripts that reveal the next move.

Nmap Zenmap overview screenshot

Basic to Advanced Workflow

Mermaid diagram

1. Start with discovery

nmap -sn 10.10.10.0/24
nmap -sn -n 10.10.10.0/24

Use this when you need to find live hosts quickly. Add -n to skip DNS lookups and speed up the scan.

2. Find open ports

nmap -p- --min-rate 2000 10.10.10.5
nmap -sS -p- -T4 10.10.10.5
nmap -sT -p 22,80,443 10.10.10.5

Use a full port sweep first, then narrow down to the ports that matter.

3. Identify services

nmap -sV -sC -O -p 22,80,443 10.10.10.5
nmap -A -p 22,80,443 10.10.10.5

-sV finds service versions, -sC runs default scripts, and -O tries OS detection.

4. Expand with scripts

nmap --script default,vuln -p 80,443 10.10.10.5
nmap --script http-title,http-headers -p 80,443 10.10.10.5
nmap --script ftp-anon -p 21 10.10.10.5

Add NSE scripts when the banner alone is not enough.

5. Go deeper

nmap -sU -p 53,123,161 10.10.10.5
nmap -sV --version-all -p 80,8080,8000 10.10.10.5
nmap -Pn -n -T4 -p- 10.10.10.5

UDP, version-all, and -Pn are common when the target blocks ping or hides service detail.

Official Screenshot Walkthrough

Zenmap scan result screenshot

Official Zenmap scan result view for checking discovered hosts, ports, and service details.

Zenmap profile editor screenshot

Official Zenmap profile editor view for saving repeatable scan presets and command templates.

Zenmap port host screenshot

Official Zenmap host and port summary view for scanning and comparing targets.

Command Cheatsheet

CommandWhat it does
nmap -sn 10.10.10.0/24Ping sweep / host discovery
nmap -sn -n 10.10.10.0/24Discovery without reverse DNS
nmap -PR 10.10.10.0/24ARP discovery on local network
nmap -PE -PP -PM targetICMP echo/timestamp/netmask probes
nmap -Pn targetSkip host discovery entirely

CTF Recipes

Quick Reference

nmap -sn target                 # host discovery
nmap -p- target                 # all TCP ports
nmap -sV -sC target             # versions + default scripts
nmap -A target                  # aggressive shortcut
nmap -Pn target                 # skip ping
nmap -sU target                 # UDP scan
nmap --script vuln target       # vulnerability-oriented scripts
nmap -oA recon target           # save all output formats

Start with -sn, then -p-, then -sV -sC. That sequence covers most CTF cases without wasting time.


Last updated on

On this page