# Convert

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FnGZlFolOgXDi2mgvlU54%2Fimage.png?alt=media&#x26;token=a4b05116-6b8c-440d-b1bf-a66497ebde67" alt=""><figcaption></figcaption></figure>

## Fase de reconocimiento

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

Primero hago un escaneo con nmap para ver que puertos abiertos tiene la IP de nuestra maquina victima, y me encuentro con los puertos 22 (ssh) y 80 (http) abiertos, entro en la IP y me encuentro la siguiente web:<br>

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FyaYq5oLerHnVGTouAWjd%2Fimage.png?alt=media&#x26;token=5bf62060-abc9-4867-8046-998db58803db" alt=""><figcaption></figcaption></figure>

Vamos crear un archivo, abrir un servidor python para poder poner una url en la web y descargamos el archivo:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2F8ndLinD91URj222Vn8Cs%2Fimage.png?alt=media&#x26;token=5504c8e3-8ae2-4a7d-838b-cce1ff02c0ed" alt=""><figcaption></figcaption></figure>

## Fase de intrusión

Con exiftool veo que esta hecho con dompdf 1.2.0, busco en internet vulnerabilididades y doy con esta pagina web la cual enseña como explotar dicha vulnerabilidad [Haz click aqui!](https://exploit-notes.hdks.org/exploit/web/dompdf-rce/):

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FK5jwMZJjA54PYfUb7JKq%2Fimage.png?alt=media&#x26;token=9c7bb78d-09fb-45f0-a071-ac288de363ac" alt=""><figcaption></figcaption></figure>

Primero necesitaremos correr el siguiente comando para a continuación:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FATifUGpI0C2BKo2ZD6Yr%2Fimage.png?alt=media&#x26;token=e6c290c0-277c-4192-8b4e-a610ffb1136a" alt=""><figcaption></figcaption></figure>

Poder meter al final la reverse shell la cual nos dara acceso a esta maquina, a continuación, hacemos un nano del archivo creado y le añadimos al final la reverse shell la cual podreis encontrar en la pagina previamente mencionada (Truquito para ir hasta la ultima linea presionar ctrl+fin):

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FBfZUzP23SmXxWU65JYun%2Fimage.png?alt=media&#x26;token=1be3ab0b-cd28-466e-955b-a1671b70f591" alt=""><figcaption></figcaption></figure>

Abrimos otra pestaña y nos ponemos a la escucha por el puerto que hemos definido en la reverse shell

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FTTn7Y8WYMYBGJmTUrxv3%2Fimage.png?alt=media&#x26;token=178289dd-e3cf-49f8-8f3e-37f0fda5f65c" alt=""><figcaption></figcaption></figure>

Creamos un .css con un nano y introducimos nuestra IP y al puerto que estaremos escuchando:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FFVKYKgB9VERHDdxfalM6%2Fimage.png?alt=media&#x26;token=b9d00ac2-2700-47f1-8fe3-5914898ebe8c" alt=""><figcaption></figcaption></figure>

Cabe recalcar que hemos puesto nuestra IP porque vamos a abrir un servidor con python desde el cual este css cargara nuestro .php que contiene nuestra reverse shell, así, cargando la reverse shell maliciosa y consiguiendo acceso a la maquina. Abrimos el servidor de python:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2Fc40HTzVxL6Skhm1zSDjX%2Fimage.png?alt=media&#x26;token=f2792a8a-bd30-44d6-b4ff-e4c1e8ae83b9" alt=""><figcaption></figcaption></figure>

Nos creamos un .html el cual lo que hará es cargar el .css previamente creado, el cual a su vez cargara la reverse shell que nos dara acceso a el sistema/maquina:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FVtomWo5UJPYGhK6korqA%2Fimage.png?alt=media&#x26;token=070ae278-b72e-4cce-a9a3-a3d4ef67c02b" alt=""><figcaption></figcaption></figure>

Subimos el .html:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FAjcvo3V57ugQVJmGhiAU%2Fimage.png?alt=media&#x26;token=6c672ba1-d292-49c6-8297-893fe8469d11" alt=""><figcaption></figcaption></figure>

A continuación codificamos en md5sum como se veria la solicitud a nuestra reverse shell, que es como internamente tiene el sistema guardada nuestro archivo:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FHAoS4ZDXJ7mzVpkJO0ha%2Fimage.png?alt=media&#x26;token=9730634f-be0b-477f-a7de-8f3bcaf9c78a" alt=""><figcaption></figcaption></figure>

Entramos a el archivo y a nuestra maquina atacante nos debería llegar la reverse shell:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FEL6HjtUoXkuFrZwUtO5i%2Fimage.png?alt=media&#x26;token=60444cff-dc5c-4c17-bc65-3888b9412101" alt=""><figcaption></figcaption></figure>

## Escalación de privilegios

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

Hacemos un sudo -l para ver que archivos podemos ejecutar y nos encontramos que todos pueden ejecutar /home/eva/pdfgen.py, así que nos dirigimos al directorio y revisamos si podríamos editar el contenido del archivo, y en efecto podemos editar el archivo:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2Fav9kSuzY3vwL7uLk2gD6%2Fimage.png?alt=media&#x26;token=079a75b5-16a3-4db4-98ce-c13c7cdcb9d2" alt=""><figcaption></figcaption></figure>

Vamos a borrar el archivo y crear otro con el mismo nombre el cual nos de acceso root al sistema:

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2F5V5l4w3snIjlgexM9qZa%2Fimage.png?alt=media&#x26;token=a6d82b11-101b-4964-9253-3dd66cff52b7" alt=""><figcaption></figcaption></figure>

Ya tendriamos acceso root, las flags estan en los mismos sitios de siempre, /root y /home/eva

<figure><img src="https://2216970731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgI96Zsgdt6Oh2PlOLDwP%2Fuploads%2FnhnU02yHVnzsbaUzOeY8%2Fimage.png?alt=media&#x26;token=e20c014d-5f70-42bb-bd88-ab999315ca67" 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/hackmyvm/facil/convert.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.
