OSINT & Recon

What Is Subdomain Takeover? Definition, Architecture & Defense

Quick Definition: Subdomain takeover occurs when a subdomain (such as promo.example.com) has a dangling DNS CNAME or A record pointing to an external cloud resource (S3 bucket, GitHub Pages, Azure App) that has been deleted or unclaimed, allowing an attacker to register that cloud resource and serve content under the organization legitimate subdomain.

How Subdomain Takeover Works in Practice

After a marketing campaign ends, a team deletes their GitHub Pages repo or AWS S3 bucket but forgets to delete the DNS CNAME record promo.example.com -> example-promo.github.io. An attacker enumerates subdomains, spots the "There isn't a GitHub Pages site here" fingerprint, claims the external project name, and now controls promo.example.com—inheriting cookie scope, CORS trust, and brand credibility.

Defensive Mitigation & Hardening Checklist

Remove DNS records BEFORE deprovisioning external cloud resources, audit DNS zones continuously for dangling CNAMEs, and use __Host- prefixes on session cookies so subdomains cannot read or set parent cookies.

Hands-On Tool & Cheat Sheet


Related Security Glossary Terms