> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/fr/web-vulnerabilities/json-web-token-jwt-attack/jwt-pivoting-user-pentesting-web.md).

# Pivot d’utilisateur via JWT

## JWT-null :

Nous nous authentifions en tant que **utilisateur normal** « user » avec des privilèges *invité*:

<figure><img src="/files/b5dcd94ecb91c580b8fc7ebd8128580fdf0184ec" alt="" width="563"><figcaption></figcaption></figure>

Nous observons que nous avons un **cookie de session** dans le JWT :

<figure><img src="/files/5a88af72a4159756783dc04dad499354d3a81df7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2954898507e2cb0f04de26c1e73e2fd7901c826c" alt=""><figcaption></figcaption></figure>

Depuis le **terminal**, nous traduisons en **base64** le « Header » et le « Payload » en modifiant le numéro d’identification, puis nous supprimons le « Verify signature » :

<figure><img src="/files/317be5ba80cf99d61ccdefaa4451d076366eb036" alt=""><figcaption></figcaption></figure>

Nous collons le nouveau **cookie de session** et obtenons des privilèges *normal*:

<figure><img src="/files/80e83e1bba9b3a74fabf4649b146186b17114e84" alt=""><figcaption></figcaption></figure>

## JWT-secret

Lors du test de la méthode JWT null, cela **ne fonctionnerait pas** et la tentative échouerait.

<figure><img src="/files/7cc1492c457b2dbec105e65992997063efb1cfef" alt="" width="563"><figcaption></figcaption></figure>

L’idée serait d’essayer des mots de passe dans le **Verify signature**, par force brute ou un peu d’ingénierie inverse pour obtenir le cookie :

<figure><img src="/files/16a2c5f7124061192022bcd75a494fac9a2f9744" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/c5e2382c25f74c937e3cfc05e5ed5774fc3514b3" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/fr/web-vulnerabilities/json-web-token-jwt-attack/jwt-pivoting-user-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
