# WhereIsMyWebShell

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2Fi3KmN5slqukoAeov1VEC%2Fimage.png?alt=media&#x26;token=e63d8f23-4975-4593-95a7-b87991cf4e34" alt=""><figcaption></figcaption></figure>

## Fase de reconocimiento

`nmap -p- -sSVC --min-rate 5000 192.168.8.114 -oG allPorts -vvv`

Hacemos un escaneo de nmap para ver a que puertos nos estamos enfrentando, y vemos que solo esta el puerto 80 (HTTP) abierto:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FF3qgwj84wfGTcLe9W3AJ%2Fimage.png?alt=media&#x26;token=7093bd1d-f3ed-4cb2-a308-37e3c98ff6c0" alt=""><figcaption></figcaption></figure>

Nos dirigimos a la pagina web, y al fondo de ella podremos encontrar un pequeño regalo, aparte de eso no encuentro nada en el código fuente:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FZCRxBzOmKE7E2sD9sw7k%2Fimage.png?alt=media&#x26;token=253448f0-4498-434a-a2fd-14c83cd8e61f" alt=""><figcaption></figcaption></figure>

Voy a usar gobuster para hacer fuzzing a los directorios en busqueda de información más relevante:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FMnyR4ZENFidvrL8S0Kxt%2Fimage.png?alt=media&#x26;token=a2a0554c-0744-4a9d-8469-b0a99470f536" alt=""><figcaption></figcaption></figure>

Lo unico relevante que encuentro es /shell.php y /warning.html, dentro de warning se encuentra:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FhCiLt5K1Vd4viVCw81g7%2Fimage.png?alt=media&#x26;token=eef30083-95a0-4384-bd5a-5cd92e7d7b01" alt=""><figcaption></figcaption></figure>

Esto nos sugiere que tendremos que encontrar el parametro de la shell.php, he intentado fuzzear con wfuzz con varias listas incluso con un diccionario hecho con las palabras de la web pero sin exito, hasta que probe el /usr/share/dict/wordlist-probable.txt

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FQ64QRMUuJMll70YTR3UQ%2Fimage.png?alt=media&#x26;token=7876d598-2c59-4f7d-b8e3-cac669179559" alt=""><figcaption></figcaption></figure>

## Fase de intrusión

Ahora voy a obtener mi revershell, url-encondeo el parametro y lo introduzco en la webshell, mientras con netcat escucho en el puerto indicado en la reverseshell:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2F2IfLuROrZhpexZ1cyXpf%2Fimage.png?alt=media&#x26;token=ab9c553c-b8cc-4422-8437-dd74b20d79e0" alt=""><figcaption></figcaption></figure>

[depuracion-de-tty](https://burple.gitbook.io/burple/cheats/depuracion-de-tty "mention"):&#x20;

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2Fkg0VROqbElHeEZOCpDpB%2Fimage.png?alt=media&#x26;token=fd809948-65df-4ef4-8dea-e09f944a13a6" alt=""><figcaption></figcaption></figure>

## Escala de privilegios

Vamos al directorio /tmp, el cual nos habían indicado al fondo de la pagina web principal:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FVZocaAXciOgyRyNk7wdg%2Fimage.png?alt=media&#x26;token=8312b16a-01c1-4ce5-8117-45b47a420972" alt=""><figcaption></figcaption></figure>

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://burple.gitbook.io/burple/dockerlabs/facil/whereismywebshell.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.
