Peter Rakolcza Get in touch
← back to archive
// technical_debrief Hard

Orion

Orion is a high-difficulty Linux machine featuring a web application with a critical deserialization vulnerability and a local privilege escalation vector via a misconfigured system service.

platform
Hack The Box
target_os
Linux (Ubuntu 22.04)
difficulty
Hard
season
Retired
logged
October 20, 2026
exploit_vectors → Web EnumerationRemote Code Execution (RCE)Initial AccessCredential Recovery

Summary of Exploitation

Orion is a high-difficulty Linux machine featuring a web application with a critical deserialization vulnerability and a local privilege escalation vector via a misconfigured system service. The attack chain proceeds as follows:

  1. Web Enumeration reveals a Craft CMS 5.6.16 installation on port 80. A vulnerability is identified where unhandled routes return verbose Yii debug pages, leaking internal filesystem paths.
  2. Remote Code Execution (RCE) — Exploiting CVE-2025-32432 in Craft CMS. By poisoning a PHP session via the returnUrl parameter and triggering the vulnerable assets/generate-transform endpoint, an unauthenticated RsE is achieved.
  3. Initial Access is established with a www-data reverse shell.
  4. Credential Recovery — Using the root credentials found in the application’s .env file, the MySQL database is accessed. The administrator’s bcrypt hash is cracked offline using rockyou.txt, revealing the password darkangel.
  5. User Pivot — The cracked password allows SSH access as the user adam.
  6. Privilege Escalation — A local service, telnetd (GNU inetutils 2.7), is running as root on localhost:23. Exploiting CVE-2026-24061 via a NEW-ENVIRON subnegotiation injection (passing USER=-f root) allows for an unauthenticated authentication bypass, granting a root shell.

Recon Phase

An initial scan of the target identified the primary web service:

nmap -sC -sV -oN orion-nmap.txt <target-ip>

Results (abridged):

Port State Service Version
80 open http nginx 1.18.0 — title: orion.htb
23 open telnet GNU inetutils telnetd 2.7 (localhost-only)

Key takeaways from recon:

  • Craft CMS 5.6.16 is running behind Nginx.
  • Local Telnet is running on 127.0.0.1:23 as root. This is a critical piece of information for local privilege escalation.

Web Enumeration

Port 80 — Craft CMS & Information Disclosure

Enumeration of the web application revealed it is running Craft CMS 5.6.16. A critical information disclosure vulnerability was identified: unhandled routes return verbose Yii debug/exception pages.

By requesting invalid paths, the server returned stack traces containing full filesystem paths: /var/www/html/craft/...

This confirmed the application environment and provided the necessary context to identify the target’s software stack and potential vulnerabilities.


Exploitation Phase

Step 1 — RCE via CVE-2025-32432

Craft CMS versions 5.6.16 and below are vulnerable to unauthenticated remote code execution via the assets/generate-transform endpoint. The vulnerability allows for object deserialization via the handle parameter.

Because the application implements CSRF protection, a standard exploit is difficult. However, a session-include gadget was used. By using the returnUrl parameter to inject a malicious payload into the PHP session, the subsequent call to the vulnerable endpoint triggers the deserialization of the poisoned session data.

Payload Execution: The exploit successfully executed phpinfo() and subsequently established a reverse shell.

Initial Foothold:

www-data@orion:~$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Step 2 — Cracking the Admin Password

After gaining a foothold, the .env file was located in the web root, containing the MySQL root credentials. Accessing the database revealed the administrator’s bcrypt hash.

# Cracking the hash with rockyou
hashcat -m 3200 <hash> /usr/share/wordlists/rockyou.txt

Password discovered: darkangel

Step 3 — User Pivot via SSH

Using the recovered credentials, an SSH session was established as the user adam.

ssh adam@<target-ip>
# Password: darkangel

Step 4 — Root via CVE-2026-24061

Local enumeration revealed a telnetd service running as root on localhost:23. This service (GNU inetutils 2.7) is vulnerable to an authentication bypass via environment variable injection during the NEW-ENVIRON subnegotiation.

By tunneling through the existing SSH session to 127.0.0.1:23 and sending a crafted Telnet negotiation sequence containing USER=-f root, the login utility is tricked into granting a shell without password authentication.

Exploit Sequence:

  1. Establish SSH tunnel to 127.0.0.1:23.
  2. Send IAC SB NEW_ENVIRON IS VAR USER VALUE -f root IAC SE.
  3. Receive root shell.

Root Flag Successfully Obtained:

root@orion:~# id
uid=0(root) gid=0(root) groups=0(root)
root@orion:~# cat /root/root.txt

Key Takeaways

  • Information Disclosure is a force multiplier. The Yii debug pages provided the filesystem structure and software versions required to select the correct exploit.
  • Session Poisoning. When direct RCE is blocked by CSRF or other protections, looking for ways to inject data into the session (like returnUrl) can bypass these defenses.
  • The “Localhost” Trap. Services listening only on 127.0.0.1 are not “safe.” They are prime targets for privilege escalation once a low-privileged foothold is established.
  • Environment Variable Injection. The ability of a service to pass user-controlled environment variables (like USER) to a system utility (login) is a classic, high-impact vulnerability.

Full Attack Chain

unauthenticated
   └─ Craft CMS 5.6.16 (CVE-2025-32432)  ──>  Session Poisoning
        └─ Reverse shell as `www-data`
             └─ .env file  ──>  MySQL Root Credentials
                  └─ Crack bcrypt hash  ──>  `darkangel`
                       └─ SSH login as `adam`
                            └─ Telnetd (CVE-2026-24061)  ──>  AUTH BYPASS
                                 └─ Root Shell [ROOT]