Subdomain Takeover
Subdomain takeover occurs when a subdomain’s DNS record points to an external service that is no longer claimed by the organization. An attacker claims the unclaimed resource and controls what runs on subdomain.target.com.
How It Happens
- Organization sets
blog.target.com CNAME blog-target.herokuapp.com - They migrate away from Heroku, delete the app
- The DNS record is never removed
blog-target.herokuapp.comis now unclaimed- Attacker creates a Heroku app named
blog-targetand controlsblog.target.com
Impact
- Full subdomain control — serve any content at
blog.target.com - Cookie theft — if cookies are scoped to
*.target.com - XSS — JavaScript on
blog.target.comcan access cookies shared with the main domain - Phishing — trusted domain for credential harvesting
- OAuth redirect URI — if
blog.target.comis a whitelisted redirect, use the takeover for OAuth theft
Enumeration
Step 1 — Find all subdomains
|
Step 2 — Resolve all subdomains
|
Step 3 — Find dangling CNAMEs
|
Service-Specific Fingerprints and Takeover Steps
GitHub Pages
Fingerprint: There isn't a GitHub Pages site here.
|
AWS S3
Fingerprint: NoSuchBucket or The specified bucket does not exist
|
Heroku
Fingerprint: No such app or herokucdn.com
|
Azure
Fingerprint: 404 Web Site not found
|
Fastly
Fingerprint: Fastly error: unknown domain
|
Shopify
Fingerprint: Sorry, this shop is currently unavailable.
Tumblr
Fingerprint: There's nothing here.
Ghost
Fingerprint: The thing you were looking for is no longer here
Vulnerable Service Reference
| Service | CNAME Pattern | Fingerprint |
|---|---|---|
| GitHub Pages | *.github.io |
“There isn’t a GitHub Pages site here” |
| S3 | *.s3.amazonaws.com |
“NoSuchBucket” |
| Heroku | *.herokuapp.com |
“No such app” |
| Azure Websites | *.azurewebsites.net |
“404 Web Site not found” |
| Fastly | *.fastly.net |
“Fastly error: unknown domain” |
| Shopify | *.myshopify.com |
“Sorry, this shop is currently unavailable” |
| Tumblr | *.tumblr.com |
“There’s nothing here” |
| WP Engine | *.wpengine.com |
“The site you were looking for” |
| Ghost | *.ghost.io |
“The thing you were looking for is no longer here” |
| Surge.sh | *.surge.sh |
“project not found” |
| Netlify | *.netlify.app |
“Not found” |
NS-Based Subdomain Takeover
If the NS records for a subdomain zone point to nameservers that can be registered:
|
Tools
|
Responsible Disclosure
When you find a subdomain takeover:
- Claim the resource to prevent someone else from doing so.
- Host a benign page proving control (no malicious content).
- Report to the organization with proof.
- Wait for them to fix the DNS record before releasing your claim.
Remediation
- Remove DNS records immediately when deprovisioning cloud resources.
- Regularly audit DNS records against active cloud resources.
- Use a DNS inventory tool to track all CNAMEs and their status.
- Never use externally-controlled naming patterns that could be registered by others.
Discussion
Leave a comment · All fields required · No spam
No comments yet. Be the first.