Recon & Attack Surface Mapping
Finding everything a target exposes before testing it
You can only test what you know exists. Reconnaissance builds a map of the target's attack surface: domains, servers, services, web pages and APIs. Passive recon uses public sources without touching the target; active recon probes the systems in scope directly.
Beginner · 5 steps
| Passive sources | Certificate Transparency, DNS, search engines, public code |
|---|---|
| Active tools | Nmap, web crawlers, content discovery |
| ATT&CK tactic | Reconnaissance (TA0043) |
| Technique | T1595 (Active Scanning) |
| Output | Prioritised attack-surface map |
| Defender view | Know your own surface first |
Step by step
Passive: certificates and DNS Without touching the target
Every public TLS certificate is recorded in Certificate Transparency logs, so searching them for
shop.examplelists hostnames the company has used:www,api,staging,api-old. DNS lookups then show which of them still resolve and where they point.Passive: public footprint Code, jobs and old pages
Public code repositories, job adverts ("experience with Django and Redis") and archived versions of the website reveal the technology stack, old URLs and sometimes leaked configuration. All of this is collected without sending a single packet to the target.
Active: port and service scan Only hosts in scope
With the hosts confirmed in scope, the tester runs Nmap at a gentle rate to find open ports and identify services and versions. The forgotten
api-oldhost has HTTPS open and runs an outdated framework version.Web content discovery Pages nobody links to
On the web servers, the tester crawls the site, reads
robots.txtand the JavaScript files, and tries a list of common paths at a low rate. JavaScript bundles often reveal API routes; here they mention an admin endpoint and the old API version.Build the map Decide what to test first
Everything goes into one attack-surface map: hosts, services, versions, endpoints and who owns them. Forgotten, outdated and unauthenticated assets go to the top of the list. For defenders, the same map shows what to retire or patch, and a dangling DNS record pointing at a deleted cloud service is flagged as a subdomain takeover risk.
Best practices
- Keep an inventory of every domain, server and API you run
- Watch Certificate Transparency logs for certificates issued for your domains
- Remove DNS records that point at retired services (subdomain takeover risk)
- Don't leave secrets, internal hostnames or old endpoints in public code or JavaScript
- Run your own external attack-surface scans regularly
More in Penetration Testing.
Packets
| No. | Time | Source | Destination | Protocol | Info | Size |
|---|