> 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/zh/web-vulnerabilities/json-web-token-jwt-attack/jwt-pivoting-user-pentesting-web.md).

# JWT 用户横向移动

## JWT 空值：

我们认证为一个 **普通用户** “user” 具有权限 *访客*:

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

我们观察到我们有一个 **会话 Cookie** 在 JWT 中：

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

<figure><img src="/files/98f4f6f5b9ca19c3fc28a1d178bad5d883d77168" alt=""><figcaption></figcaption></figure>

从 **终端**，我们翻译 en **base64** 更改编号标识后，对“Header”和“Payload”进行 en，然后我们移除“Verify signature”：

<figure><img src="/files/1b40f1159a0a0e6009f1bb9593dbe75553b963f4" alt=""><figcaption></figcaption></figure>

我们粘贴新的 **会话 Cookie** 并获得权限 *普通*:

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

## JWT 密钥

在测试 JWT 空值方法时，这 **将不起作用** 并且该尝试会失败。

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

思路是在 **验证签名**中尝试密码，通过暴力破解或一些逆向工程来获取该 cookie：

<figure><img src="/files/2db1cf6ee4405935ed5293ae891fd97fddf393d8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2cd4e93259a3d5048f625623033df2fd537d2b4e" 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/zh/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.
