Langsung ke konten
Skillpedia
Keamanan5.4k ยท #14933

hunt-source-leak

Fungsinya

Skill ini mencari file yang tidak sengaja bisa diakses publik, seperti source map, file environment, spesifikasi API, dan folder git. Skill ini untuk pengintaian resmi di awal pengujian keamanan.

Kapan dipakai

  • โœ“Saat Anda memulai pengujian keamanan dan ingin memeriksa kebocoran publik yang cepat.
  • โœ“Saat situs memiliki bundle JavaScript dan source map mungkin terbuka.
  • โœ“Ketika file .env atau folder .git yang publik mungkin mengungkap rahasia.

Link skill

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-source-leak/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/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-source-leak/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

โ€œSebelum kita mulai pengujian keamanan, bisakah Anda memeriksa situs kami untuk file konfigurasi, source map, dan dokumen API yang bocor?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent meminta daftar jalur kebocoran yang umum dan memeriksa mana yang mengembalikan file. Agent melaporkan apa yang diungkap setiap file dan seberapa serius risikonya.

Konten teknis (SKILL.md asli)

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

HUNT-SOURCE-LEAK โ€” Source Code & Build Artifact Leakage

Crown Jewel Targets

Source map exposing TypeScript source = see all API routes, auth logic, secrets. Swagger/OpenAPI JSON = complete API surface map.

Highest-value findings:

  • .js.map source maps โ€” reconstruct full TypeScript/ES6 source code โ†’ find hardcoded API keys, internal endpoints, auth logic bypasses
  • swagger.json / openapi.json โ€” complete REST API specification with all endpoints, parameters, auth schemes, and internal route names
  • .env / .env.production โ€” APP_KEY, DB_PASSWORD, API_KEY, SECRET_KEY in plaintext
  • .git/ exposure โ€” git clone the entire source history โ†’ all past hardcoded secrets
  • asset-manifest.json / _next/static/ โ€” all JS bundle paths โ†’ systematic source map discovery
  • build-info / info.json โ€” git commit hash, build timestamp, dependency versions โ†’ CVE targeting

Phase 1 โ€” Quick Wins (Run First)

# These 10 requests take <30 seconds and often yield Critical findings
for PATH in \
  "/.env" \
  "/.env.production" \
  "/.env.local" \
  "/.git/HEAD" \
  "/swagger.json" \
  "/api/swagger.json" \
  "/v1/swagger.json" \
  "/openapi.json" \
  "/api/openapi.json" \
  "/api-docs"; do
  STATUS=$(curl -s -o /tmp/sl_test -w "%{http_code}" "https://$TARGET$PATH")
  if [ "$STATUS" = "200" ]; then
    echo "[+] HIT: https://$TARGET$PATH"
    head -5 /tmp/sl_test
    echo "---"
  fi
done

Phase 2 โ€” Source Map Discovery

Always resolve the CURRENT build hash before testing, and again before re-verifying. Bundle filenames are content-hashed, so they rotate on every deploy. A .map URL recorded yesterday can 404 today while the map is still fully exposed under a new name. A 404 at the old URL is not remediation โ€” it is a new build.

# ALWAYS derive the hash live, never reuse a recorded URL
HASH=$(curl -s "https://$TARGET/" | grep -oE 'main\.[a-f0-9]+\.js' | head -1)
curl -s -o /dev/null -w '%{http_code} %{size_download} %{content_type}\n' \
  "https://$TARGET/static/js/${HASH}.map"

Lesson from an authorized engagement. A large production map was found at main.<hashA>.js.map. On re-verification that URL returned a small HTML soft-404 and the finding was nearly closed as fixed. The bundle had rotated to main.<hashB>.js โ€” and the map was still published at main.<hashB>.js.map, same size. Nothing had been remediated.

Tell the client this explicitly in the report: redeploying does not fix source map exposure. Only GENERATE_SOURCEMAP=false (or stripping .map at deploy) plus a CDN purge closes it. A team that redeploys and re-checks the old link will wrongly declare victory.

Same rule applies to any content-hashed artifact: chunk files, CSS maps, asset-manifest.json, and staging equivalents.

# Step 1: Get asset manifest to find all JS bundle paths
curl -s "https://$TARGET/asset-manifest.json" | python3 -m json.tool 2>/dev/null
curl -s "https://$TARGET/static/js/main.*.js" 2>/dev/null | head -3

# Next.js
BUILD_ID=$(curl -s https://$TARGET/ | grep -oP '"buildId":"\K[^"]+')
curl -s "https://$TARGET/_next/static/$BUILD_ID/_buildManifest.js" | head -5

# Step 2: For each JS bundle, check for source map reference at end of file
for JS_URL in $(curl -s https://$TARGET/ | grep -oP 'src="[^"]*\.js"' | sed 's/src="//;s/"//'); do
  LAST_LINE=$(curl -s "https://$TARGET$JS_URL" | tail -1)
  echo "$LAST_LINE" | grep -q "sourceMappingURL" && echo "[+] Source map: $JS_URL"
done

# Step 3: Download and reconstruct source from .map files
JS_URL="https://$TARGET/static/js/main.abc123.js"
MAP_URL="${JS_URL}.map"
curl -s "$MAP_URL" | python3 -c "
import sys, json, os
data = json.load(sys.stdin)
sources = data.get('sources', [])
contents = data.get('sourcesContent', [])
for i, (src, content) in enumerate(zip(sources, contents)):
    if content:
        path = '/tmp/sourcemap_extract/' + src.replace('../','').replace('./',''). replace('webpack://','')
        os.makedirs(os.path.dirname(path), exist_ok=True)
        with open(path, 'w') as f:
            f.write(content)
        print(f'[+] Extracted: {src}')
"

# Step 4: Grep extracted source for secrets
grep -r "API_KEY\|SECRET\|PASSWORD\|TOKEN\|PRIVATE" /tmp/sourcemap_extract/ 2>/dev/null
grep -r "process\.env\." /tmp/sourcemap_extract/ 2>/dev/null | grep -v "NEXT_PUBLIC_" | head -20
grep -r "http://internal\|localhost\|127\.0\.0\.1\|10\.\|172\.
Pertanyaan umum

Mengapa pemeriksaan ini dilakukan dulu?

Menurut skill ini, pemeriksaan cepat seperti ini sering menemukan temuan serius hanya dalam beberapa permintaan.

Apa itu source map?

Itu adalah file yang bisa dipakai untuk membangun kembali kode sumber yang bisa dibaca dari skrip situs yang sudah dikompilasi.

Apakah folder .git yang terbuka bisa berisiko?

Ya. Menurut skill ini, folder .git publik bisa mengungkap seluruh riwayat sumber, termasuk rahasia lama.

Detail

Deskripsi asli dari pembuat

Hunt source code and build artifact leakage โ€” JavaScript source maps (.js.map) reconstructing TypeScript/ES6 source, Swagger/OpenAPI JSON endpoint discovery, .env/.git exposure, webpack chunks with hardcoded secrets, robots.txt/security.txt recon, build-info files, asset-manifest.json API route discovery, .DS_Store file listing. Use at the START of every recon session โ€” these findings often unlock the entire attack surface.

repo: elementalsouls/Claude-BugHunter

Popularitas

Bintang GitHub
5.4k
Peringkat
#14933
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa