/security-agent-skills:hunting-subdomain-takeover-and-dangling-dnsfrom security-agent-skills
Hunts DNS records pointing to decommissioned infrastructure that attackers can claim. Covers CNAME/ALIAS to re-registrable hosts, dangling NS delegations, orphaned records from IaC teardown, and unclaimed virtual hosts.
Ships in security-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A subdomain takeover is not a source-code bug, which is exactly why source-focused reviews miss it. It is a bug in DNS state: a record still resolves, but the thing it points at is gone, and the shared provider will hand that target to whoever asks next. When an attacker claims it, they serve content on your trusted origin, with a real certificate, inheriting parent-domain cookies, allowlist and content-policy trust, and OAuth redirect standing. You hunt it by inventorying the records, resolving each target, and asking one question per record: is the target still owned, and if not, can an attacker claim it. The discipline is separating a record that merely returns a 404 from one whose target is genuinely re-registrable, because only the second is a takeover.
Enumerate and fingerprint only domains you own or are authorized to assess, and never register or claim a target you do not own outside an authorized engagement, claiming it is the point of no return and can hijack live traffic. Demonstrate claimability by fingerprint, not by seizing the name. If you can't name the authorization, stop.
Inventory the records and resolve every target. Collect the CNAME, ALIAS, NS, and wildcard records from the zone and from any infrastructure-as-code that declares them, and resolve each to the host or service it points at. The record set is the surface; a record whose target no longer answers, or answers as unrecognized, is the lead.
Fingerprint the target's claim state. For each dangling-looking target, read the response the provider returns. A takeover needs two things together: a provider fingerprint that says the host is unclaimed (an unrecognized-domain page, a no-such-bucket error, a default landing that invites registration) and a provider that permits open re-registration of that name. One without the other is not a takeover.
Check for dangling delegation. An NS record that delegates a subdomain to a nameserver or hosted zone that no longer exists in the account hands the entire subtree to whoever can create that zone. Delegation takeovers are more severe than a single CNAME because they capture every name beneath the delegated label.
Trace the provisioning and teardown pipelines. Look for the record that outlives its resource: a name declared in one infrastructure-as-code state while the resource it targets was removed from another, and a teardown pipeline that deletes the cloud resource but leaves the DNS record to a separate, manual, or later step. Ordering that frees the resource before the record creates a dangling name on every teardown, by design.
Check wildcards and unclaimed virtual hosts. A wildcard record that resolves every label to a shared ingress routing by host header lets an attacker present an unclaimed host that a default or attacker-reachable backend serves. Enumerate which labels are actually bound and which fall through.
Confirm and record. Confirm by matching the provider's unclaimed fingerprint and verifying the provider allows re-registration of that exact name, without seizing it. Kill the lead if the target is still owned by a live resource in another account or region despite the 404, if the provider verifies ownership or scopes the name to the original account so it cannot be re-registered, if the record is NXDOMAIN with no delegation and no wildcard behind it (a dead record, not a dangling one), if the name resolves only inside a private or split-horizon zone unreachable from the attacker's position, or if the resource is intentionally managed out of band and still owned. Record the record, the target, the provider fingerprint, and the claim path.
Confirm. A subdomain CNAMEs to a platform-as-a-service host whose application slug was decommissioned; the host now returns the provider's unrecognized-application page, and the provider lets any account register that slug. Registering it (in an authorized test) would serve attacker content on the trusted subdomain with a valid certificate. Confirmed subdomain takeover via a dangling CNAME to a re-registrable platform host,
highrising tocriticalwhere the parent domain shares cookies or an allowlist, remediation = remove the dangling record, and reorder teardown so the record is deleted before or with the resource.Kill. A subdomain CNAMEs to a storage host that returns a no-such-bucket 404, but the bucket name is still reserved by the organization in another region and the provider scopes bucket names globally so no other account can register it. The record resolves, the target 404s, but the name cannot be claimed. Killed,
kill_reason= "target returns 404 but the name is account-reserved and the provider forbids re-registration by any other account, so there is no claim path."
You need the zone records and the DNS declared in infrastructure-as-code, the resolved target of each record, the provider fingerprint for any target that no longer answers as owned, the provider's rules on re-registering that name, and the provisioning and teardown pipelines that create and remove the records. For each dangling target, decide whether an attacker can claim it. Resolving the record tells you it is dangling; the provider fingerprint and its registration rules tell you whether it is takeoverable.
mapping-attack-surface - the recon that inventories the DNS surface this hunt adjudicates; surface
discovery finds the records, this skill decides which are claimable.auditing-session-lifecycle-and-fixation - its broad-cookie-domain shape hands off here: a session
cookie scoped to a parent domain is capturable once a sibling subdomain is taken over.auditing-cors-and-cross-origin-trust - a taken-over subdomain becomes a trusted origin, so the two
weaknesses compound where an allowlist trusts sibling subdomains.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
subdomain-takeover, dangling-dns, dns-security, attack-surface
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive.Other plugins' skills for the same job