# Resident

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

## Fase de reconocimiento

Hacemos un escaneo de nmap y encontramos los puertos 22 (ssh) y 80 (http) abiertos:

```
nmap -sSVC -open -vvv -Pn -min-rate 5000 IP
```

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

## Fase de intrusión

Si hacemos un ataque de fuzzing haciendo uso de gobuster encontramos "/robots.txt", la cual en su interior contiene los credenciales del panel de la pagina web.

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

La contraseña parece ser encriptada en base64, asi que vamos a desencriptarla:

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

Lo decodificamos, porque esta url-encodeado, este hash tiene pinta de ser un md5 porque los md5 cuentan con 32 caracteres.

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

Como no se el ultimo digito voy a hacer un diccionario con todas las letras posibles que puede contener:

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

Ahora vamos a hacer un ataque con hydra para ver cual de todas estas contraseñas es correcta:

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

Iniciamos sesion con los credenciales obtenidos y probamos un XSS y funciona:

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

En el la caja de abajo si probamos un LFI funciona y podemos ver usuarios.

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

## Escalada de privilegios

Ahora vamos a probar a hacer un ataque de hydra con el usuario ram:

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

Si vamos a /home/ram encontramos "root.txt", lo abrimso y entramos a root con esa contraseña y ya estaria:

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


---

# 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/thehackerslabs/medio/resident.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.
