Langsung ke konten
Skillpedia
Keamanan48k ยท #4865

hunt-cors

Fungsinya

Tool ini membantu menemukan celah keamanan dalam cara website menangani permintaan dari origin yang berbeda. Tool ini memeriksa apakah sebuah situs secara tidak semestinya mengizinkan situs lain mengakses informasi sensitif.

Kapan dipakai

  • โœ“Saat Anda memiliki izin untuk menguji keamanan sebuah website.
  • โœ“Untuk memeriksa apakah situs melindungi data pengguna dengan baik dari akses tanpa izin.
  • โœ“Untuk memahami cara kerja pengaturan keamanan website (CORS) dan titik-titik kegagalannya.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-cors/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-cors/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin memeriksa konfigurasi keamanan CORS di example.com. Saya punya izin tertulis untuk melakukannya.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini mengirim permintaan ke website dengan 'Origin' header yang berbeda-beda untuk melihat bagaimana situs meresponsnya. Tool ini mencari respons yang menunjukkan bahwa situs mengizinkan akses tidak semestinya ke data sensitif.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

โš ๏ธ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

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 returns ACAO: *, the browser refuses to send/expose the response for a credentials: include request. 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: true is meaningless on its own. It matters only if ACAO reflects/allows your specific attacker origin AND a cross-origin credentialed fetch actually 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 Origin header AND sets ACAC: true โ†’ any site reads authed API responses. The classic High.
  • Null-origin trust โ€” ACAO: null + ACAC: true. A sandbox iframe (or a data:/redirect chain) emits Origin: 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.data without strictly validating event.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
#

โ€ฆ
Pertanyaan umum

Apa itu CORS?

CORS (Cross-Origin Resource Sharing) adalah mekanisme keamanan yang memungkinkan sebuah website meminta sumber daya (seperti data atau API) dari domain lain. CORS membantu melindungi data, tetapi konfigurasi yang keliru bisa menciptakan celah.

Apa itu 'CORS misconfiguration'?

Itu adalah kondisi ketika website diatur secara keliru sehingga situs yang tidak tepercaya bisa mengakses atau memanipulasi data yang seharusnya bersifat privat.

Mengapa saya perlu izin untuk menggunakan tool ini?

Menguji keamanan website tanpa izin itu ilegal. Tool ini hanya boleh digunakan pada sistem yang Anda miliki otorisasi tertulis yang jelas untuk mengujinya.

Detail

Deskripsi asli dari pembuat

Hunt CORS Misconfiguration

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#4865
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa