Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

subdomain-takeover子域名接管

Agent Skill

subdomain-takeover 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,561

周安装

268

GitHub Stars

349

下载量

2,101
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:subdomain-takeover(子域名接管)
来源仓库:https://github.com/yaklang/hack-skills
仓库路径:skills/subdomain-takeover
安装命令:
npx skills add https://github.com/yaklang/hack-skills --skill subdomain-takeover
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yaklang/hack-skills --skill subdomain-takeover

简介

subdomain-takeover 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

SKILL: Subdomain Takeover — Detection & Exploitation Playbook

AI LOAD INSTRUCTION: Covers CNAME/NS/MX takeover, per-provider fingerprint matching, claim procedures, and defensive monitoring. Base models often confuse "CNAME exists" with "takeover possible" — the key is whether the *resource behind the CNAME is unclaimed and claimable*.

0. RELATED ROUTING


1. CORE CONCEPT

Subdomain takeover occurs when:

  1. sub.target.com has a DNS record (CNAME, NS, A) pointing to an external service
  2. The external resource is no longer provisioned (deleted S3 bucket, removed Heroku app, etc.)
  3. The attacker can register/claim that exact resource name on the provider
  4. The attacker now controls content served under sub.target.com

Impact: cookie theft (parent domain cookies), OAuth token interception, phishing under trusted domain, CORS bypass, CSP bypass via whitelisted subdomain.


2. DETECTION METHODOLOGY

2.1 CNAME Enumeration

1. Collect subdomains (amass, subfinder, assetfinder, crt.sh, SecurityTrails)
2. Resolve DNS for each:
   dig CNAME sub.target.com +short
3. For each CNAME → check if the CNAME target returns NXDOMAIN or a provider error
4. Match error response against fingerprint table (Section 3)

2.2 Key Signals

SignalMeaning
CNAME → xxx.s3.amazonaws.com + HTTP 404 "NoSuchBucket"S3 bucket deleted, claimable
CNAME → xxx.herokuapp.com + "No such app"Heroku app deleted
CNAME → xxx.github.io + 404 "There isn't a GitHub Pages site here"GitHub Pages unclaimed
NXDOMAIN on the CNAME target domain itselfTarget domain expired or never existed
CNAME → provider but HTTP 200 with default parking pageMay or may not be claimable — verify

2.3 Automated Tools

ToolPurpose
subjackAutomated CNAME takeover checking
nuclei -t takeovers/Nuclei takeover detection templates
can-i-take-over-xyz (GitHub)Reference for which services are vulnerable
dnsreaperMulti-provider takeover scanner
subzyFast subdomain takeover verification

3. SERVICE PROVIDER FINGERPRINT TABLE

ProviderCNAME PatternFingerprint (HTTP Response)Claimable?
AWS S3*.s3.amazonaws.com / *.s3-website-*.amazonaws.comNoSuchBucket (404)Yes — create bucket with matching name
GitHub Pages*.github.ioThere isn't a GitHub Pages site here (404)Yes — create repo + enable Pages
Heroku*.herokuapp.com / *.herokudns.comNo such appYes — create app with matching name
Azure*.azurewebsites.net / *.cloudapp.azure.com / *.trafficmanager.netVarious default pages, NXDOMAINYes — register matching resource
Shopify*.myshopify.comSorry, this shop is currently unavailableYes — create shop, add custom domain
FastlyCNAME to Fastly edgeFastly error: unknown domainYes — add domain to Fastly service
Pantheon*.pantheonsite.io404 Site Not Found with Pantheon brandingYes
Tumblr*.tumblr.com (custom domain CNAME)There's nothing here / Whatever you were looking for doesn't existYes
WordPress.comCNAME to *.wordpress.comDo you want to registerYes — claim domain in WP.com
Zendesk*.zendesk.comHelp Center Closed / Zendesk branding on errorYes — create matching subdomain
Unbounce*.unbouncepages.comThe requested URL was not foundYes
Ghost*.ghost.io404 Not Found Ghost errorYes
Surge.sh*.surge.shproject not foundYes
Fly.ioCNAME to *.fly.devFly.io default 404Yes

4. TAKEOVER PROCEDURE — COMMON PROVIDERS

4.1 AWS S3

1. Confirm: curl -s http://sub.target.com → "NoSuchBucket"
2. Extract bucket name from CNAME (e.g., sub.target.com.s3.amazonaws.com → bucket = "sub.target.com")
3. aws s3 mb s3://sub.target.com --region <region>
4. Upload index.html proving control
5. Enable static website hosting

4.2 GitHub Pages

1. Confirm: curl -s https://sub.target.com → "There isn't a GitHub Pages site here"
2. Create GitHub repo (any name)
3. Add CNAME file containing "sub.target.com"
4. Enable GitHub Pages in repo settings
5. Wait for DNS propagation (GitHub verifies CNAME match)

4.3 Heroku

1. Confirm: curl -s http://sub.target.com → "No such app"
2. heroku create <app-name-from-cname>
3. heroku domains:add sub.target.com
4. Deploy proof-of-concept page

5. NS TAKEOVER — HIGH SEVERITY

NS takeover is far more dangerous than CNAME takeover: you control all DNS resolution for the zone.

How It Happens

target.com NS → ns1.expireddomain.com
                 ↓
attacker registers expireddomain.com
                 ↓
attacker now controls ALL DNS for target.com
(A records, MX records, TXT records — everything)

Detection

1. Enumerate NS records: dig NS target.com +short
2. Check each NS domain: whois ns1.example.com → is the domain expired or available?
3. Also check: dig A ns1.example.com → NXDOMAIN/SERVFAIL?
4. Subdelegated zones: check NS for sub.target.com specifically

Impact

  • Full domain takeover (serve any content, intercept email, issue TLS certs via DNS-01)
  • Issue DV certificates from any CA using DNS challenge
  • Modify SPF/DKIM/DMARC → send authenticated email as target

6. MX TAKEOVER — EMAIL INTERCEPTION

When MX records point to deprovisioned mail services:

target.com MX → mail.deadservice.com (service discontinued)

If attacker can claim mail.deadservice.com or the mail tenant:

  • Receive password reset emails
  • Intercept sensitive communications
  • Potentially reset accounts that use email-based auth

Common Scenario

Expired Google Workspace / Microsoft 365 tenant → MX still points to Google/Microsoft → attacker creates new tenant and claims the domain.


7. WILDCARD DNS RISKS

If *.target.com has a wildcard CNAME to a claimable service:

  • Every undefined subdomain is vulnerable
  • anything.target.com can be taken over
  • Massively increases attack surface

Detection: dig A random1234567.target.com — if it resolves, wildcard exists.


8. DETECTION & EXPLOITATION DECISION TREE

Subdomain discovered (sub.target.com)?
├── Resolve DNS records
│   ├── Has CNAME → external service?
│   │   ├── HTTP response matches known fingerprint? (Section 3)
│   │   │   ├── YES → Attempt claim on provider (Section 4)
│   │   │   │   ├── Claim successful → TAKEOVER CONFIRMED
│   │   │   │   └── Claim blocked (name reserved, region locked) → document, try variations
│   │   │   └── NO → Service active, no takeover
│   │   └── CNAME target NXDOMAIN?
│   │       ├── Target is a registrable domain? → Register it → full control
│   │       └── Target is a subdomain of active provider → check provider claim process
│   │
│   ├── Has NS records → external nameserver?
│   │   ├── NS domain expired/available? → Register → FULL ZONE TAKEOVER
│   │   └── NS domain active → no takeover
│   │
│   ├── Has MX → external mail service?
│   │   ├── Mail service deprovisioned/claimable? → Claim tenant → EMAIL INTERCEPTION
│   │   └── Active mail service → no takeover
│   │
│   └── Has A record → IP address?
│       ├── IP belongs to elastic cloud (AWS EIP, Azure, GCP)?
│       │   ├── IP unassigned? → Claim IP → serve content
│       │   └── IP assigned to another customer → no takeover
│       └── IP belongs to dedicated server → no takeover
│
└── Post-takeover impact assessment
    ├── Shared cookies with parent domain? → Session hijacking
    ├── CORS trusts *.target.com? → Cross-origin data theft
    ├── CSP whitelists *.target.com? → XSS via taken-over subdomain
    ├── OAuth redirect_uri allows sub.target.com? → Token theft
    └── Can issue TLS cert for sub.target.com? → Full MITM

9. DEFENSE & REMEDIATION

ActionPriority
Remove DNS records when deprovisioning cloud resourcesCritical
Monitor CNAME targets for NXDOMAIN responsesHigh
Use DNS monitoring tools (SecurityTrails, DNSHistory)High
Claim/reserve resource names before deleting DNS recordsHigh
Audit NS delegations — ensure NS domains are owned and renewedCritical
Avoid wildcard CNAMEs to third-party servicesMedium
Implement Certificate Transparency monitoringMedium

10. TRICK NOTES — WHAT AI MODELS MISS

  1. CNAME ≠ takeover: A CNAME to S3 that returns 403 (bucket exists, private) is NOT vulnerable. Only NoSuchBucket (404) is.
  2. Region matters for S3: Bucket names are global, but website endpoints are regional. Try matching the region from the CNAME.
  3. GitHub Pages verification: GitHub added domain verification — org-verified domains cannot be claimed by others. Check if target uses this.
  4. Edge cases: Some providers (e.g., Cloudfront) require specific distribution configuration, not just domain claiming.
  5. Second-order takeover: sub.target.com CNAME → other.target.com CNAME → dead-service.com — the chain must be followed fully.
  6. SPF subdomain takeover: If SPF includes include:sub.target.com and you take over sub.target.com, you can modify its SPF TXT record to authorize your mail server → send spoofed email as target.com.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.97%
按下载量换算693

Claude

31.15%
按下载量换算654

Cursor

18.61%
按下载量换算391

Gemini CLI

8.62%
按下载量换算181

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills