Chuyển đến nội dung
Skillpedia
Bảo mật10k · #11947

offensive-jwt

Skill này làm gì

Skill này là danh sách kiểm tra để kiểm thử xác thực dựa trên JWT trong các bài kiểm thử xâm nhập được ủy quyền. Nó bao quát nhầm lẫn thuật toán, khóa bí mật yếu, chèn header và các vấn đề về bộ nhớ đệm khóa. Nó dành cho chuyên gia bảo mật kiểm tra xem việc đăng nhập bằng token có thể bị vượt qua hay không.

Khi nào nên dùng

  • ✓Khi bạn kiểm thử đăng nhập JWT của một ứng dụng web hoặc di động trong một bài kiểm thử xâm nhập được ủy quyền.
  • ✓Khi bạn muốn kiểm tra xem máy chủ có chấp nhận token không ký hoặc bị thay đổi hay không.
  • ✓Khi bạn cần rà soát cách xử lý các header key ID hoặc key URL của JWT.

Liên kết skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/auth/offensive-jwt/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/SnailSploit/Claude-Red/blob/main/Skills/auth/offensive-jwt/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

“Chúng tôi được ủy quyền kiểm thử đăng nhập. Kiểm tra các token JWT xem có ký yếu hoặc nhầm lẫn thuật toán không.”

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

Cách hoạt động

Skill đi qua danh sách kiểm tra theo thứ tự. Nó kiểm tra thuật toán, khóa ký, các header khóa và bộ nhớ đệm khóa, rồi áp dụng từng kỹ thuật lên mục tiêu.

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.

Overview

Comprehensive JWT attack checklist for offensive security engagements. Follow steps in order; apply each technique to the current target context and track which items have been completed.

Quick Reference: Misconfigurations to Check

  • Algorithm set to none — signature verification bypassed entirely
  • Algorithm switching between RSA and HMAC (confusion attack)
  • Weak or guessable HMAC secret (brute-forceable)
  • kid, jku, jwk, x5u header parameters accepted without validation
  • Expired or tampered tokens accepted by server
  • Sensitive data stored unencrypted in payload

Useful tool: JWT Tool

Mechanisms

JWTs (RFC 7519) consist of three Base64URL-encoded parts: header.payload.signature.

Signing algorithms:

Algorithm Type Notes
HS256/384/512 Symmetric HMAC Shared secret; confusion target
RS256/384/512 Asymmetric RSA Public key can be misused as HMAC secret
ES256/384/512 Asymmetric ECDSA
PS256/384/512 RSASSA-PSS
EdDSA (Ed25519/Ed448) Asymmetric
none Unsigned Critically insecure

Additional pitfalls:

  • JWS/JWE confusion: server accepts encrypted token (JWE) where signed (JWS) is expected, or fails open on unexpected typ/cty
  • JWKS retrieval: SSRF via jku/x5u, insecure TLS, poisoned key caching, kid collisions
  • Token binding (DPoP, mTLS): incorrectly implemented allows replay from other clients

Hunt: Identifying JWT Usage

  1. Check Authorization: Bearer <token> headers in all requests
  2. Look for cookies containing JWT structures (eyJ...)
  3. Examine browser local/session storage
  4. Decode the token at jwt.io or via BurpSuite JWT extension — inspect claims and header parameters
  5. Note any kid, jku, jwk, x5u fields in the header — these are attack surfaces

Vulnerability Map

JWT Vulnerabilities
├── Algorithm Bypass
│   ├── alg:none attack
│   └── RS256→HS256 confusion (public key as HMAC secret)
├── Weak Secret Key → Brute force
├── kid Parameter Injection
│   ├── SQL injection via kid
│   └── Path traversal via kid
├── Header Injection
│   ├── jwk (inline fake key)
│   ├── jku/x5u (remote attacker-controlled JWKS)
│   └── JWKS cache poisoning
└── Missing / Broken Validation
    ├── No signature check
    ├── Expired tokens accepted
    └── iss/aud/exp not validated

Vulnerabilities

Algorithm Vulnerabilities

  • alg:none — Some libraries disable signature validation when alg is none or a case variant (None, NONE, nOnE)
  • Algorithm Confusion (RS256→HS256) — Server uses RSA public key as HMAC secret when attacker switches alg to HS256; attacker re-signs token with the public key
  • Key ID (kid) Manipulation — Exploiting kid to load wrong keys or inject file paths / SQL; enforce strict lookups

Signature Vulnerabilities

  • Weak HMAC Secrets — Brute-forceable with dictionary or hashcat
  • Missing Signature Validation — Token accepted without any verification
  • Broken Validation — Implementation errors in signature checking logic

Implementation Issues

  • Missing Claims Validation — exp, nbf, aud, iss not verified
  • Insufficient Entropy — Predictable JWT IDs or tokens
  • No Expiration — Tokens valid indefinitely
  • Insecure Transport — Token sent over HTTP
  • Debug Leakage — Detailed error messages expose implementation

Header Injection Attacks

  • JWK Injection — Supply a custom attacker-controlled public key via the jwk header
  • JKU Manipulation — Point jku (JWK Set URL) to attacker-controlled JWKS endpoint
  • x5u Misuse — Load untrusted X.509 key URL; exploit lax TLS validation or open redirects
  • JWKS Cache Poisoning — Force caches to accept attacker keys via kid collisions or response header manipulation
  • crit Header Abuse — Server ignores unknown critical parameters, enabling bypass

Information Disclosure

  • Sensitive data (PII, credentials, session details) stored unencrypted in payload
  • Internal service/backend information leaked via claims

Additional Attack Vectors

Mobile App JWT Storage

Android:

  • SharedPreferences: Check if world-readable; location /data/data/<package>/shared_prefs/
  • Keystore extraction: root device or exploit app
  • Backup extraction: adb backup -f backup.ab <package> (if allowBackup=true)
  • Tools: Frida, objection, MobSF

iOS:

  • Keychain: Check `kSecAttrA
Câu hỏi thường gặp

Nhầm lẫn thuật toán là gì?

Đó là khi máy chủ bị đánh lừa kiểm tra token bằng thuật toán sai, chẳng hạn dùng khóa công khai làm khóa bí mật.

Nó nhắc tới công cụ nào?

Nó nhắc tới dự án JWT Tool để kiểm thử token.

Đây có dành cho kiểm thử ứng dụng của chính tôi không?

Skill được viết cho việc kiểm thử được ủy quyền một ứng dụng, khi bạn có quyền kiểm thử nó.

Chi tiết

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

JWT attack methodology for penetration testers. Covers algorithm confusion (alg:none, RS256→HS256), weak HMAC secret brute force, kid parameter injection (SQLi, path traversal), jku/x5u/jwk header injection, JWKS cache poisoning, JWS/JWE confusion, timing attacks, and mobile JWT storage extraction. Use when testing JWT-based authentication, hunting auth bypass via token manipulation, or evaluating JWT implementation security in web or mobile apps.

repo: SnailSploit/Claude-Red

Độ phổ biến

Sao GitHub
10k
Vị trí xếp hạng
#11947
Giấy phép
MIT
Cập nhật
12/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ự