# Extraviado

### 🔍 RECONOCIMIENTO

En primer lugar, tras conectarnos a la máquina, utilizamos el comando:

```bash
ping -c 1 172.17.0.2
```

para verificar la conectividad de red.

<figure><img src="/files/4V5ioaMv7PVyzER8h4Gz" alt=""><figcaption></figcaption></figure>

A continuación, realizamos el comando:

```bash
nmap -sVC -p- -n --min-rate 5000 172.17.0.2
```

para realizar un escaneo de puertos y servicios detallado en la dirección IP.

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

Como podemos observar durante el escaneo que el **puerto 22** perteneciente al **servicio SSH** y el **puerto 80** perteneciente al **servicio HTTP** están abiertos por lo que a continuación se indagará más.&#x20;

### 🔎 **EXPLORACIÓN**

Se utiliza el comando:

```bash
sudo nmap -sCV -p22,80 -v 172.17.0.2
```

para obtener más información sobre esos puertos específicamente.

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

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

### 🚀 **EXPLOTACIÓN**

Como vemos hay una cadena en Base64 por lo que vamos a decodificar.&#x20;

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

<figure><img src="/files/2DWQNycXV5NG6ukZB0lT" alt=""><figcaption></figcaption></figure>

Al parecer son las credenciales del usuario por lo que iniciamos sesión.

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

### 🔐 **PRIVILEGIOS**

Al estar dentro y ejecutar:

```bash
whoami
```

aún no somos **root**, por lo que hacemos:

```bash
sudo -l
```

para ver si hay algo para explotar. No tenemos permisos **SUDO**.

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

Indagamos entre los directorios y nos damos cuenta que hay otro usuario llamado **diego** y tenemos la contraseña en base64.

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

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

Iniciamos sesión con esas credenciales e indagando entre los directorios un acertijo.

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

El animal sobre que nos habla el acertijo es el **osoazul** que es la contraseña de **root**.

<figure><img src="/files/JYDmn2xF48g8RwKB9xVC" 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://beafn28.gitbook.io/beafn28/writeups/dockerlabs/extraviado.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.
