Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #4902

hunt-spa-api

Skill này làm gì

Công cụ này giúp tìm “ngôn ngữ bí mật” (API) mà một website dùng để giao tiếp với máy chủ. Nó tìm ngôn ngữ này trong các file của website và kiểm tra lỗ hổng bảo mật, như truy cập trái phép.

Khi nào nên dùng

  • ✓Khi một website trông như ứng dụng một trang và tải nhiều file mã.
  • ✓Khi bạn thấy tên miền như “admin”, “console” hoặc “api”.
  • ✓Khi trang đăng nhập dùng các hệ thống như Google hoặc Facebook để đăng nhập.

Liên kết skill

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

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-spa-api/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tìm API của example.com và kiểm tra các lỗ hổng bảo mật.”

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 file mã của website, tìm địa chỉ và lệnh API ẩn trong đó, rồi thử truy cập các lệnh này mà không có quyền để xem website có được bảo vệ đúng cách hay không.

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.

⚠️ 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.

When to use this skill

Trigger when:

  • A target host returns a tiny HTML shell + big /static/js/*.js or /_next/static/* bundles (React/Vue/Angular/Next/Svelte SPA)
  • You see a subdomain named console, app, dashboard, portal, admin, panel, manage, internal
  • Recon surfaces any *api*, *-api*, api.* host
  • A login page is OAuth/SSO-gated (the frontend auth tells you nothing about whether the API enforces auth)

The core insight: a SPA is a client to a backend API, and it ships the full map of that API — hosts, routes, sometimes keys — to anyone who views source. The login page being protected says nothing about whether the API behind it checks tokens. Auth is frequently enforced on the gateway/login and missing on a route group of the API.

DO NOT skip this because "the app needs login" — that's exactly when this pays off.


The play (5 steps)

1. Pull the shell + enumerate the bundles

curl -s https://console.target.com/ -o index.html
# React/CRA:
grep -oE '/static/js/[^"]+\.js' index.html
# Next.js:
grep -oE '/_next/static/[^"]+\.js' index.html
# generic:
grep -oiE 'src="[^"]+\.js[^"]*"' index.html

Download every bundle (they can be multi-MB — that's fine, it's all route data):

mkdir bundles
for j in $(grep -oE '/static/js/[^"]+\.js' index.html | sort -u); do
  curl -s "https://console.target.com$j" -o "bundles/$(echo "$j"|tr '/' '_')"
done

2. Harvest API hosts, routes, and secrets from the bundles

B=bundles/*.js
# Backend API hosts (incl. dev/beta/staging variants — often weaker auth)
grep -ohiE 'https://[a-z0-9.-]*(api|console|backend|service)[a-z0-9.-]*\.target\.com[a-z0-9/_-]*' $B | sort -u
# Versioned API base paths
grep -ohiE '/api/v[0-9]+/?' $B | sort -u
# Route literals — minified bundles store routes as STRING segments, not full URLs.
# Grep for quoted "resource/action" strings:
grep -ohiE '"[a-z0-9_-]+/[a-z0-9_/-]+"' $B | tr -d '"' \
  | grep -iE '(login|user|account|order|billing|invoice|payment|deal|report|token|otp|password|reset|admin|profile|auth|upload|export|role|permission|dashboard|wallet|finance|sales)' | sort -u
# Secrets (validate before trusting — most AIza keys are Maps/analytics, not Auth)
grep -ohiE '(AIza[0-9A-Za-z_-]{35}|AKIA[0-9A-Z]{16}|sk_live_[0-9A-Za-z]+|eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}|apiKey["'"'"']?\s*[:=]\s*["'"'"'][^"'"'"']+)' $B | sort -u

Note: minifiers store routes as concatenated string segments (e.g. "account/payment/list"), NOT full /api/v2/... URLs — so a naive /api/v* grep returns nothing. Grep for the resource-word route strings and prepend the base yourself.

Lazy-loaded (async) chunks — don't stop at HTML-referenced bundles. CRA/webpack SPAs reference only runtime+main+vendor in index.html; numbered async route chunks are named inside main.js's chunk map and loaded at runtime, so grepping only /static/js/*.js from the shell truncates route coverage to eager chunks.

grep -oE '[0-9]+:"[a-f0-9]+"' bundles/*main*.js        # {chunkId:"hash"} pairs
# reconstruct /static/js/<id>.<hash>.chunk.js, download each, re-run route/host/secret harvest
# asset-manifest.json (if present) lists them all -> hunt-source-leak

3. Establish a CONTROL — find an endpoint that IS gated

Before declaring anything vulnerable, send an unauthenticated request to an endpoint you expect to be protected, and capture what correct rejection looks like:

curl -s -X POST https://api.target.com/api/users -H 'Content-Type: application/json' -d '{}'
# secure → {"error":"Missing or invalid authorization header"} or HTTP 401

…
Câu hỏi thường gặp

Tại sao tôi lại làm việc này?

Để hiểu cách một website hoạt động bên trong và tìm các điểm yếu bảo mật có thể bị kẻ xấu khai thác.

Tôi có cần sự cho phép để dùng công cụ này không?

Có, điều quan trọng là phải có sự cho phép rõ ràng, bằng văn bản, từ chủ hệ thống trước khi dùng công cụ này trên bất kỳ website nào. Dùng khi không được phép là vi phạm pháp luật.

API là gì?

API giống như người phục vụ trong nhà hàng. Bạn (website) yêu cầu điều gì đó (dữ liệu hoặc một hành động), API (người phục vụ) mang yêu cầu đến bếp (máy chủ) và mang kết quả trở lại cho bạn.

Chi tiết

Mô tả gốc của tác giả

Discover a single-page-app's hidden backend API from its public JS bundle, then test that API for broken access control / missing authentication.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4902
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự