> For the complete documentation index, see [llms.txt](https://oliver-3.gitbook.io/redteam-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oliver-3.gitbook.io/redteam-notes/dockerlabs/database.md).

# Database

Herramientas implementadas: nmap, sqlmap, john the ripper, hydra

En un escaneo de puertos, el cual me devuelve la informacion de 4 puertos abiertosIniciando por el puerto 80 me encuentro con un panel de login

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2FO5xfVYNUNddUV9la1FWX%2Fimage.png?alt=media&#x26;token=1b49834c-7443-473e-bd36-61e60db7a3f9" alt=""><figcaption></figcaption></figure>

En el codigo fuente no hay informacion relevante, por lo que intento aplicar inyeccion sql de forma manual

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2FvEfVeg6lqHU0lH9lk4nq%2Fimage.png?alt=media&#x26;token=ce1e1b04-8c6b-4c3b-af5c-56898558e425" alt=""><figcaption></figcaption></figure>

Logrando obtener acceso y lo que parece un posible usuario. Al ser un unico usuario, intente realizar fuerza bruta con HYDRA, asique mientras se ejecutaba, aproveche y simultáneamente lance un enum4linux al puerto 445 para enumerar este servicio más en profundidad.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2FFVFQDyWuUPnF6dqoA4AR%2Fimage.png?alt=media&#x26;token=a38183b4-286c-4867-af04-c0bae57c5a59" alt=""><figcaption></figcaption></figure>

Encontrando asi 2 usuarios nuevos, ademas del ya ubicado al logearnos en el puerto 80. Por lo que creo un archivo llamado "users.txt" y ejecuto un ataque de fuerza bruta nuevamente, pero con 3 posibles usuarios

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2FAy0IVfVB5jCj7Se9dxMH%2Fimage.png?alt=media&#x26;token=695e5658-bf19-4476-abcb-8c6a209ce8a2" alt=""><figcaption></figcaption></figure>

Esta vez el ataque de fuerza bruta si tiene exito, por lo que prosegui a intentar conectarme via el servicio ssh del puerto 22

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2Fw0ewM6VrMq0cNKIrxAs7%2Fimage.png?alt=media&#x26;token=7e08c257-40be-449b-9ff9-5ea5149bd206" alt=""><figcaption></figcaption></figure>

Una vez dentro, quedaria escalar privilegios. Asi que pruebo buscando bit SUID que pueda explotar para obtenerlo

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2FbWLT1zhscZqynikm4Bnw%2Fimage.png?alt=media&#x26;token=9e935ec4-b050-4d7b-a3c3-f62a493fb615" alt=""><figcaption></figcaption></figure>

Y de esta manera obtener el escalamiento de privilegios

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFLJd1oOCK7xiQmOAEfVk%2Fuploads%2Ffj8OiqqeCcU49DUYzoN8%2Fimage.png?alt=media&#x26;token=688ee601-bb88-4936-9d12-73fe9b11efa9" 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://oliver-3.gitbook.io/redteam-notes/dockerlabs/database.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.
