What an attack surface is
An attack surface is everything an attacker can touch. Every hostname that resolves, every port that answers, every API route, every form field, every storage bucket with a public policy and every employee who can be phished is one point on it.
Two properties matter: size and visibility. A large surface gives an attacker more places to look for a single mistake. An unknown surface is worse, because nobody patches, monitors or tests a system that is missing from the inventory. A forgotten staging server often causes more damage than a busy production API, simply because the production API has an owner.
The parts of an attack surface
Teams usually split the surface by where the attacker stands and what they interact with.
| Part | What it contains | Typical way in |
|---|---|---|
| External digital | Public websites, APIs, DNS records, VPN and mail gateways, exposed storage | A software flaw, a misconfiguration, a leaked credential |
| Internal digital | File shares, databases, directory services, admin panels, build servers | Movement after a first foothold |
| Third party | SaaS integrations, vendors with access, open source dependencies | A compromise somewhere upstream |
| Human | Support desk, staff inboxes, engineers with production access | Phishing and pretexting |
| Physical | Offices, network ports, laptops, badge readers | Walking in or stealing a device |
The parts connect. A phished engineer turns the human surface into a path onto the internal one. That is why internal and external penetration tests are scoped separately: each measures a different starting position.
How it differs from an attack vector
The surface is the list of places to attack. A vector is the method used at one of them.
A public login page is one place on the surface. Password spraying, SQL injection in the username field and a stolen session cookie are three vectors against it. Shrinking the surface removes the place. Fixing a vulnerability removes one vector and leaves the place exposed.
How an attack surface gets mapped
Mapping starts from something you know you own, usually a root domain or a cloud account, and expands outward.
- Find names. Certificate Transparency logs, DNS records and subdomain guessing reveal hostnames.
- Find what answers. Resolve each name, scan the addresses for open ports and identify the software behind each one.
- Read the cloud inventory. Provider APIs list load balancers, buckets, functions and public IPs that never got a DNS name.
- Read the application. Crawling, JavaScript bundles and API specifications reveal routes, including shadow APIs that no document mentions.
The result for one domain might look like this:
shop.acme.test 203.0.113.10 443 storefront in inventory
api.acme.test 203.0.113.11 443 REST API v3 in inventory
api-v1.acme.test 203.0.113.11 443 REST API v1, no auth NOT IN INVENTORY
staging.acme.test 203.0.113.40 8080 admin console NOT IN INVENTORY
promo.acme.test CNAME to a deleted hosting account NOT IN INVENTORYThe last three lines are the valuable ones. Nobody is watching them, and the dangling record is a candidate for subdomain takeover.
The surface changes with every deploy, DNS edit and new vendor, so a one-time map goes stale within weeks. Keeping it current is the job of attack surface management. Hydra maps forgotten hosts and subdomains as part of its recon, on targets whose ownership is verified first, and then tests what it finds.
How to reduce it
Reduction means removing points or making them harder to reach.
- Delete what is unused. Old API versions, test environments, stale DNS records and abandoned cloud projects.
- Move admin tools off the internet. Put consoles and dashboards behind a VPN or an identity-aware proxy.
- Deny by default. Firewall rules and security groups should open specific ports to specific sources.
- Name an owner for every asset. Unowned systems do not get patched.
- Limit what each point can do. Least-privilege credentials mean a compromised service exposes less.
A small surface is not automatically a safe one. One exposed API with a broken authorization check can leak every customer record, so the points you keep still need testing.