hunt-cors
Skill này làm gì
Skill này kiểm tra cài đặt CORS có thể cho phép trang của kẻ tấn công đọc phản hồi nhạy cảm từ tài khoản của người dùng đã đăng nhập. Nó dành cho kiểm thử được ủy quyền các ứng dụng web và API.
Khi nào nên dùng
- ✓Khi một API trả về dữ liệu riêng tư và gửi header CORS.
- ✓Khi một trang phản chiếu mọi nguồn trong cài đặt CORS của nó.
- ✓Khi bạn muốn xác nhận việc đọc chéo trang có khả năng xảy ra trong trình duyệt thật không.
Liên kết skill
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-cors/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
“Bạn có thể kiểm tra xem API của chúng tôi có cho phép các trang web khác đọc dữ liệu tài khoản từ trình duyệt đã đăng nhập trong kiểm thử được ủy quyền không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi yêu cầu từ một nguồn kiểm thử và kiểm tra header CORS. Nó chỉ xác nhận phát hiện khi trình duyệt thật có thể đọc được phản hồi riêng tư.
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.
HUNT-CORS — Cross-Origin Resource Sharing Misconfiguration
What actually pays (and what does not)
CORS pays High only when an attacker-controlled origin can perform a
credentialed cross-origin read of sensitive authenticated data, and you
have a browser PoC proving the response body is readable from evil.com.
Two hard browser rules that kill most "findings" — check these FIRST:
Access-Control-Allow-Origin: *CANNOT be combined with credentials. If the server returnsACAO: *, the browser refuses to send/expose the response for acredentials: includerequest. A wildcard-only endpoint is not credential-exploitable. It is only interesting if the data it serves is sensitive without a session (rare) — usually this is Informational/Low.Access-Control-Allow-Credentials: trueis meaningless on its own. It matters only ifACAOreflects/allows your specific attacker origin AND a cross-origin credentialedfetchactually returns a readable body. ACAC on a response that does not reflect your origin proves nothing.
If you cannot demonstrate a readable cross-origin authed body in a real browser, you do not have a High. Do not submit header-diffing alone.
Crown Jewel Targets
- Reflect-any-origin + credentials — server echoes the
Originheader AND setsACAC: true→ any site reads authed API responses. The classic High. - Null-origin trust —
ACAO: null+ACAC: true. Asandboxiframe (or adata:/redirect chain) emitsOrigin: null, so any page can read authed data. - Subdomain-regex bypass — trusted-origin regex with a parsing flaw. The correct payload depends on which flaw (see Phase 3 — this is where most skills get it wrong).
- Subdomain takeover → trusted origin — a dangling subdomain that the CORS policy trusts; take it over, host the PoC there (see hunt-subdomain).
- postMessage missing/loose origin check — handler that processes
event.datawithout strictly validatingevent.origin.
Attack Surface Signals
Any endpoint returning an Access-Control-Allow-Origin header
API endpoints: /api/*, /v1/*, /graphql
Profile/account: /api/me, /api/profile, /api/user, /api/session
Secrets/tokens: /api/tokens, /api/keys, /api/csrf, /api/account/settings
Financial: /api/balance, /api/transactions
Admin/internal: /api/admin/*, /api/internal/*
Prioritize endpoints that (a) require a session cookie and (b) return PII, tokens, CSRF tokens, or other secrets in the body.
Step-by-Step Hunting Methodology
Phase 1 — Discover CORS endpoints
# Probe API endpoints. Use GET (not -I): some servers only emit CORS on GET,
# and -I sends HEAD which may be handled differently.
while read url; do
result=$(curl -s -D - -o /dev/null "$url" \
-H "Origin: https://evil.com" \
-H "Cookie: $SESSION_COOKIE" | grep -i "access-control")
[ -n "$result" ] && echo "=== $url ===" && echo "$result"
done < recon/$TARGET/api-endpoints.txt
# httpx bulk check
cat recon/$TARGET/live-hosts.txt | awk '{print $1}' | \
httpx -H "Origin: https://evil.com" -match-string "access-control-allow-origin"
Phase 2 — Reflect-any-origin + null origin
# Does the server reflect an arbitrary Origin back?
curl -s -D - -o /dev/null https://$TARGET/api/me \
-H "Origin: https://evil.com" \
-H "Cookie: $SESSION_COOKIE" | grep -i "access-control"
# Vulnerable (the High case):
# Access-Control-Allow-Origin: https://evil.com <- reflects attacker origin
# Access-Control-Allow-Credentials: true <- + credentials => readable
#
# NOT exploitable for credentialed theft:
# Access-Control-Allow-Origin: * <- browser blocks creds read
# (no ACAC, or ACAC absent) <- not credentialed
# Null-origin trust
curl -s -D - -o /dev/null https://$TARGET/api/me \
-H "Origin: null" \
-H "Cookie: $SESSION_COOKIE" | grep -i "access-control"
# Looking for: Access-Control-Allow-Origin: null + ACAC: true
Phase 3 — Subdomain / trusted-origin regex bypass
The right payload depends on which regex flaw the server has. Identify the class first, then send the matching payload. Getting this wrong wastes the test and produces false negatives.
Server regex (intended: trust *.target.com) |
Flaw | Bypass origin that matches | Why |
|---|---|---|---|
^https?://.*\.target\.com$ |
None — escaped dot + end-anchor. Correct. | (no simple bypass) | `evil. |
Câu hỏi thường gặp
Nguồn ký tự đại diện có đủ để báo cáo không?
Thường là không. Skill ghi rằng ký tự đại diện không dùng được với thông tin xác thực, nên thường có mức nghiêm trọng thấp.
Vì sao phải kiểm tra trong trình duyệt?
Chỉ kiểm tra header có thể gây hiểu nhầm, nên skill yêu cầu bằng chứng rằng trình duyệt thật đọc được phản hồi.
Nó có bao quát thủ thuật subdomain không?
Có. Nó bao gồm việc so khớp subdomain yếu và tin tưởng nguồn null.
Chi tiết
Mô tả gốc của tác giả
Hunt CORS Misconfiguration — origin-reflection with credentials, null-origin trust, subdomain-regex bypass (unanchored vs unescaped-dot vs prefix-only), pre-flight (OPTIONS) gating bypass, postMessage origin checks. High only when an attacker-controlled origin can perform a CREDENTIALED cross-origin read of sensitive data and you have proven it in a browser. Use when testing API endpoints, SPAs, or any app emitting Access-Control-* headers.
Độ phổ biến
- Sao GitHub
- 5.4k
- Vị trí xếp hạng
- #14902
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
apk-redteam-pipeline
5.4kGiúp agent của bạn kiểm thử một ứng dụng Android về các điểm yếu bảo mật, từ việc tìm file APK và giải mã đến kiểm tra bí mật bị lộ.
bugcrowd-reporting
5.4kGiúp agent của bạn viết báo cáo lỗ hổng Bugcrowd tốt hơn, chọn đúng danh mục và trả lời các phản đối về việc nằm ngoài phạm vi.
cloud-iam-deep
5.4kGiúp agent của bạn kiểm tra thông tin xác thực đám mây tìm được có thể truy cập những gì trên AWS, Azure hoặc Google Cloud, trong một kiểm thử bảo mật được ủy quyền.
enterprise-vpn-attack
5.4kGiúp agent của bạn kiểm tra các thiết bị VPN và truy cập từ xa của Cisco, Fortinet, Citrix và các hãng khác về những điểm yếu đã biết, trong một kiểm thử được ủy quyền.
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.