Status: Stable
Version: 1.0.0
Author: Rifteo
Tags: pentest, security, access
Summary
Work through a complete 11-attack JWT exploitation methodology from decoding the token to forging one with admin claims covering every known attack class against HMAC and asymmetric JWT implementations.- Decodes and inspects the header (
alg,kid,jku,x5u,jwk) to select the highest-impact attacks first - Covers
alg:none, RS256 → HS256 algorithm confusion, weak HMAC secret brute-force,kidSQL injection,kidpath traversal,jku/x5uheader injection, and embeddedjwkinjection - Tests claim validation issues: expired token acceptance, missing
iss/audvalidation, and cross-service token relay - Includes ready-to-run Python snippets and
jwt_toolshortcuts for each attack
SKILL.md file
Discover skill details
Discover skill details
JWT Cracker
Execute a structured JWT attack sequence against a target, working from token decode through signature bypass and claim tampering.What Does It Check?
JWT vulnerabilities occur when the server accepts a token it should reject because the signature check is weak, skipped, or bypassable. The skill decodes the token header, identifies the algorithm and any key-reference fields, then selects and executes the relevant attacks in priority order.In scope:- All HMAC algorithms: HS256, HS384, HS512
- Asymmetric algorithms: RS256, ES256
- All JWT header fields:
alg,kid,jku,x5u,jwk - Claim validation:
exp,iss,aud,sub,role,org_id - Cross-service token relay (shared key without
audvalidation)
- OAuth 2.0 flows (authorization code, PKCE) JWT signing is only one component
- Refresh token attacks separate class of vulnerability
How It Works
Pre-attack: Decode the TokenSplit the JWT and base64url-decode the header and payload to readalg, kid, jku, x5u, and jwk fields. These drive which attacks to try first.Attack 1: alg:noneSet the header algorithm to "none" (and all case variants: None, NONE, nOnE) and strip the signature. If the server accepts it, full token forgery is confirmed.Attack 2: RS256 → HS256 Algorithm ConfusionIf alg: RS256, obtain the public key from /.well-known/jwks.json or similar endpoints. Re-sign the token using HS256 with the PEM-encoded public key as the HMAC secret.Attack 3: Weak HMAC Secret Brute-ForceRun the full JWT against hashcat (GPU), john, or jwt_tool -C using common defaults and the bundled references/jwt-secrets.txt wordlist.Attack 4: kid SQL InjectionIf a kid field is present, inject a UNION SELECT payload to make the database return a known value as the signing key, then sign the token with that value.Attack 5: kid Path TraversalPoint kid to /dev/null or a file with known content (e.g. ../../public/logo.png) and sign with that file’s content as the HMAC secret.Attack 6: jku / x5u Header InjectionGenerate a key pair, host the JWKS at an attacker-controlled URL, inject that URL into jku, and sign the token with the private key.Attack 7: Embedded jwk InjectionInject a self-generated key pair as the jwk header field and sign the token with the corresponding private key.Attacks 8–11: Claim and Validation ChecksAfter any successful forgery: tamper with sub, role, is_admin, org_id, and privilege-related claims. Also test expired token acceptance, missing iss/aud validation, and cross-service token relay.Output
Example confirmation:
Known Limitations
jwt_toolandhashcatmust be installed separately seereferences/tools.mdjku/x5uattacks require a publicly reachable server to host the JWKS- Algorithm confusion attacks require the public key to be accessible (JWKS endpoint or certificate)
- This skill is for authorized testing only always confirm scope before use
Benchmark Results
Tested on claude-sonnet-4-6 via Claude Code CLI. Same prompt, same model, same target. The only variable is whether the skill is loaded.Related skills
idor-hunter
Systematic IDOR/BOLA detection methodology with recon, testing, and bypass techniques
finding-writer
Convert raw pentest notes into structured audit findings ready for reporting
risk-assessor
Score a vulnerability using likelihood × impact with SLA-bound remediation urgency

