# JWT Tool

## Structure

<https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-token-structure>

## Debugger

Best online tool is <https://token.dev> JWT debugger.

{% embed url="<https://token.dev>" %}

## JWT Tool

[https://github.com/ticarpi/jwt\_tool](< https://github.com/ticarpi/jwt_tool>)

<https://github.com/ticarpi/jwt_tool/wiki/Attack-Methodology>

## Signature Verification Attacks

### Algorithm None Bypass

```
./jwt_tool.py JWT_TOKEN -X a
```

### Token attacks on POST data endpoint

```
python3 ./jwt_tool.py -M pb -t http:/URL/api/method  -pd "{\"propertyId\": 29}" -rh "Authorization: Bearer <TOKEN>" -rh "Content-Type: text/json"
```

### HS256 - HMAC secret cracking

```bash
python3 ./jwt_tool.py JWTTOKEN --crack --dict /path/wordlist/secrets.txt

# modify payload claims
python3 ./jwt_tool.py JWTTOKEN --sign hs256 --password secret -T
```

### RS256 - Find public Key

Searching public key for cracking the primary key

<https://github.com/ticarpi/jwt_tool/wiki/Finding-Public-Keys>

```
/.well-known/jwks.json
/openid/connect/jwks.json
/jwks.json
/api/keys
/api/v1/keys
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hackerlab.gitbook.io/wiki.hackerlab.cz/web-pentesting/jwt-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
