> For the complete documentation index, see [llms.txt](https://burple.gitbook.io/burple/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://burple.gitbook.io/burple/thehackerslabs/medio/cachopo.md).

# Cachopo

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

## Fase de reconocimiento

Identificamos la IP de nuestra maquina victima haciendo uso de un:

```
sudo arp-scan -l
```

Hacemos un escaneo de Nmap y nos encontramos con los puertos abiertos:

22 SSH y 80 HTTP

```
sudo nmap -sVC -vvv -open -Pn 192.168.8.110
```

<figure><img src="/files/7K8LCYvlc7mZuw6E00NF" alt=""><figcaption></figcaption></figure>

Si intentamos entrar a la pagina web no nos deja, eso pasa porque nos redirecciona a cachpo.thl, esto se soluciona facilmente añadiendo a "/etc/hosts" la IP de nuestra maquina atacante y el dominio (cachopo):

```
nano /etc/hosts
```

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

## Fase de intrusión

Ahora si que nos deja entrar, y solo vemos un delicioso cachopo, bastante evidente lo que tenemos que hacer ahora, verdad? Si o si debe haber algo escondido dentro de esto suculento cachopo, así que abrimos el cachopo en otro ventana y lo descargamos. Ahora vamos a proceder a hacer uso de stegcracker para descifrar la contraseña necesaria para extraer los datos escondidos dentro de la imagen.

```
stegcracker cachopo.jpg /usr/share/wordlists/rockyou.txt
```

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

Ahora que tenemos la contraseña, vamos a poder extraer los datos de la imagen como mencionaba anteriormente, vamos a hacer uso de la herramienta steghide.

```
steghide extract -sf cachopo.jpg
```

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

Vamos al directorio "mycachopo", y encontramos un archivo, lo descargamos.

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

Vamos a sacar el hash de este archivo

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

A continuación voy a crackear la contraseña con john, en mi caso yo ya extrai la contraseña previamente y por eso no funciona, para ver la contraseña del hash tienes que poner el hash y a continuación --show

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

Intento abrir el archivo Cocineros pero no me deja porque es un archivo de libreoffice así que vamos a abrirlo en libreoffice

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

Ahora me voy a crear un archivo con esos usuarios (todo en minusculas) y voy a hacer un ataque de hydra para conseguir los credenciales validos del puerto ssh

<figure><img src="/files/6gMOlspKDsXjVrPVOZkT" alt=""><figcaption></figcaption></figure>

```
hydra -L users.txt -P /usr/share/wordlists/rockyou.txt ssh://TuIP
```

## Escalada de privilegios

Hacemos un sudo -l y vemos q carlos puede ejecutar crash, vamos a GTFOBins a buscar el binario vulnerable

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

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

Lo corremos, y a continuacion introducimos !sh, y tendriamos accesso root ;)

<figure><img src="/files/eZP69DQeaHjF4lglhn5F" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://burple.gitbook.io/burple/thehackerslabs/medio/cachopo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
