> For the complete documentation index, see [llms.txt](https://itskode.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://itskode.gitbook.io/pentesting/dockerlabs/facil/mirame.md).

# Mirame

## Enumeración

Se comienza con un escaneo de puertos para identificar servicios activos.

![](/files/1RwaTLHWeidGHQfKzr4f)

Se detectan servicios como SSH y HTTP.

Posteriormente, se realiza un escaneo de directorios:

![](/files/We2dYMcCeUSmZw9vNnsI)

***

## SQL Injection

Se prueba una inyección SQL en el campo de usuario introduciendo `'`, lo que provoca un error en la base de datos, confirmando la vulnerabilidad.

![](/files/bADoqEqgUZntsqZu2dqk)

Se utiliza sqlmap para extraer información:

```bash
sqlmap -u http://172.17.0.2/index.php --forms --dbs --batch --dump
```

<div align="left"><img src="/files/oQ5OMKDd3W8edR3zuXbe" alt=""></div>

Las credenciales obtenidas no permiten acceso, por lo que se continúa con la enumeración.

***

## Esteganografía

Se identifica una imagen sospechosa en la aplicación.

![](/files/FXwnZ23eWWxyKyY2XqH8)

Se utiliza `stegcracker` para encontrar una contraseña:

```bash
stegcracker miramebien.jpg /usr/share/wordlists/rockyou.txt
```

<div align="left"><img src="/files/FvhU5lwEYnYtf0YKsaIB" alt=""></div>

Se obtiene la contraseña: **chocolate**

Se extrae el contenido oculto:

```bash
steghide extract -sf miramebien.jpg
```

<div align="left"><img src="/files/157g4mNYHV8Y27sGl38C" alt=""></div>

Se obtiene un archivo comprimido protegido.

***

## Extracción de credenciales

Se intenta descomprimir el archivo, pero requiere contraseña.

<div align="left"><img src="/files/KTLvm4q4I7cv6FKfwokI" alt=""></div>

Se utiliza `john` para crackear la contraseña:

![](/files/zuaEdE9k9QaZWfVzXVWr)

Una vez extraído, se obtiene un archivo `secret.txt` con credenciales:

```
carlos:carlitos
```

<div align="left"><img src="/files/eTS79maklJS3w7AbRFS7" alt=""></div>

***

## Acceso inicial

Se accede por SSH con las credenciales obtenidas.

![](/files/PO4OV92hwDarcmXrbiIw)

***

## Escalada de privilegios

Se comprueba que el usuario no puede usar sudo:

<div align="left"><img src="/files/1Zlg385McXVYBBRsKwWZ" alt=""></div>

Se buscan binarios SUID:

```bash
find / -perm -4000 2>/dev/null
```

<div align="left"><img src="/files/s7a85OiFT7c6n6k4aJR4" alt=""></div>

Se identifica el binario `find` como vector de escalada.

Se utiliza el siguiente comando:

```bash
find . -exec /bin/sh \; -quit
```

<div align="left"><img src="/files/YN1sESj9P1bB6Qt72EIu" alt=""></div>

***

## Acceso root

Se obtiene acceso root en el sistema.

***

## Conclusión

Esta máquina demuestra:

* Vulnerabilidades de SQL Injection
* Uso de esteganografía para ocultar información sensible
* Riesgos de contraseñas débiles
* Escalada de privilegios mediante binarios SUID

***

## Recomendaciones

* Validar correctamente entradas en aplicaciones web
* Evitar almacenar datos sensibles en imágenes
* Utilizar contraseñas robustas
* Auditar permisos SUID en el sistema


---

# 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://itskode.gitbook.io/pentesting/dockerlabs/facil/mirame.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.
