Bug Bounty Course -- Day 37 of 60
62%

Subdomain Takeover Bug Bounty 2026 — Full Exploitation Guide | Bug Bounty Course Day 37 of 60

Subdomain Takeover Bug Bounty 2026 — Full Exploitation Guide | Bug Bounty Course Day 37 of 60
✨ AI Summary
💰 BUG BOUNTY HUNTER
FREE

Part of the Bug Bounty 60-Day Course

Day 37 of 60 · 62% complete

A subdomain takeover is the finding that makes a company’s own hostname serve your content. Someone on the team spun up a marketing site on GitHub Pages, pointed promo.target.com at it with a CNAME, and later deleted the repo — but never deleted the DNS record. That record now dangles, pointing at a GitHub Pages site that doesn’t exist. You visit it, see GitHub’s “There isn’t a GitHub Pages site here” page, create a repo with the matching name, and suddenly promo.target.com is serving a page you control. On a bare marketing subdomain that’s a Medium. On a subdomain that shares cookies with the parent domain, or that sits in an OAuth redirect allowlist, it’s a Critical — session theft and convincing phishing on a hostname the victim trusts completely. The whole class comes down to one forgotten DNS record, and most of the work is recon.

🎯 What you’ll master in Day 37

Understand how a dangling CNAME becomes a takeover primitive
Enumerate subdomains with passive and active sources
Resolve CNAME chains and spot third-party service pointers
Fingerprint vulnerable services with can-i-take-over-xyz
Confirm claimability and claim a resource with a harmless proof
Rate severity by the trust the subdomain carries and write the report

⏱ ~30 min read · 3 hands-on exercises · subfinder + dnsx + nuclei + can-i-take-over-xyz

Before you start you’ll want: a working recon setup from earlier in the course, the ProjectDiscovery tools installed (subfinder, dnsx, httpx, nuclei), and basic comfort with DNS record types (A, AAAA, CNAME, NS). No Burp needed for most of this one — subdomain takeover is a DNS and HTTP recon finding, not a request-manipulation finding.

What a subdomain takeover is

A subdomain takeover occurs when a subdomain points — via DNS — to a third-party service resource that no longer exists, and an attacker can register that resource themselves. The classic form is a dangling CNAME: blog.target.com has a CNAME record pointing to target.github.io, but the GitHub Pages repository that used to live there was deleted. The DNS record still exists and still points to GitHub’s infrastructure, but there is no site behind it. GitHub serves its default “no site here” page. Anyone who creates a GitHub repository with the right name, enables Pages, and sets the custom domain to blog.target.com now controls what GitHub serves for that hostname.

The reason this is dangerous is trust. The browser, other servers, and users all treat blog.target.com as belonging to the company — because it does, at the DNS level. Cookies scoped to .target.com are sent to it. OAuth providers may have it in a redirect allowlist. Content Security Policies may trust it as a script source. A phishing page on blog.target.com is far more convincing than one on a random domain, because the hostname is genuinely the company’s. The takeover converts a forgotten DNS entry into control of a trusted hostname.

Not every third-party pointer is vulnerable. Many providers verify domain ownership before letting you attach a custom domain, which closes the takeover. The vulnerable services are the ones that let you claim a resource name and attach a custom domain without proving you own that domain. The community keeps a living catalog of which services are and aren’t vulnerable.

🧠 EXERCISE 1 — THINK LIKE A HACKER (10 MIN · NO TOOLS)

Reason about the takeover primitive before touching tools:

  1. shop.target.com has a CNAME to target-shop.myshopify.com, and visiting it shows Shopify’s “Sorry, this shop is currently unavailable” page. cdn.target.com has a CNAME to d1a2b3c4.cloudfront.net and returns a generic CloudFront error. Which one is more likely to be a true takeover, and what additional fact would you need to confirm each?
  2. Two subdomains both point at deleted GitHub Pages sites. One is status.target.com and the other is login-assets.target.com, where the parent app sets cookies on .target.com. If you could take over only one, which has the higher impact, and why does the cookie scope matter?
  3. A subdomain returns NXDOMAIN (it doesn’t resolve at all) but its parent domain’s zone still has an NS delegation for it pointing to a nameserver at a provider where you can register zones. Why might this also be a takeover, even though there’s no dangling CNAME?
✅ What you just learned: a service fingerprint is a candidate, not a confirmation — you must verify the backing resource is claimable. CloudFront, for instance, is usually not takeover-able because distributions verify the alternate domain name. Impact is driven by trust: a subdomain sharing cookies or sitting in an OAuth/CSP allowlist is Critical-class. And takeovers aren’t only CNAMEs — dangling NS delegations and dangling A records pointing at reclaimable cloud IPs are takeovers too.
📸 Write your answers for #day-37-subdomain-takeover before continuing.


Enumerating subdomains

Subdomain takeover is a numbers game. The vulnerable subdomain is almost always a forgotten one — decommissioned, migrated, or spun up for a one-off campaign and abandoned. The bigger and more complete your subdomain list, the more likely you surface the orphan. Combine passive sources (certificate transparency logs, DNS aggregators) with active brute force against a good wordlist and resolver list.

SUBDOMAIN ENUMERATION PIPELINE
# PASSIVE: certificate transparency + aggregators
subfinder -d target.com -all -silent -o subs_passive.txt
# crt.sh directly (certificate transparency)
curl -s “https://crt.sh/?q=%25.target.com&output=json” | jq -r ‘.[].name_value’ | sed ‘s/\*\.//g’ | sort -u >> subs_passive.txt
# ACTIVE: brute force with a resolver list
puredns bruteforce subdomains-top1m.txt target.com -r resolvers.txt -w subs_brute.txt
# MERGE and de-duplicate
cat subs_passive.txt subs_brute.txt | sort -u > subs_all.txt
wc -l subs_all.txt
# The more complete the list, the better your odds of finding the orphan

💡 Historical data is gold for takeovers: passive sources that include old records (crt.sh certificates from years ago, Wayback/OTX hostnames) are especially valuable here, because a takeover-able subdomain is by definition one that was retired. A hostname that appears only in historical data and no longer serves real content is exactly the orphan you’re hunting.

Resolving CNAME chains

Once you have the full list, resolve every subdomain and capture its CNAME target. You’re looking for subdomains whose CNAME points at a third-party service — the giveaways are hostnames ending in .github.io, .s3.amazonaws.com, .herokudns.com, .azurewebsites.net, .trafficmanager.net, .fastly.net, .myshopify.com, .zendesk.com, and similar. A subdomain whose CNAME chain ends at a provider but whose HTTP response says “no such resource” is your candidate.

RESOLVE AND CAPTURE CNAME TARGETS
# Resolve all subdomains, keep the CNAME chain
dnsx -l subs_all.txt -cname -resp -silent -o resolved.txt
# Output lines look like:
promo.target.com [CNAME] [target.github.io]
files.target.com [CNAME] [target-files.s3.amazonaws.com]
help.target.com [CNAME] [target.zendesk.com]
# Filter for third-party service pointers worth checking
grep -Ei ‘github\.io|s3\.amazonaws|herokudns|herokuapp|azurewebsites|trafficmanager|cloudapp|fastly|myshopify|zendesk|readme\.io|wordpress\.com|surge\.sh|bitbucket\.io|ghost\.io’ resolved.txt
# Also flag subdomains that return NXDOMAIN but still have a zone delegation
dnsx -l subs_all.txt -rcode nxdomain -silent


Fingerprinting vulnerable services

For each candidate, fetch the subdomain over HTTP and HTTPS and compare the response body to the provider’s known “unclaimed resource” fingerprint. Each vulnerable service has a signature string it serves when a custom domain points at it but no resource is attached. The authoritative, community-maintained catalog of these fingerprints — and whether each service is currently exploitable — is the can-i-take-over-xyz project. nuclei ships a takeover template set built from the same data, so you can automate the first pass.

FINGERPRINT WITH NUCLEI + MANUAL CONFIRMATION
# Probe which candidates are live over HTTP/HTTPS first
httpx -l candidates.txt -silent -status-code -title -o live.txt
# Run the nuclei takeover templates
nuclei -l candidates.txt -t http/takeovers/ -o takeover-hits.txt
# Manually confirm the fingerprint — example for GitHub Pages
curl -s https://promo.target.com | grep -i “There isn’t a GitHub Pages site here”
# Known fingerprint examples (verify against can-i-take-over-xyz)
GitHub Pages : “There isn’t a GitHub Pages site here.”
AWS S3 : “The specified bucket does not exist”
Heroku : “No such app” / “herokucdn.com/error-pages/no-such-app.html”
Shopify : “Sorry, this shop is currently unavailable”
Fastly : “Fastly error: unknown domain”
Zendesk : “Help Center Closed” (check current status — often NOT exploitable)
# ALWAYS check the service’s current status in can-i-take-over-xyz
# https://github.com/EdOverflow/can-i-take-over-xyz

securityelites.com
Terminal — dangling CNAME with GitHub Pages fingerprint
$ dig +short promo.target.com
target-org.github.io.

$ curl -s https://promo.target.com | grep -i github
"There isn't a GitHub Pages site here."

# CNAME points at an unclaimed github.io project = takeover
# cross-check the fingerprint against can-i-take-over-xyz

📸 The CNAME still resolves to GitHub Pages but no project claims it — the "There isn't a GitHub Pages site here" string is the claimable fingerprint. Confirm against can-i-take-over-xyz before reporting.

💡 Fingerprint matches go stale fast. Providers change their error pages and sometimes close the takeover entirely (Zendesk, for example, changed its behavior and many old fingerprints are now false positives). Treat a fingerprint as a lead, not a confirmation. The next step — verifying the resource is actually claimable — is what separates a real finding from a noise report that gets closed as Informational.

Confirming claimability and claiming safely

This is the step that makes or breaks the report. A fingerprint tells you the subdomain points at an empty slot on a provider; it does not tell you that slot is available to you. You must verify the backing resource can actually be registered. For S3, check whether the bucket name is free. For GitHub Pages, check whether a repo/org with that name can be created. For Heroku, check whether the app name is unregistered. Only a resource you can genuinely claim is a true takeover.

When you claim it, keep the proof minimal and harmless. The goal is to demonstrate that you control what the subdomain serves — nothing more. A single text file with your handle and the date is ideal. Never serve a login form, never collect any data, never run JavaScript, never impersonate the brand’s look and feel. Those actions turn a clean security finding into something that could harm real users and could put you outside the programme’s safe harbor.

CONFIRM CLAIMABILITY AND SERVE A HARMLESS PROOF
# S3: is the bucket name free? (404 NoSuchBucket on the bucket endpoint)
curl -s -o /dev/null -w “%{http_code}” https://target-files.s3.amazonaws.com/
# If NoSuchBucket, try creating a bucket with that exact name in your own account
aws s3 mb s3://target-files
# Then enable static website hosting and upload a single proof file
echo “subdomain takeover PoC – mr-elite – 2026-10-18 – reported to target BBP” > bugbounty-poc.txt
aws s3 cp bugbounty-poc.txt s3://target-files/bugbounty-poc.txt
# GitHub Pages: create a repo, enable Pages, set custom domain = victim subdomain
# Commit a single file: bugbounty-poc.txt (handle + date only)
# CONFIRM the proof is served ON THE VICTIM SUBDOMAIN
curl -s https://promo.target.com/bugbounty-poc.txt
# subdomain takeover PoC – mr-elite – 2026-10-18 – reported to target BBP
# DO: serve one harmless text file. DO NOT: impersonate, collect data, run JS.
# RELEASE the resource as soon as the programme confirms the finding.

⚡ EXERCISE 2 — TOOLING LAB (25 MIN)

Build and run the full takeover pipeline against a domain you are authorised to test (your own domain, a dedicated lab domain, or an in-scope program asset):

  1. Run subfinder + a crt.sh pull + puredns brute force and merge into a single de-duplicated list. Record how many unique subdomains you found from each source.
  2. Resolve the list with dnsx -cname -resp and grep for third-party service pointers. For each hit, fetch it with httpx and note the status code and title.
  3. Run the nuclei takeover templates over the candidates. For any hit, open the can-i-take-over-xyz entry for that service and confirm whether it is currently exploitable and what the claimability steps are. Do not claim anything you are not authorised to claim.
  4. Set up a safe practice takeover on a domain you own: point a test subdomain’s CNAME at a GitHub Pages site, delete the repo, confirm the fingerprint appears, then re-claim it with a harmless proof file. This gives you the end-to-end muscle memory without touching anyone else’s assets.
✅ What you just learned: the pipeline is enumerate → resolve → fingerprint → confirm claimability → claim with harmless proof. The automation (nuclei) finds candidates fast, but the human steps — checking can-i-take-over-xyz for current exploitability and verifying the resource is genuinely claimable — are what turn a candidate into a valid, non-false-positive report.
📸 Share a screenshot of your safe self-owned takeover proof for #day-37-subdomain-takeover.


Rating severity by trust

Two takeovers of identical technical difficulty can have wildly different severity. The driver is the trust the subdomain carries. Ask: do cookies get scoped to the parent domain and therefore sent to this subdomain? Is the subdomain in any OAuth redirect allowlist? Is it trusted as a script or frame source in a Content Security Policy? Is it used in any authentication or SSO flow? Each “yes” escalates the finding, because control of the subdomain now lets you steal sessions, complete OAuth flows, or inject trusted scripts — not just host a page.

SEVERITY DECISION TABLE
# CRITICAL — the subdomain carries authentication trust
Cookies scoped to .target.com are sent to the subdomain (session theft)
Subdomain is in an OAuth redirect_uri allowlist (token theft – see Day 32)
Subdomain is a trusted script-src in the parent app’s CSP (stored-XSS-like)
Subdomain is used in SSO / SAML / auth callback flows
# HIGH — strong phishing / trust abuse, no direct session theft
Subdomain is user-facing and brand-trusted (login.target.com style naming)
Subdomain is referenced in emails or docs users are told to trust
# MEDIUM — isolated, no trust relationship
Unused marketing subdomain, no shared cookies, no allowlist membership
Internal-only naming with no external trust
# Prove the trust relationship in the report – do not just assert it


Writing the report that pays

A subdomain takeover report is reproducible in seconds if you give the triager the three facts: the dangling record, the fingerprint, and the proof URL on the victim subdomain. Then make the impact case explicit by naming the trust relationship — don’t make the reviewer guess whether cookies are shared. Lead with the proof URL, because one curl confirms the whole finding.

BUG BOUNTY REPORT TEMPLATE — SUBDOMAIN TAKEOVER
Title: Subdomain Takeover of promo.target.com via Dangling CNAME to Unclaimed GitHub Pages — High

Severity: High (CVSS 8.1) — attacker controls content served on a brand-owned subdomain; escalates to Critical if cookies are shared (see impact)
Affected Host: promo.target.com

Summary: promo.target.com has a dangling CNAME record pointing to target.github.io. The backing GitHub Pages repository has been deleted, so GitHub serves its “There isn’t a GitHub Pages site here” page. The repository name is unclaimed, allowing any GitHub user to create it, attach promo.target.com as a custom domain, and control all content served on the subdomain.

Steps to Reproduce:
1. dig promo.target.com → CNAME target.github.io
2. curl https://promo.target.com → “There isn’t a GitHub Pages site here.” (unclaimed fingerprint)
3. Verified the backing repo is unregistered and claimable
4. Created a GitHub Pages repo, set custom domain = promo.target.com, committed a single harmless file
5. Confirmed: curl https://promo.target.com/bugbounty-poc.txt returns my proof string
[Proof URL and screenshot attached; resource will be released on your confirmation]

Impact: An attacker controls all content on promo.target.com, a hostname browsers and users treat as belonging to target.com. This enables highly convincing phishing on a trusted hostname. Critical escalation: the parent application sets session cookies scoped to .target.com [evidence attached], which are therefore transmitted to promo.target.com. An attacker-controlled page on the subdomain can read those cookies, enabling session hijacking of any user who visits the attacker’s page while authenticated.

Remediation: Remove the dangling CNAME record for promo.target.com from DNS, or re-provision the GitHub Pages resource under the organization’s control. As a systemic fix, add a DNS hygiene check to decommissioning runbooks: whenever a third-party-hosted resource is deleted, delete its DNS record in the same change. Periodically scan all CNAMEs for dangling third-party pointers.

⚡ EXERCISE 3 — WRITE THE REPORT (15 MIN)

Turn your safe self-owned takeover (from Exercise 2) into a full report:

  1. Write the report using the template above. Use your actual dig output, the actual fingerprint string, and your actual proof URL. Make the PoC one copy-paste curl for the triager.
  2. Write two versions of the Impact section: one for a bare marketing subdomain (Medium) and one for a subdomain that shares cookies with the parent (Critical). For the Critical version, describe exactly what evidence you would attach to prove the cookie scope.
  3. Write the systemic remediation — not just “delete this record” but the process change that prevents the whole class: tying DNS record deletion to resource decommissioning. Triagers reward hunters who fix the class, not just the instance.
✅ What you just learned: the report lives and dies on the proof URL and the trust argument. The dangling record plus the fingerprint plus a proof file on the victim subdomain is airtight evidence. The severity — and the payout — comes from how well you prove the trust relationship (shared cookies, OAuth allowlist, CSP) rather than the takeover itself.
📸 Share your takeover report’s Impact section for #day-37-subdomain-takeover.

💰 Quick check: you find cdn.target.com with a CNAME to a CloudFront distribution that returns a generic CloudFront error page. The nuclei takeover template flagged it. What should you do before reporting?




📋 Day 37 reference card

Dangling CNAMEDNS record pointing at a third-party resource that no longer exists — the takeover primitive
subfinder / crt.sh / purednsPassive + active subdomain enumeration — a bigger list finds more orphans
dnsx -cname -respResolve subdomains and capture CNAME targets to spot third-party pointers
nuclei -t http/takeovers/Automated first-pass fingerprinting of vulnerable services
can-i-take-over-xyzAuthoritative catalog of which services are exploitable + claim steps
Confirm claimabilityA fingerprint is a candidate; a claimable resource is the confirmation
Severity = trust carriedShared cookies / OAuth allowlist / CSP source escalate Medium to Critical

✅ Mark Day 37 complete

You can enumerate a target’s full subdomain surface, resolve CNAME chains, fingerprint vulnerable services, confirm claimability, claim a resource with a harmless proof, and write a report whose severity is driven by a proven trust relationship.

Tomorrow — Day 38: XXE injection — abusing XML parsers to read local files, perform SSRF, and exfiltrate data out-of-band.

❓ Frequently asked questions

What is a subdomain takeover?
A subdomain takeover happens when a subdomain’s DNS record points to a third-party service resource that no longer exists — a deleted S3 bucket, a removed GitHub Pages site, a decommissioned Heroku app. Because the record still points there, anyone who can register that resource controls what is served on the victim’s subdomain. It turns a forgotten DNS entry into control of a brand-owned hostname.
What is a dangling CNAME record?
A dangling (orphaned) CNAME is a DNS CNAME record that still points at a target host whose backing resource has been removed. For example, blog.example.com has a CNAME to example.github.io but the Pages repo was deleted. The CNAME “dangles” because it points at nothing live. That dangling pointer is the takeover primitive.
How do I confirm a subdomain is actually takeover-able?
Two things must both be true: the subdomain resolves to a third-party service returning its “no such resource” fingerprint, AND the backing resource is actually claimable (bucket name free, app name unregistered, repo creatable). A fingerprint without a claimable resource is a false positive. Verify claimability before reporting, and claim with a harmless proof to demonstrate exploitability.
Which services are most commonly vulnerable?
Classic vulnerable services include AWS S3, GitHub Pages, Heroku, Azure (cloudapp/trafficmanager), Fastly, Shopify, Zendesk, Tumblr, WordPress.com, Readme.io, Surge.sh, and more. The community-maintained can-i-take-over-xyz repository is the authoritative catalog of which services are vulnerable, their fingerprints, and current exploitability — always check it, because providers change behavior and close takeovers over time.
What severity does a subdomain takeover get?
It depends on the subdomain’s role. A takeover of a subdomain used for authentication, that shares cookies scoped to the parent domain, or that sits in an OAuth redirect allowlist can rate Critical — it enables session hijacking and convincing phishing on a trusted hostname. A takeover of an unused marketing subdomain with no trust relationship may rate Medium. The trust the subdomain carries drives the rating.
Is claiming the resource legal in a bug bounty?
Claiming the unregistered resource to prove the takeover is standard on most programmes, but do it responsibly: serve only a harmless proof file, never impersonate the brand, never collect data or run scripts, and release the resource as soon as the programme confirms. Always check the programme’s policy — some ask you to report the dangling record without claiming. When in doubt, report the fingerprint and ask before claiming.
← Previous
Day 36: Race Conditions
Next →
Day 38: XXE Injection

📚 Further reading

ME
Mr Elite
My most memorable takeover wasn’t technically hard — it was the recon that found it. I’d pulled six years of certificate transparency data for a target and noticed a subdomain, events-2019.target.com, that appeared in a certificate from years ago and nowhere else. It resolved to a deleted S3 bucket. On its own, a stale events subdomain is a Medium. But when I checked the parent app, it set its session cookie on .target.com — so that cookie was being sent to my bucket the moment I claimed it. I served a single text file as proof, documented the cookie scope with a screenshot of the Set-Cookie header, and the Medium became a Critical. The lesson that stuck: the takeover is easy, the recon finds it, but the impact is won or lost on whether you bother to prove what trust the subdomain carries. Always check the cookie scope. Always check the OAuth allowlist. That’s where the bounty lives.

⚡
Join free to earn XP for reading this article Track your progress, build streaks and compete on the leaderboard.
Join Free
Lokesh N. Singh aka Mr Elite
Lokesh N. Singh aka Mr Elite
Founder, Securityelites · AI Red Team Educator
Founder of Securityelites and creator of the SE-ARTCP credential. Working penetration tester focused on AI red team, prompt injection research, and LLM security education.
About Lokesh ->

Leave a Comment

Your email address will not be published. Required fields are marked *