client-secret-exposure-audit
Skill này làm gì
Công cụ này kiểm tra website xem thông tin nhạy cảm như mật khẩu hoặc khóa API có vô tình bị lộ trong mã mà trình duyệt có thể thấy không. Nó tìm các rò rỉ này trong các tệp JavaScript, HTML và tệp cấu hình không được phép công khai.
Khi nào nên dùng
- ✓Trước khi đưa website lên mạng, để đảm bảo không có mật khẩu hay khóa bí mật nào hiển thị.
- ✓Khi rà soát một website hiện có để tìm rò rỉ dữ liệu tiềm ẩn.
- ✓Khi bạn cần kiểm tra xem các tệp cấu hình hoặc tệp nguồn quan trọng có bị truy cập công khai không.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/client-secret-exposure-audit/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
“Kiểm tra website example.com xem có bí mật nào bị lộ không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ tải các tệp mà website thường hiển thị cho mọi khách truy cập. Sau đó, nó tìm kiếm các mẫu mật khẩu, khóa API hoặc dữ liệu nhạy cảm khác trong các tệp này, bao gồm mã JavaScript, chú thích HTML và tệp cấu hình.
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.
Client-Side Secret & Sensitive-File Exposure Audit
Overview
Modern web apps ship a lot of code and config to the browser. When credentials
leak into that client-visible surface — hardcoded in JavaScript, tucked into HTML
meta/data-* attributes or comments, or served as raw source/config/deploy
files that were never meant to be public — anyone can read them with curl and a
browser. This skill is a defensive, read-only workflow for finding that class
of exposure on a web app you are authorized to assess.
It maps to OWASP A02:2021 Cryptographic Failures (sensitive data exposure), A05:2021 Security Misconfiguration, and CWE-798 (hardcoded credentials), CWE-200 (sensitive information exposure), CWE-540 (source code in a production build). It only fetches resources the server already hands to any anonymous visitor — it does not exploit, brute-force, or mutate anything.
When to Use This Skill
- Use when you need to check whether a deployed site leaks API keys, tokens, or passwords in its client-side bundle before shipping or during a review.
- Use when working with a static/SPA deployment (Vercel, Netlify, Nginx, S3, GitHub Pages) and you want to confirm no source/config/deploy files are publicly reachable.
- Use when the user asks to "find secrets," "audit exposed files," "check the JS/HTML for credentials," or run a lightweight sensitive-data-exposure pass on a URL they own or are authorized to test.
- Do not use this to attack third-party sites. See Security & Safety Notes.
How It Works
Set the target once. Every command below reads only what the server serves publicly.
BASE="https://TARGET.example" # authorized target, no trailing path
WORK="$(mktemp -d)"; cd "$WORK"
Step 1: Fetch the page and inspect response headers
curl -s -D headers.txt -o body.html "$BASE/"
cat headers.txt
Flag on the headers:
access-control-allow-origin: *— permissive CORS (worse when paired with credentials).- Missing
Content-Security-Policy,X-Frame-Options/frame-ancestors,X-Content-Type-Options: nosniff,Referrer-Policy,Permissions-Policy. - Missing/weak
Strict-Transport-Security. Server/framework version banners that fingerprint the stack.
Step 2: Grep the HTML for secrets and sinks
grep -inE "secret|passwd|password|api[_-]?key|apikey|token|bearer|authorization|\
akia|sk_live|sk_test|pk_live|whsec_|ghp_|aiza|private[_-]?key|mongodb(\+srv)?://|\
data-[a-z-]*(secret|token|key|access)" body.html
grep -inE "<!--" body.html # read every HTML comment
grep -ioE '<meta[^>]+>' body.html # meta tags often carry keys/ids
grep -ioE '<script[^>]+src="[^"]+"' body.html # enumerate JS bundles
Secrets hide in data-* attributes, <meta> tags, hidden <div>s, and
<!-- comments --> at least as often as in scripts.
Step 3: Pull every JavaScript bundle and scan it
# extract script srcs, resolve relative paths against $BASE, fetch and scan
grep -ioE 'src="[^"]+\.js"' body.html | sed -E 's/^src="//; s/"$//' \
| while read -r p; do
u="$p"; case "$p" in http*) ;; /*) u="$BASE$p";; *) u="$BASE/$p";; esac
f="js_$(echo "$p" | tr '/:' '__')"
curl -s "$u" -o "$f" && echo "== $u =="
done
grep -rinE "secret|password|api[_-]?key|token|bearer|sk_(live|test)|pk_(live|test)|\
whsec_|akia|aiza|jwt|signing[_-]?key|admin[_-]?token|mongodb|redis://" js_* 2>/dev/null
Also scan any sourcemaps (*.js.map) — they can rebuild original source with
comments intact.
Step 4: Probe for publicly reachable source / config / deploy files
SPAs often have a catch-all rewrite that returns index.html for unknown paths,
so compare response sizes — a path whose size differs from the SPA fallback
is a real, distinct file.
FALLBACK=$(curl -s "$BASE/____nope____$RANDOM" | wc -c) # SPA fallback size
for p in /.env /.env.local /.env.production /.git/config /.git/HEAD \
/package.json /package-lock.json /vercel.json /.vercel/project.json \
/Dockerfile /docker-compose.yml /wrangler.toml /.gitignore \
/server/index.js /src/config/app.config.js /config.js \
/src/services/payment.service.js /webpack.config.js /next.config.js; do
read -r code size < <(curl -s -o /dev/null -w "%{http_code} %{size_download}" "$BASE$p")
[ "$code" = "200" ] && [ "$size" != "$FALLBACK" ] && echo "REAL FILE $code $size $p"
done
…
Câu hỏi thường gặp
Công cụ này có thể dùng để tấn công website khác không?
Không, công cụ này chỉ dành để kiểm tra các website mà bạn có quyền kiểm thử. Nó không cố khai thác lỗ hổng hay thay đổi bất cứ thứ gì.
“Exposed secrets” là gì?
Đó là các thông tin bí mật, như mật khẩu, khóa API hoặc token, nằm trong mã phía trình duyệt (những gì trình duyệt nhìn thấy) và có thể bị bất kỳ ai đọc.
Công cụ kiểm tra những loại tệp nào?
Nó kiểm tra các tệp JavaScript, các thẻ HTML (gồm thẻ meta và chú thích), và cố gắng truy cập các tệp cấu hình phổ biến như .env, package.json, Dockerfile, v.v.
Chi tiết
Mô tả gốc của tác giả
Audit a deployed web app for secrets exposed to the browser: hardcoded API keys/tokens in JS, secrets in HTML meta/attributes/comments, publicly reachable source/config/deploy files, and header/CORS misconfig.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4154
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự á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.