Hunt subdomain

From elementalsouls/Claude-BugHunter · View interactive version

Hunt subdomain is an AI agent skill from the GitHub repository elementalsouls/Claude-BugHunter. Hunting skill for subdomain takeover vulnerabilities. Includes modern provider fingerprints — Microsoft Azure DevOps `cloudapp.azure.com` regional-pool re-issue (1-click OAuth ATO via wildcard `reply_to`, Binary Security), Zendesk help-desk takeover → email interception → password reset chain (0xpri

How to use this skill

Skill file

Crown Jewel Targets

Subdomain takeover is high-value because it allows an attacker to serve content from a trusted, company-owned domain — bypassing browser same-origin trust, phishing filters, and user skepticism simultaneously.

Highest payout contexts:

Asset types that matter most:


Attack Surface Signals

DNS signals:

HTTP response signals:

Tech stack signals:


Step-by-Step Hunting Methodology

  1. Enumerate all subdomains for the target using passive + active sources:
  1. Resolve all subdomains and flag those with:

```bash

cat subdomains.txt | dnsx -a -cname -o resolved.txt

```

  1. Cross-reference CNAMEs against known vulnerable provider fingerprints using nuclei or subjack:

```bash

subjack -w subdomains.txt -t 100 -timeout 30 -ssl -c fingerprints.json

nuclei -l subdomains.txt -t takeovers/

```

  1. Manual verification for each flagged subdomain:
  1. Confirm claimability — attempt to register the resource:
  1. Claim the resource (only enough to prove control — do NOT serve malicious content):
  1. Document the chain: CNAME record → provider target → unclaimed resource → your content
  1. Assess impact escalation:
  1. Write report before releasing the claim (some programs want to verify first)

Payload & Detection Patterns

Bulk CNAME extraction and NXDOMAIN detection:

# Extract CNAMEs and check if target resolves
while read sub; do
  cname=$(dig +short CNAME "$sub" | head -1)
  if [ -n "$cname" ]; then
    result=$(dig +short A "$cname")
    if [ -z "$result" ]; then
      echo "[POTENTIAL] $sub -> $cname (NXDOMAIN)"
    fi
  fi
done < subdomains.txt

Nuclei takeover scan:

nuclei -l subdomains.txt -t ~/nuclei-templates/http/takeovers/ -severity medium,high,critical

subjack with SSL:

subjack -w subdomains.txt -t 100 -timeout 30 -ssl -c $GOPATH/src/github.com/haccer/subjack/fingerprints.json -v

Provider fingerprint grep patterns:

curl -sk "https://$subdomain" | grep -iE \
  "there isn't a github pages|no such bucket|no such app|this uservoice|fastly error: unknown domain|do you want to register|sorry, this shop|project not found|404 not found|unclaimed"

Check if subdomain is in scope for cookies (shared parent domain):

curl -Isk "https://target.com" | grep -i "set-cookie" | grep "domain=.target.com"

Fastly-specific detection:

curl -sI "https://subdomain.target.com" -H "Host: subdomain.target.com" | grep -i "fastly\|x-served-by\|x-cache"
curl -sk "https://subdomain.target.com" | grep -i "fastly error"

S3 unclaimed bucket check:

aws s3api head-bucket --bucket <extracted-bucket-name> 2>&1 | grep -i "NoSuchBucket\|403\|404"

GitLab Pages specific:

dig CNAME sub.target.com
# If pointing to *.gitlab.io — visit the gitlab.io URL directly
# 404 from gitlab.io project = claimable

Common Root Causes

  1. Service offboarding without DNS cleanup — Developer removes a Heroku app, UserVoice account, or WordPress site but never deletes the CNAME record. DNS lives forever; service does not.
  1. Staging/preview infrastructure abandoned post-launch — course., new., preview., beta. subdomains provisioned for a product launch, pointed at a third-party, then forgotten when the campaign ends.
  1. Subdomain provisioned by a third-party team — Marketing sets up a UserVoice or Zendesk subdomain via IT, product sunset kills it, but DNS is owned by engineering who doesn't know.
  1. CDN misconfiguration without origin validation — Fastly and similar CDNs historically allowed any domain to "claim" a backend hostname by creating a service pointing to it. Unregistered origin hostnames become claimable.
  1. GitHub/GitLab Pages namespace not reserved — Organization renames, user accounts deleted, or repos made private/deleted while the Pages CNAME still points to the old namespace.
  1. Wildcard DNS entries — *.target.com pointing to a cloud provider means any unclaimed subdomain potentially resolves to claimable infrastructure.
  1. Acquired/divested company DNS not cleaned — Post-acquisition, former brand subdomains (like oberlo.com under Shopify) retain CNAMEs to services that are no longer paid for.

Bypass Techniques

Defense: Manual fingerprint review before publishing

Defense: Scope restrictions (only main domain in scope)

Defense: "Can't reproduce" responses due to timing

Defense: HTTPS certificate mismatch blocking proof

Defense: Provider-side validation (Fastly verifying domain ownership)

Defense: Rate limiting on subdomain enumeration

Defense: Program claims "low severity / no impact"


Gate 0 Validation

  1. What can the attacker DO right now?

Can you register the unclaimed resource (GitHub repo, S3 bucket, Heroku app, UserVoice account) and serve arbitrary content — including phishing pages, credential harvesters, or malicious scripts — under the target's trusted domain name?

  1. What does the victim LOSE?

Users lose trust and safety: they see a company-branded URL serving attacker content. The company loses brand integrity, potentially leaks session cookies if the subdomain is in domain=.target.com scope, and may have OAuth/SSO flows hijacked. Depending on CSP configuration, XSS against the main application may be possible.

  1. Can it be reproduced in 10 minutes from scratch?

If you cannot show the provider resource is currently unclaimed and claimable, it is not a valid report.


Real Impact Examples

Scenario A — Trusted Brand Phishing via Abandoned SaaS (Snapchat/UserVoice)

An attacker finds feedback.snapchat.com CNAME pointing to a UserVoice subdomain. The UserVoice account was cancelled but the DNS record remained. The attacker registers the matching UserVoice subdomain for free, gaining control of feedback.snapchat.com. Any user navigating to that URL — perhaps from old bookmarks or Google results — sees attacker-controlled content on a Snapchat-branded domain. Since the domain is trusted by browsers, phishing campaigns sent from this subdomain bypass email security filters that check domain reputation.

Scenario B — CDN Origin Takeover Enabling Same-Origin Attacks (Mozilla/Fastly)

addons-preview-cdn.mozilla.net had a CNAME pointing to a Fastly origin hostname that was no longer registered to Mozilla's Fastly account. An attacker could create a Fastly service claiming that origin hostname, causing all requests to addons-preview-cdn.mozilla.net to be routed to attacker-controlled Fastly infrastructure. Since the subdomain shares the mozilla.net domain, it could be leveraged to serve malicious CDN assets that appear to come from Mozilla's infrastructure, potentially bypassing CSP rules that allowlist *.mozilla.net.

Scenario C — Staging Subdomain Abandoned Post-Product Migration (Rails/GitHub Pages)

new.rubyonrails.org was pointed at a GitHub Pages deployment for a website redesign project. After the new site launched and the old GitHub repo was deleted or made private, the DNS CNAME remained. An attacker could fork or create a matching GitHub Pages repository and claim the namespace, serving content under new.rubyonrails.org. Because this is the official Ruby on Rails domain, any content served there — including fake download links or malicious gems — carries the full trust of the Rails brand.


Disclosed Report Citations (2022-2023)

The following coordinated-disclosure / writeup cases extend this skill with modern provider fingerprints (Vercel/Azure cloudapp/Zendesk era) and explicit ATO-chain examples. Citations #12 and #13 are external writeups (not disclosed HackerOne reports) — treat their payout figures as unverified; only #14 has a public H1 report ID.

  1. Microsoft Azure DevOps — Two cloudapp.azure.com subdomains + wildcard *.visualstudio.com OAuth reply_to → 1-click ATO (Binary Security writeup)
  1. Anonymous H1 — admin-support.xyz.com → unclaimed Zendesk → email interception → ATO (Writeup by 0xprial)
  1. Vercel deleted-project takeover — a dangling cname.vercel-dns.com CNAME pointing to a removed Vercel project can be re-claimed by deploying a new project under that name.

Fastly CDN dangling-service technique (general, not a single disclosed report):


Chains & Compositions (Senior Hunting)

Subdomain takeover by itself is Low-Medium / Informational on most mature programs — defacement of a non-business-critical subdomain is unsexy. The chain payout is 10-100x the standalone. Every takeover should be evaluated against the five chains below before submission. If none apply, you have a Low; if one applies, you have a High; if two compose, you have a Critical.

Chain 1 — Takeover + OAuth `redirect_uri` Whitelist → Auth-Code Theft → 1-Click ATO

Chain 2 — Takeover at Sibling Subdomain + Cookie-Domain Wildcard → Session Fixation on Parent App

Chain 3 — Takeover + CSP `script-src` Includes the Taken-Over Host → Persistent Stored XSS on Main App

Chain 4 — Takeover + CORS `Access-Control-Allow-Origin` Regex Match → Credentialed Cross-Origin API Read

Chain 5 — Takeover at Email DNS (DKIM / SPF / MX) → Email Spoofing → Phishing Trusted by Parent Brand

Operator-level pattern

The five chains above are exhaustive in practice — virtually every senior-tier subdomain-takeover payout maps to one of them. Before reporting any takeover, run through the checklist:

  1. OAuth redirect_uri allowlist — does the taken-over host appear? → Chain 1, Critical.
  2. Parent-domain cookies — does the main app set Domain=.target.com? → Chain 2, High.
  3. CSP script-src — does the taken-over host appear in the allowlist? → Chain 3, Critical.
  4. CORS allowlist — does any regex match the taken-over host? → Chain 4, High.
  5. Email DNS (DKIM selector / SPF include) — does the taken-over host appear? → Chain 5, High.

If none apply, file at Low/Informational. Do not file at Critical without demonstrating one of these chains — triagers downgrade fast otherwise.

Cross-references:


Related Skills & Chains

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.