> For the complete documentation index, see [llms.txt](https://mis-apuntes-1.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mis-apuntes-1.gitbook.io/pentesting/dockerlabs/muy-facil/borazuwarah.md).

# Borazuwarah

IP: `172.17.0.2`

***

### 1. RECONOCIMIENTO

Hago un escaneo de puertos para ver cuáles hay abiertos:

Bash

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

Encuentro lo siguiente:

* Puerto 22 SSH y 80 HTTP abiertos, lo esperado.

Hago un curl a la página para ver su código:

```
curl -s 172.17.0.2
```

Observo que contiene lo siguiente:&#x20;

<figure><img src="https://3620341559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiE3IpoEbJxF5BQL5nIOG%2Fuploads%2FkO3nDT917pMew1PZ1HCL%2Fimage.png?alt=media&amp;token=3dadccc6-c63e-49d3-b545-a23da7298fcf" alt=""><figcaption></figcaption></figure>

***

### 2. ENUMERACIÓN

Enumero los directorios de la página para seguir con el reconocimiento, pero no encuentro nada interesante.

Como lo único que he encontrado es la imagen, decido descargarla para analizarla a fondo:

```
wget http://172.17.0.2/imagen.jpeg
```

Analizo la imagen con exiftool:

```
exiftool imagen.jpeg
```

En los metadatos de la imagen, encuentro el usuario pero no la contraseña.

<figure><img src="https://3620341559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiE3IpoEbJxF5BQL5nIOG%2Fuploads%2FogfQe9kaJTppikDXffry%2Fimage.png?alt=media&amp;token=7538cd86-d427-4337-a908-f9873b44886e" alt=""><figcaption></figcaption></figure>

***

### 3. EXPLOTACIÓN

Hago fuerza bruta a ese usuario encontrado:

Bash

```
hydra -l borazuwarah -P /usr/share/wordlists/rockyou.txt ssh://172.17.0.2 -t 4
```

Encuentro la contraseña, que resulta ser muy sencilla. Con las credenciales en mano, accedo por SSH al usuario:

Bash

```
ssh borazuwarah@172.17.0.2
```

***

### 4. ESCALADA DE PRIVILEGIOS

Vemos los privilegios que tiene el usuario para iniciar la escalada de permisos:

Bash

```
sudo -l
```

<figure><img src="https://3620341559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiE3IpoEbJxF5BQL5nIOG%2Fuploads%2FfJiO9RgmGA7pBJqSq4FO%2Fimage.png?alt=media&amp;token=a2fca9f6-101f-4aa2-94f9-cceb0b502f14" alt=""><figcaption></figcaption></figure>

Vemos que puedo ejecutar `/bin/bash` como root. Lo ejecuto para elevar mis privilegios:

```
sudo /bin/bash
```

***

### 5. POST-EXPLOTACIÓN

Accedemos al root y completamos la máquina:

<figure><img src="https://3620341559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiE3IpoEbJxF5BQL5nIOG%2Fuploads%2Fwt5V1p4904ekchOYmdQt%2Fimage.png?alt=media&amp;token=962e94f8-a908-4690-b0cc-994fdef5284d" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://mis-apuntes-1.gitbook.io/pentesting/dockerlabs/muy-facil/borazuwarah.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
