Welcome to another Hack the Box walkthrough. In this blog post, I have demonstrated how I owned the Facts machine on Hack the Box. Hack The Box is a cybersecurity platform that helps you bridge knowledge gaps and prepares you for cyber security jobs.
About the Machine
Facts is an Easy Linux machine on Hack The Box that focuses on web application enumeration, CMS exploitation, cloud storage misconfigurations, credential harvesting, and privilege escalation through insecure system tooling. The machine demonstrates how multiple low-risk misconfigurations can be chained together to achieve full system compromise.
The attack begins with web enumeration, which reveals a Camaleon CMS-powered website along with accessible administrative endpoints. Further admin interface enumeration exposes a publicly accessible registration portal that allows user account creation. After gaining admin panel access, enumeration of backend functionality highlights weaknesses within user management features.
Through profile functionality enumeration, analysis of the password update mechanism reveals insecure parameter handling. During password update request analysis, parameter tampering enables privilege escalation by modifying role attributes. Logging back into the application confirms successful privilege escalation through expanded administrative interface access.
With administrative privileges established, vulnerability research leads to the discovery of CVE-2024-46987, a path traversal vulnerability affecting Camaleon CMS. Exploiting this flaw enables arbitrary file read exploitation, allowing retrieval of sensitive system files and local user enumeration.
Further investigation of backend configuration results in cloud storage credential discovery, revealing AWS S3 access keys stored within the CMS filesystem settings. Using these credentials enables AWS S3 enumeration, exposing internal storage buckets containing user home directory backups.
From the storage bucket, SSH key extraction yields a private key belonging to a local system user. After cracking the key passphrase, the credentials provide an initial foothold via SSH access to the host. Local enumeration then reveals sudo privileges for the facter utility, leading to privilege escalation enumeration.
Exploitation of facter’s custom fact loading functionality allows execution of arbitrary Ruby code as root. Through privilege escalation via facter custom fact injection, the attacker sets the SUID bit on the bash binary, ultimately obtaining full root access.
Overall, Facts is a well-structured machine that emphasizes the importance of secure role validation, proper handling of cloud credentials, and the risks associated with overly permissive sudo configurations. It provides a realistic attack chain that highlights how small security oversights across different system components can lead to complete compromise.
The first step in owning the Facts machine like I have always done in my previous writeups is to connect my Kali Linux terminal with Hack the Box server. To establish this connection, I ran the following command in the terminal:
Once the connection between my terminal and Hack the Box server has been established, I started the Guardian machine and I was assigned an IP address 10.129.244.96.
Initial Enumeration
I began enumeration by performing a full TCP scan against the target to identify exposed services, service versions, and potential attack vectors. To achieve this, I ran Nmap with default scripts, version detection, and aggressive enumeration enabled:
The scan confirmed that the host was reachable and revealed two open TCP ports. Port 22 was running OpenSSH 9.9p1 on Ubuntu, indicating that SSH access was available on the system. The service exposed ECDSA and ED25519 host keys, both of which use modern cryptographic algorithms. Based on the service version alone, I did not identify any immediate vulnerabilities, which suggested that gaining SSH access would likely require valid credentials or key material obtained during later enumeration.
I also discovered that port 80 was open and running nginx 1.26.3, hosting a web application titled facts. Since web applications commonly provide entry points in HTB machines, I prioritized this service for further investigation. The HTTP server headers confirmed the application was hosted on an Ubuntu-based system, which aligned with the SSH service fingerprint.
Host Configuration
During enumeration, I noticed that the Nmap scan resolved the target IP address to the hostname facts.htb, indicating that the web application was likely configured to respond to requests directed at this domain. To ensure proper name resolution and avoid potential virtual host routing issues, I manually added the domain mapping to my local /etc/hosts file.
To accomplish this, I appended the target IP address and hostname using the following command:
This allowed my system to resolve facts.htb directly to the target machine. Configuring local DNS resolution is often necessary in CTF environments, as many applications rely on hostname-based routing and may not function correctly when accessed directly via IP address.
With the hostname properly configured, I proceeded with further enumeration of the web application using the facts.htb domain to ensure accurate interaction with the target service.
Web Enumeration
After confirming that the web service on port 80 was accessible, I proceeded with directory and file enumeration to identify hidden endpoints, application functionality, and potential attack surfaces. To accomplish this, I used Feroxbuster with a commonly used medium-sized directory wordlist:
The scan returned several valid endpoints that provided insight into the structure of the web application. Multiple accessible pages were discovered, including /search, /page, /sitemap, and /rss, which indicated that the application was likely content-driven and dynamically generated. Several article-style pages such as /first-impressions, /cute-animals, /anne-frank, and /dark-chocolate were also identified, suggesting the site was hosting blog-style or CMS-managed content.
While reviewing the results, I observed references to assets associated with Camaleon CMS, specifically within the /assets/themes/camaleon_first/ directory. The presence of these files strongly suggested that the target application was built using Camaleon CMS, which provided valuable context for potential vulnerability research and attack surface identification.
The enumeration also revealed that the /randomfacts/ directory returned a 403 Forbidden response. This indicated that the directory existed but access was restricted, making it a potential candidate for bypass attempts or deeper enumeration later in the assessment.
Most notably, Feroxbuster discovered the /admin endpoint, which redirected to /admin/login via an HTTP 302 response. The presence of an administrative login portal immediately stood out as a high-value target, as CMS administrative panels often become entry points through credential attacks, authentication bypasses, or CMS-specific vulnerabilities.
With confirmation that the target was running a CMS platform and an administrative login interface exposed, I prioritized further investigation of the application’s authentication mechanisms, accessible content, and potential CMS-specific vulnerabilities.
Admin Interface Enumeration
While continuing to enumerate the administrative functionality of the application, I navigated to the /admin/register endpoint by visiting:
Accessing this endpoint presented a user registration interface that allowed the creation of new accounts within the application. The registration form required personal information fields including first name, last name, and email address. In addition, the page requested authentication details such as a username and password, along with a CAPTCHA verification step designed to prevent automated registrations.
The presence of a publicly accessible administrative registration page immediately suggested the possibility of self-service account creation. In CMS-based applications, exposed registration portals can sometimes allow unauthorized users to create accounts with elevated privileges if role validation or access controls are improperly implemented.
Since authentication mechanisms often serve as entry points in web-based CTF challenges, I identified this functionality as a high-value target for further testing. I proceeded to analyze how user accounts were provisioned, whether role assignment could be manipulated during registration, and if the CAPTCHA or input validation mechanisms could be bypassed.
Admin Panel Access
After successfully creating a user account through the registration portal, I authenticated using the newly created credentials. Upon login, I was redirected to the administrative dashboard located at /admin/dashboard, confirming that account registration granted access to the backend management interface.
Once inside the admin panel, I began reviewing the interface to understand the underlying platform and identify potential attack vectors. During this inspection, I observed a footer banner displaying Camaleon CMS along with the application version number. The footer confirmed that the site was running Camaleon CMS version 2.9.0.
Identifying the CMS and its version was a significant finding, as it allowed me to shift enumeration efforts toward researching publicly known vulnerabilities, misconfigurations, or exploit chains associated with this specific version. CMS platforms frequently contain plugin ecosystems, file upload functionality, and administrative features that can introduce exploitable weaknesses.
With confirmation of the exact CMS version in use, I proceeded to investigate Camaleon CMS 2.9.0 for known vulnerabilities and potential exploitation paths that could lead to further access or remote code execution.
Profile Functionality Enumeration
After gaining access to the administrative dashboard, I continued enumerating available functionality within the backend interface. While reviewing the navigation options, I accessed the user dropdown menu located in the top-right corner of the dashboard and selected the Profile option. This action redirected me to the user profile management section of the application.
Navigating through profile-related functionality is an important enumeration step, as account management features frequently contain logic flaws, insecure input validation, or authorization weaknesses that can be leveraged for privilege escalation or credential manipulation.
From the profile page, I proceeded to the profile edit endpoint located at:
Upon accessing this page, I observed functionality allowing modification of user account details. Notably, selecting the Change Password option triggered a modal window prompting for a new password and confirmation input.
The presence of password modification functionality introduced a potential attack surface worth further investigation. Profile update and password reset mechanisms are commonly targeted during web application assessments, as they may expose vulnerabilities such as weak validation controls, insufficient authorization checks, or opportunities for parameter tampering.
Based on this discovery, I prioritized analyzing the password update workflow to determine whether it could be manipulated to affect other users, bypass security controls, or introduce privilege escalation opportunities.
Password Update Request Analysis
While reviewing the password change functionality, I decided to intercept the request using Burp Suite to better understand how the application handled profile update operations. I initiated a password change from the profile edit page and captured the request in Burp Suite before forwarding it to the Repeater tab for manual testing.
The intercepted request revealed that password updates were processed through the /admin/users/6/updated_ajax endpoint using a POST request. The request body contained parameters responsible for updating the password fields, including password[password] and password[password_confirmation], along with an authenticity token used for CSRF protection.
During inspection of the request structure, I noticed that user-related attributes were passed as nested parameters within the request body. This raised the possibility of parameter tampering, specifically targeting fields that might not be properly validated or restricted by the backend application.
To test this theory, I appended an additional parameter to the request body:
This modification attempted to assign the admin role to my account during the password update process. After adjusting the request and updating the content length accordingly, I sent the modified request through Burp Repeater.
The server responded with an HTTP 200 OK status and issued updated session cookies, indicating that the request had been successfully processed without triggering validation errors or authorization checks. The absence of input filtering or role enforcement suggested that the application accepted the manipulated parameter and applied it to the user account.
This behavior confirmed the presence of a parameter tampering vulnerability, allowing modification of user privilege levels through unauthorized request manipulation. By exploiting this flaw, I was able to elevate my account privileges beyond the originally assigned role.
With administrative privileges potentially obtained through this vulnerability, I proceeded to re-evaluate accessible functionality within the CMS backend to identify further exploitation opportunities.
Privilege Escalation Confirmation
To verify whether the parameter tampering attack successfully elevated my privileges, I logged out of the application and authenticated again using the same account credentials. Upon logging back into the administrative portal, I observed a significant change in the available interface functionality.
Previously, my account had limited access within the backend panel. After re-authentication, the navigation sidebar displayed several additional administrative modules, including Contents, Media, Comments, Appearance, Plugins, Users, and Settings. The presence of these sections confirmed that my account had been granted elevated privileges consistent with an administrator role.
Access to these administrative modules substantially expanded the attack surface of the application. In particular, sections such as Plugins, Appearance, and Media are commonly associated with file upload functionality, theme customization, and plugin management, which frequently introduce opportunities for code execution or configuration manipulation in CMS-based platforms.
This confirmed that the earlier request manipulation successfully resulted in privilege escalation. With administrative access now established, I proceeded to enumerate available backend features to identify functionality that could be leveraged for further exploitation.






















.gif)



0 Comments