Port scanning
- Noise
- Heavy active
- Reads
dns/ips-origin.txtorg/cidrs.txt- Writes
ports/naabu.txtports/nmap/
Scope checkActive phase. Check the program policy first. Send traffic only to in-scope assets, at the rate the program allows.
Web apps on 80 and 443 get tested by everyone. An admin panel on 8443, a Kibana on 5601 or a Redis on 6379 often gets tested by nobody. Port scanning finds those, then service detection tells you what they are.
Port scans are the loudest thing in this guide. Read the program rules on scanning first, scan origin IPs only, and keep the rate down.
| Tool | Noise | Best for | Status |
|---|---|---|---|
| Naabu | Heavy active | Fast TCP SYN or connect scans of host lists, skips CDN IPs, pipes into httpx | Maintained |
| Nmap | Heavy active | Service and version detection, NSE scripts, the reference tool | Maintained |
| Masscan | Heavy active | Large IP ranges at high packet rates | Maintained, rarely needed in bug bounty |
| RustScan | Heavy active | Fast discovery on a single host, hands open ports to Nmap | Maintained |
| smap | Passive | Port and service data from Shodan’s InternetDB, sends nothing to the target | Maintained |
| Shodan InternetDB | Passive | Free JSON API of ports, CPEs and hostnames per IP, no key | Online service |
Even a “top 100 ports” scan of one host is heavy compared to anything in phases 1 to 4. The badge reflects that.
When to skip an IP
Section titled “When to skip an IP”| IP type | Scan it? |
|---|---|
| Origin IP in the target’s own autonomous system (ASN) | Yes, if the program allows IP targets or the host is in scope by name |
| Cloud VM (EC2, GCE, Azure VM) serving an in-scope host | Yes, scan the IP the in-scope name resolves to |
| CDN (content delivery network) or WAF (web application firewall) edge (Cloudflare, Akamai, Fastly, CloudFront) | No. You would scan the CDN, not the target |
| Shared hosting with many unrelated sites | No |
| SaaS platform IP (Zendesk, Shopify, HubSpot) | No |
What a scan line proves
Section titled “What a scan line proves”Nmap version line
Section titled “Nmap version line”PORT STATE SERVICE VERSION8443/tcp open ssl/http nginx 1.24.0|_http-title: 400 Bad Request|_http-server-header: nginx/1.24.0| ssl-cert: Subject: commonName=internal-api.example.com| Not valid before: 2026-01-10T12:00:00|_Not valid after: 2027-01-10T12:00:00TCP to port 8443 completed, TLS presented a certificate for internal-api.example.com, and a generic HTTP probe got status 400. The 400 does not mean the app is down or closed. A proxy often returns 400 until the request carries Host: internal-api.example.com.
Naabu open port
Section titled “Naabu open port”203.0.113.10:9200A SYN to 203.0.113.10 port 9200 got a SYN-ACK. That is not proof of unauthenticated Elasticsearch. The port can be a honeypot, an auth proxy, or some other protocol that happens to use 9200.
Trade-offs
Section titled “Trade-offs”Nmap -sS sends raw SYN packets and does not finish the handshake, so many application logs never record a connection. It needs root. Nmap -sT uses a normal OS connect, works without root, and shows up in those logs.
Scanning the IP finds services that have no public name. Scanning the hostname sends the right SNI and Host header, and misses anything bound only to the address.
Convincing duds
Section titled “Convincing duds”Firewall that SYN-ACKs everything
Section titled “Firewall that SYN-ACKs everything”Naabu or RustScan reports all 65535 ports open on 203.0.113.25. The firewall answers SYN-ACK so it can inspect the next payload, or so it can waste your time. Run Nmap version probes. If every port times out, or every port returns the same empty close right after the handshake, drop the host.
CDN edge
Section titled “CDN edge”A scan of static.example.com shows 80, 443, 8080, and 8443 with generic edge banners. CDN edges listen on those ports for every customer. Check the address with whois or cdncheck. If it is Cloudflare, CloudFront, or Fastly, the open ports belong to the CDN.
Middlebox that resets Nmap scripts
Section titled “Middlebox that resets Nmap scripts”An open port dies in the middle of nmap -sC, then a second pass says filtered or closed. The firewall saw a script payload and injected a RST. Connect with netcat or curl. If that works, the port is real and the script scan is what got blocked.
Ports without scanning
Section titled “Ports without scanning”Before you send a single packet, check what internet-wide scanners already saw. Shodan’s InternetDB is free and needs no key, and smap presents the same data with an Nmap-style interface. This is the only option on a program that forbids active scanning, and a useful first pass everywhere else.
# Ports, CPEs and hostnames Shodan already recorded for one IPcurl -s https://internetdb.shodan.io/203.0.113.10 | jq# Same idea across the whole origin list with smap, Nmap-style outputsmap -iL dns/ips-origin.txt -oA ports/smapThe data can be months old, so a missing port does not mean the port is closed. Treat it as a free head start, then scan actively where the program allows it.
Step by step
Section titled “Step by step”-
Fast discovery with Naabu.
-exclude-cdnlimits CDN IPs to ports 80 and 443 instead of a full scan. Start with the top 1000 ports.Terminal window # Scan the top 1000 ports on origin IPs at 300 packets per secondnaabu -list dns/ips-origin.txt -top-ports 1000 -exclude-cdn -rate 300 -silent -o ports/naabu.txtNaabu also accepts hostnames. Scanning names keeps the output readable, because
api.example.com:8443tells you more than203.0.113.10:8443.Terminal window # Same scan on resolved hostnamesnaabu -list dns/resolved.txt -top-ports 1000 -exclude-cdn -rate 300 -silent -o ports/naabu-hosts.txt -
Service detection with Nmap on the open ports only. Nmap is slow across many ports, so give it what Naabu found.
Terminal window # Build a comma-separated list of open portsPORTS=$(cut -d: -f2 ports/naabu.txt | sort -un | paste -sd,)Terminal window # Version detection and default scripts on those ports, all output formatsnmap -sV -sC -Pn -p "$PORTS" -iL dns/ips-origin.txt --max-rate 100 -oA ports/nmap/services -
Full range on a few hosts that matter. For a single high-value host, scan all 65535 ports. RustScan finds open ports quickly and passes them to Nmap.
Terminal window # All ports on one origin IP, then Nmap version detection on what is openrustscan -a 203.0.113.10 --ulimit 5000 -b 500 -- -sV -sC -
Masscan only for big owned ranges. If the target owns a /20 and the program puts it in scope, Masscan covers it fastest. Keep the rate modest.
Terminal window # All ports across owned CIDRs at 1000 packets per secondsudo masscan -iL org/cidrs.txt -p0-65535 --rate 1000 -oL ports/masscan.txt -
Hand HTTP ports to the next phase. Naabu output is
host:port, which httpx reads directly.Terminal window # Send every open port to httpx, which keeps only those that speak HTTPhttpx -l ports/naabu-hosts.txt -silent -o ports/http-ports.txt
What to do with an open port
Section titled “What to do with an open port”An open non-HTTP port is a lead, not a finding. One read-only probe tells you whether the service is exposed without authentication. Make that one call and stop; reading or writing data is past recon and often past the program.
| Service | Port | Safest read-only check | Exposed if |
|---|---|---|---|
| Redis | 6379 | redis-cli -h 203.0.113.10 ping |
Returns PONG with no NOAUTH error |
| Elasticsearch | 9200 | curl -s 203.0.113.10:9200/_cat/indices |
Lists indices instead of a 401 |
| Kibana | 5601 | curl -s 203.0.113.10:5601/api/status |
Returns status JSON without a login |
| Jenkins | 8080 | curl -s 203.0.113.10:8080/api/json |
Returns job JSON rather than a login redirect |
| Docker API | 2375 | curl -s 203.0.113.10:2375/version |
Returns the engine version |
| Kubelet | 10250 | curl -sk https://203.0.113.10:10250/pods |
Returns the pod list instead of 401 |
Each check is one request. Do not run KEYS *, read documents, or list containers; that steps into the data, which is exactly what the finding is about. Record the response and report the exposure.
How the output feeds the next phase
Section titled “How the output feeds the next phase”ports/http-ports.txtjoinsdns/resolved.txtas input to phase 6, so non-standard HTTP ports get probed and screenshotted.ports/nmap/services.nmapis your reading list for non-HTTP services: databases, message queues, SSH, FTP, SMTP.
Common mistakes
Section titled “Common mistakes”- Scanning CDN edges and reporting “open ports” that belong to Cloudflare.
- Running full 65535-port scans across hundreds of hosts at high rate on a program that bans heavy scanning.
- Running Nmap with
-p-on every host instead of letting a fast scanner find open ports first. - Forgetting UDP exists. A targeted
nmap -sU --top-ports 50on key hosts finds SNMP, DNS and IPsec services. - Treating an open port as a vulnerability. It is a lead. Exposure only matters if the service lets you do something.
- Admin and dev ports: 8080, 8443, 8000, 8888, 9000, 9090, 3000, 5000
- Data stores reachable from the internet: 6379 Redis, 9200 Elasticsearch, 27017 MongoDB, 5432 PostgreSQL, 3306 MySQL, 11211 Memcached
- Monitoring and ops: 5601 Kibana, 3000 Grafana, 9100 node exporter, 2375 Docker API, 10250 Kubelet, 8500 Consul
- Remote access: 22 SSH banners with old versions, 3389 RDP, 5900 VNC
- The same service on a different port across many hosts, which hints at a shared template or image
Next, probe every web server and take screenshots in phase 6.
Open local graph around this page
Recon AtlasFor authorized testing only. Your scope is the map edge.