Detection and safe proof of subdomain takeover via dangling CNAME/A/NS records pointing to unclaimed cloud services, using provider fingerprints, NXDOMAIN/SERVFAIL signals and nuclei takeover templates. Tier 1. Use when recon finds CNAMEs to third-party services or unresolving records.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Subdomain Takeover?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-subdomain-takeover)
---
name: subdomain-takeover
description: Detection and safe proof of subdomain takeover via dangling CNAME/A/NS records pointing to unclaimed cloud services, using provider fingerprints, NXDOMAIN/SERVFAIL signals and nuclei takeover templates. Tier 1. Use when recon finds CNAMEs to third-party services or unresolving records.
---
# Subdomain Takeover (dangling DNS)
A subdomain that still points to a deprovisioned service lets an attacker claim that resource and serve content on the victim's hostname (cookie theft, phishing, OAuth/CSP abuse).
## Trigger phrases
`subdomain takeover, dangling cname, dangling dns, nxdomain takeover, can i take over xyz, subzy, baddns, ns takeover`
## Method
1. Pull all records for every subdomain: `dnsx -a -cname -resp -l subs.txt` (A/AAAA/CNAME/NS/MX). Flag CNAMEs to third-party providers and records that fail to resolve.
2. Fingerprint the target of each dangling CNAME against known patterns (`can-i-take-over-xyz`): S3 "NoSuchBucket", GitHub Pages "There isn't a GitHub Pages site here", Heroku "No such app", Azure "Web App not found", Fastly, Shopify, Zendesk, Readthedocs, Surge, Netlify, Cargo, etc.
3. Automated sweep: `nuclei -t http/takeovers/ -l subs.txt`; `subzy run --targets subs.txt`; `baddns -t ALL sub.target.com` (also catches NS/MX/signature cases).
4. **NXDOMAIN tell**: CNAME resolves to a provider hostname that returns NXDOMAIN → service deleted, often claimable.
5. **NS-record / zone takeover (RARE, higher impact)**: on `SERVFAIL`/`REFUSED`, `dig +trace sub.target.com` to see authoritative NS; query each NS directly — if one returns `NOERROR` it's served, if the hosted zone was deleted at the provider the zone may be recreatable (DO, GCP, Linode, NS1, Yahoo SBS historically). Full zone control = forge any subdomain/mail.
6. Safe PoC: register/claim the resource and host a harmless marker file (`/zazy-poc-<rand>.txt`) — do NOT serve content that could phish or capture; or, where ToS forbids claiming, document the exact claimable name + provider fingerprint as proof.
## Modern / rare techniques
- **Dangling A → released elastic IP**: A record to a cloud IP you can re-request on the same provider.
- **baddns signature+NS modes** catch cases `can-i-take-over-xyz` misses.
- **Second-order**: takeover a subdomain referenced in a victim's JS/CSP/`crossdomain.xml` to pivot into the main app → see `broken-link-hijack`.
## Escalation / chaining
Owned subdomain → cookie scoping/`cookie-tossing` session attacks, OAuth `redirect_uri`/CSP whitelist abuse (`oauth`), stored content for `stored-xss` on parent trust. Feeds `broken-link-hijack`.
## Backend & tooling
Kali/HexStrike (dnsx/nuclei/subzy/baddns/dig). Provider CLI only to register the claim within RoE.
## Verification (background, before reporting)
Re-resolve from a second vantage/resolver to rule out caching/geo; confirm the provider actually serves the claimed resource (fetch your marker). Use OAST only to prove reachability, never user-facing content.
## Evidence
Subdomain, record type + target, provider fingerprint, proof of claim (marker file) or exact claimable name, impact + remediation (remove dangling record top-down: DNS → zone → asset).