open atlas
↑ Back to track
Offensive Security RED · 01 · 02

Attack surface mapping

Your real attack surface is what is actually reachable, not your architecture diagram. Enumerate assets, subdomains, and shadow IT against authorized, in-scope targets to see what an attacker sees — the forgotten host is the one that gets owned.

RED Middle ◷ 15 min
Level
FoundationsJuniorMiddleSenior

A company’s threat model had three internet-facing services on it. The pentest found nineteen. The other sixteen were real and authorized to test — a four-year-old marketing microsite on an expired framework, a staging. host that quietly served the production database, a forgotten S3 bucket behind a wildcard DNS record, and a Jenkins box someone stood up “for a day” in 2021. None of them were on the diagram, every one of them was on the internet, and the one that fell first was the Jenkins box nobody remembered owning. The architecture diagram describes the system you think you run. The attack surface is the system you actually expose — and the gap between them is where breaches live.

By the end of this lesson you’ll know why the real attack surface is almost always bigger than the architecture diagram, and how disciplined asset, subdomain, and shadow-IT enumeration closes that gap before an attacker exploits it.

Scope first — enumeration is reconnaissance, and recon has rules

This lesson lives inside an authorized engagement. Reconnaissance — MITRE ATT&CK groups it as tactic TA0043 — is the first thing an attacker does and the first thing you do, but the enumeration techniques here only apply to assets that are in your signed scope. “We own the example.com domain” is not the same as “we are authorized to test every host that resolves under it” — a subdomain might be a third-party SaaS (status.example.com pointing at a vendor’s status page) that your scope document explicitly excludes. Before you enumerate, you confirm what’s in bounds; when enumeration discovers something unexpected, the next move is to check it against scope, not to probe it. The discovery itself — “this host exists and is exposed” — is the deliverable. Everything in this lesson is the kind of passive and light-touch enumeration you run against your own authorized estate to see what you actually expose.

The reason this matters so much: most organizations cannot tell you, accurately, what they have on the internet. Cloud accounts spin up in minutes, teams register subdomains without telling security, acquisitions bring whole inherited estates, and a “temporary” demo box outlives the project by years. The attacker doesn’t care which of these was intentional. They enumerate everything, find the weakest exposed thing, and start there.

Attack surface = every reachable entry point, intended or not

The attack surface is the complete set of points where an attacker could attempt to interact with your systems: every domain and subdomain that resolves, every open port and service, every API endpoint and parameter, every cloud bucket and storage account, every third-party integration, and — at the edges — every credential and employee that touches the system. “Reachable” is the operative word. A beautifully hardened production cluster doesn’t shrink your surface by one byte if a forgotten staging host on the same VPC is wide open.

Enumeration is the disciplined process of discovering that surface so you can measure and reduce it. It runs in three intertwined passes — find the assets, expand each asset into its subdomains and services, and surface the shadow IT nobody is tracking.

The three enumeration passes

Asset discovery answers “what do we own?” before “what does it expose?” You start from seeds — a root domain, a company name, a known IP block — and pivot outward. WHOIS and registrar data reveal sibling domains; published ASN and IP-range registrations (RIR records) reveal owned network blocks; cloud-provider account inventories reveal what’s running where; certificate transparency logs (every TLS certificate ever issued is logged publicly) reveal hostnames the moment a cert is minted for them. The senior insight: asset discovery is mostly an open-source intelligence exercise — the data is already public, because the act of putting something on the internet leaves a public trail (a DNS record, a cert, an ASN registration). You’re not breaking in; you’re reading the trail the organization left.

Subdomain enumeration expands each owned domain into its real, resolving hosts. Two complementary methods cover it. Passive enumeration pulls names from sources that already recorded them — certificate transparency logs are the heavy hitter, because a wildcard or per-host cert leaks the hostname publicly the moment it’s issued; passive DNS aggregators and search-engine indexes add more. Active enumeration resolves candidate names — brute-forcing a wordlist of common prefixes (dev, staging, api, vpn, admin) against DNS, and trying the zone-transfer misconfiguration that, when present, hands you the entire zone at once. Passive is quiet and authorization-friendly because you query third-party datasets, not the target; active is noisier and touches the target’s DNS directly, so it belongs more firmly inside the engagement’s rules of engagement.

Shadow IT is the pass that finds what no inventory knows about — and it’s where the real findings hide. Shadow IT is any system, service, or account running outside the organization’s sanctioned, tracked inventory: the SaaS a marketing team signed up for with a corporate card, the personal cloud project that holds real customer data, the contractor’s leftover VM, the subdomain pointing at a deprovisioned service (a dangling DNS record, which is a subdomain-takeover waiting to happen when someone re-registers the orphaned target). It exists because shipping is easy and decommissioning is nobody’s job. The attacker loves it precisely because nobody is patching, monitoring, or even remembering it.

PassQuestion it answersPrimary sources / methodsWhy it’s dangerous when missed
Asset discoveryWhat do we own?WHOIS, ASN/IP registrations, cert transparency, cloud inventoriesAn unowned asset is unmonitored and unpatched
Subdomain enum (passive)What hosts already leaked publicly?Certificate transparency, passive DNS, search indexesA cert quietly publishes a host you forgot exists
Subdomain enum (active)What resolves that nobody published?DNS brute-force of common prefixes, zone-transfer teststaging. / admin. often skips production hardening
Shadow ITWhat’s running that no inventory tracks?Dangling DNS, unsanctioned SaaS, orphaned cloud projectsSubdomain takeover; unowned data; the breach’s first foothold
Why this works

Why does the forgotten host get owned so reliably, rather than the flagship app the whole team is watching? Because security attention is finite and follows what’s tracked. The production app gets the WAF, the patch cadence, the on-call alerting, and the pentest budget. The staging box stood up “for a day” gets none of that — no monitoring to notice the intrusion, no patching to close the known CVE, no owner to even receive the alert. The attacker’s expected value isn’t “attack the strongest thing,” it’s “find the exposed thing nobody is defending.” Reducing attack surface is therefore as much about decommissioning and inventory discipline as about hardening — the asset you turned off can’t be exploited, and the asset you can’t see can’t be defended.

Reading the map like a senior

The output of enumeration isn’t a trophy list of hosts — it’s a prioritized picture of exposure. A senior reads it by asking, for each discovered asset: is this supposed to be exposed, who owns it, and is it defended to the standard the data behind it deserves? The dangerous quadrant is “exposed + unowned + undefended,” and shadow IT lives there by definition. The defensive payoff of doing this offensively is that you’re forced to see your estate the way an attacker does — flat, complete, and indifferent to your org chart — instead of the way your architecture diagram flatters you into seeing it.

Enumeration also has a tradeoff axis a senior manages deliberately: passive techniques are quiet, low-risk, and stay off the target, but they only surface what’s already been published somewhere; active techniques find the unpublished hosts but touch the target’s infrastructure and generate noise that can trip detection — which, on an authorized engagement, may be exactly what you want to test, and on a careless one is how you cause an incident.

Pick the best fit

You're mapping the attack surface of an authorized target and want to discover as many real subdomains as possible while staying quiet and within rules of engagement. Pick the best primary approach.

Quiz

Why is the real attack surface almost always larger than the organization's architecture diagram?

Quiz

During authorized enumeration you discover `status.example.com`, which resolves to a third-party vendor's status page that your scope document explicitly excludes. What's the correct move?

Order the steps

Order the attack-surface enumeration pipeline, from seed to authorized target:

  1. 1 Start from a seed (root domain or organization name)
  2. 2 Asset discovery (find owned IP ranges, cloud accounts, sibling domains)
  3. 3 Subdomain enumeration (expand each asset into resolving hosts and services)
  4. 4 Shadow-IT surfacing (find what no inventory tracks)
  5. 5 Scope check (validate each finding is in-bounds before it's a target)
Recall before you leave
  1. 01
    Define attack surface, explain why the real surface is almost always larger than the architecture diagram, and name the three enumeration passes that map it.
  2. 02
    Contrast passive and active subdomain enumeration, and explain the scope discipline that keeps an authorized assessment authorized.
Recap

Attack surface mapping is the discipline of seeing your estate the way an attacker does: flat, complete, and indifferent to your org chart. The attack surface is everything actually reachable — every resolving subdomain, open service, API, cloud bucket, and integration — and it’s almost always larger than the architecture diagram, because the diagram shows intended systems while exposure includes the shadow IT, forgotten staging hosts, dangling DNS, and unsanctioned cloud that nobody tracked. That gap between intended and actual is where breaches live, and the forgotten, undefended host is the one that falls first. You close the gap with three enumeration passes — asset discovery (what we own, via WHOIS, ASN registrations, certificate transparency, and cloud inventories), subdomain enumeration (passive certificate-transparency-first, then scoped active brute-force and zone-transfer tests), and shadow-IT surfacing (the untracked systems where the real findings hide). All of it lives inside an authorized scope: reconnaissance is MITRE ATT&CK tactic TA0043, the techniques apply only to in-scope assets, and a discovered host is a deliverable to validate against scope, not automatically a target. Now when you look at a system, the first question isn’t “is the production app hardened?” — it’s “what am I actually exposing that nobody on the team remembers owning?”

Practice

Start at the top. Tasks go easiest → hardest: recall a fact, apply it to a case, then a senior-level stretch. Open one, attempt it, then reveal.

recallapplystretch0 of 6 done

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

Apply this

Put this lesson to work on a real build.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources2
expand
  1. 01
  2. 02

Trademarks belong to their respective owners. Editorial reference only.