# OffSec MoneyBox

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

Empezamos por lo basico escaneo de puertos abiertos que en este caso tenemos tres.

```javascript
# Nmap 7.94SVN scan initiated Wed Jan 17 20:15:44 2024 as: nmap -sCV -p21,22,80 -oN taregte.txt 192.168.210.230
Nmap scan report for 192.168.210.230
Host is up (0.078s latency).

PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_-rw-r--r--    1 0        0         1093656 Feb 26  2021 trytofind.jpg
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:192.168.45.163
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 1
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 1e:30:ce:72:81:e0:a2:3d:5c:28:88:8b:12:ac:fa:ac (RSA)
|   256 01:9d:fa:fb:f2:06:37:c0:12:fc:01:8b:24:8f:53:ae (ECDSA)
|_  256 2f:34:b3:d0:74:b4:7f:8d:17:d2:37:b1:2e:32:f7:eb (ED25519)
80/tcp open  http    Apache httpd 2.4.38 ((Debian))
|_http-server-header: Apache/2.4.38 (Debian)
|_http-title: MoneyBox
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed Jan 17 20:15:54 2024 -- 1 IP address (1 host up) scanned in 10.65 seconds
```

Observamos las versiones y servicios que corren para cada uno de los tres puertos.

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

Empezamos nuestra enumeracion por ftp ya que nos podemos conectar como el usuario anonymous y econtramos una imagen vamos a descarla a local.

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

Si intentamos extraer lo que haya en la imagen con steghide nos pide pass carnal. Contraseña que no tenemos asi que pasamos a enumerar otra cosa haber si encontramos algo.

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

Si fuzzeamos el servidor web ecnontramos algunas rutas mas o menos interesantes vamos a observarlas.

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

Si nos vamos al directorio blog nos topamos con esto simple un mensaje para seguir participando en la rifa de la flag 😂😂.

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

Bromas si inspeccionamos el codigo fuente de este directorio blog nos encontramos una especie de clave la cual nos podria servir para el archivo de imagen que encontramos en ftp.

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

Con la clave encontrada ya podemos descomprimir lo que estaba en la imagen, el cual es un data.txt, que nos nos dice Hello renu, posible nombre usuario renu que no sabemos si a nivel de sistema existe, lo comporbaremos haciendo una ataque de fuerza bruta al SSH recordar que esta abierto lo haremos con este usuario.

<figure><img src="/files/40PHeobFLz8Om41d8Fit" alt=""><figcaption></figcaption></figure>

Efectivamente contraseña de mierda para el usuario renu, ahora vamos pa dentro por SSH.

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

Nos conectamos.

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

En el directorio de /home/lily esta una clave id\_rsa, la cual usamos para hacer un UserPivoting y migrar del usuario renu a lily. Lo hacemos.

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

Si hacemos un sudo -l observamos que lily puede ejecutar como root perl. Bueno si te vas a GTFObins y pones perl ahi te sale como usarlo para escalar privilegios.

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

```markdown
Seguimos las instrucciones y somos root.
```

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

Y buenos tenemos la ultima bandera la de root. se me olvido recoger la de user buscala estara por ahi, felicidades bombom si la logro resolver.


---

# 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://rodgar.gitbook.io/rodgar/plataformas/vulnhub/offsec-moneybox.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.
