DEV Community

Victor
Victor

Posted on

Support — TryHackMe Write-up

1. Introduction

In this write-up, I will document my experience completing the Support room on TryHackMe, focusing on several web application vulnerabilities and authentication weaknesses discovered during the assessment.

The challenge involved multiple stages of web exploitation, starting with reconnaissance and credential discovery, followed by authentication bypass, API enumeration, Broken Object Level Authorization (BOLA), path traversal, and Local File Inclusion (LFI) leading to command injection.

Throughout the assessment, I primarily used Gobuster, Burp Suite, curl, and CyberChef to enumerate the application, intercept HTTP requests, manipulate authentication cookies, and investigate vulnerable application functionality.

Rather than relying on a single vulnerability, this room required connecting several security weaknesses to progress through the application and obtain both flags.


2. Reconnaissance and Enumeration

I started by identifying the exposed services and enumerating the web application.

The initial inspection revealed a Support Operations Panel with an employee authentication form. The application appeared to provide internal functionality for managing support operations, infrastructure access, and incident response.

I then performed directory enumeration using Gobuster to discover hidden directories and potentially interesting application resources.

gobuster dir \
  -u http://<TARGET_IP> \
  -w /usr/share/wordlists/dirb/common.txt
Enter fullscreen mode Exit fullscreen mode

The scan revealed several interesting paths:

  • /includes/
  • /index.php
  • /info.php
  • /skins/

The discovery of /includes/ and /skins/ was particularly interesting because these directories could contain application components or dynamically loaded resources.

I explored the discovered directories and found that directory listing was enabled.

The /includes/ directory exposed files such as:

  • header.php
  • skin.php

I also discovered that /skins/ contained several theme files, including blue.php, default.php, green.php, and red.php.

These findings became useful later when investigating the application's file inclusion functionality.


3. Authentication Testing and Password Discovery

After identifying the login functionality, I began investigating the authentication mechanism.

I used Burp Suite to intercept the login request and sent it to Intruder. I configured the password parameter as a payload position and loaded a password list for testing.

The objective was to identify a valid password for the employee account:

help@support.thm

After running the Intruder attack, I compared the HTTP responses to identify differences between unsuccessful and successful authentication attempts.

One response returned a different HTTP status code and response behavior, indicating a potentially successful authentication attempt.

After successfully authenticating, I inspected the HTTP response and discovered an interesting cookie:

Set-Cookie: isITUser=68934a3e9455fa72420237eb05902327
Enter fullscreen mode Exit fullscreen mode

This suggested that the application might be using a client-side cookie to determine whether the authenticated user had IT administrator privileges.

I suspected that the value was an MD5 hash, so I used CyberChef to decode and investigate it.

The hash corresponded to the string 0, which represented a false value.

I then tested the corresponding MD5 hash for 1, which produced:

b326b5062b2f0e69046810717534cb09
Enter fullscreen mode Exit fullscreen mode

This indicated that the application was potentially relying on a predictable client-side value to determine authorization privileges.

I modified the cookie in Burp Suite:

Cookie: isITUser=b326b5062b2f0e69046810717534cb09
Enter fullscreen mode Exit fullscreen mode

After sending the modified request, I was able to access functionality associated with the IT user role.

Key finding

The application trusted a client-controlled cookie to determine the user's privilege level.

Using a predictable MD5 representation of a Boolean value is not a secure authorization mechanism. Authentication and authorization decisions should be enforced server-side, using protected session data and proper role-based access control.


4. Internal API Enumeration — BOLA

After obtaining access to the application, I investigated its internal API functionality.

The application exposed an internal user API at:

/api.php
Enter fullscreen mode Exit fullscreen mode

The API page indicated that the authenticated helpdesk user could query their own profile through the following endpoint:

GET /user/3
Enter fullscreen mode Exit fullscreen mode

The response contained information about the current account:

{
  "email": "help@support.thm",
  "2FA": false,
  "admin": false
}
Enter fullscreen mode Exit fullscreen mode

The interesting part was that the API exposed a user identifier in the request path.

I suspected that the application might not properly verify whether the authenticated user was authorized to access the requested user object.

I therefore investigated whether changing the object identifier would allow access to another user's information.

Exploiting BOLA

I modified the requested user identifier from 3 to 1.

The following is a curl example illustrating the endpoint manipulation. The exact route and session cookie should match the HTTP request captured in Burp Suite.

curl -i \
  'http://<TARGET_IP>/api.php/user/1' \
  -H 'Cookie: PHPSESSID=<REDACTED>; PHPSESSID=<SESSION_ID>'
Enter fullscreen mode Exit fullscreen mode

If the application uses a rewritten API route, preserve the actual request path observed in the browser rather than assuming a different query parameter.

The modified request allowed me to investigate another user's profile and identify that user ID 1 belonged to the administrator.

This demonstrated a Broken Object Level Authorization (BOLA) vulnerability.

BOLA is one of the major security risks identified in the OWASP API Security Top 10. It occurs when an API fails to verify whether a user is authorized to access a specific object.

Key finding

Changing an object identifier should never be sufficient to access another user's information.

The API should validate object-level permissions on every request, regardless of whether the requester has successfully authenticated.


5. Path Traversal — Configuration File Disclosure

After identifying the administrator account, I continued investigating the application's dashboard functionality.

During the assessment, I noticed that the dashboard included a theme-selection feature.

The application used a parameter named:

dashboard.php?skin=
Enter fullscreen mode Exit fullscreen mode

Since the application also exposed a /skins/ directory, I suspected that the parameter might be used to dynamically include PHP files.

I decided to test whether the application properly validated the supplied file path.

I attempted directory traversal using:

../config
Enter fullscreen mode Exit fullscreen mode

By manipulating the skin parameter, I was able to access a file outside the intended directory.

Configuration disclosure

I continued testing the file inclusion behavior and eventually accessed the application's configuration file.

The response exposed sensitive configuration information, including a variable named:

$MASTER_PASSWORD
Enter fullscreen mode Exit fullscreen mode

Password values ​​have been intentionally omitted from this document. The value for MASTER_PASSWORD is not the actual password; the developer added an '@' character as a manual obfuscation technique to evade security scanning tools. Therefore, the actual password is the value without the '@' character.

This was an important finding because the configuration file contained information that should never have been accessible through a user-controlled file inclusion parameter.

Key finding

The application did not sufficiently restrict the file path supplied through the dashboard's skin parameter.

This allowed directory traversal and disclosure of sensitive configuration information.


6. Administrator Authentication

With the configuration information obtained, I proceeded to investigate the administrator authentication mechanism.

I used the discovered master password to authenticate through the application's login functionality.

After submitting the credentials, the application granted access to the administrator functionality.

The dashboard displayed an administrator access confirmation.

At this stage, I had successfully escalated access from the initial helpdesk account to administrator-level functionality.

I then captured the first flag.

The flag value is intentionally not included.


7. Local File Inclusion and Command Injection

After obtaining administrator access, I continued exploring the dashboard functionality.

I noticed a time-selection feature that appeared to retrieve information dynamically.

I intercepted the related HTTP request using Burp Suite and inspected the request parameters.

One parameter caught my attention:

sys=
Enter fullscreen mode Exit fullscreen mode

The application appeared to use this parameter to execute a date-related system command and display the resulting output in the dashboard.

This suggested that the backend might be passing user-controlled input into a system command.

Testing command execution

I first inspected the normal request behavior and identified that the application accepted a date command.

For example:

sys=date+%2B%22%25H%3A%25M%3A%25S%22
Enter fullscreen mode Exit fullscreen mode

The application returned the formatted time as expected.

I then investigated whether additional shell commands could be appended to the existing command.

The objective was to determine whether the application properly restricted command execution or simply filtered specific input patterns.

Command injection attempt

I modified the existing sys value by appending an additional command using a semicolon.

The following payload was used during testing:

;%20cat%20%2E%2E/%2E%2E/%2E%2E//home/ubuntu/user%2Etxt
Enter fullscreen mode Exit fullscreen mode

The complete parameter value was constructed by appending the payload to the existing date command.

This testing demonstrated why allowing user-controlled input to reach operating-system commands is dangerous.

The application attempted to restrict the functionality to date commands, but command filtering is not a reliable replacement for safe command execution.

After completing the final exploitation step, I obtained the second flag.

The flag value is intentionally not included.


8. Lessons Learned

This room provided a practical demonstration of how multiple weaknesses can be chained together to compromise a web application.

The most important vulnerabilities and concepts I encountered were:

Vulnerability Security impact
Weak password Unauthorized account access
Client-side authorization cookie Privilege escalation
BOLA / IDOR Unauthorized access to other user objects
Path Traversal Sensitive configuration disclosure
Local File Inclusion Unauthorized local file access
Command Injection Potential operating-system command execution

Security recommendations

From a defensive perspective, the following improvements would help prevent similar attacks:

  1. Authentication: Enforce strong password policies, rate limiting, and account lockout protections.
  2. Authorization: Never trust client-controlled cookies to determine administrator privileges.
  3. Session management: Store authorization state securely on the server and protect session cookies.
  4. API security: Implement object-level authorization checks for every API request.
  5. File inclusion: Use strict allowlists for permitted theme files instead of accepting arbitrary filesystem paths.
  6. Sensitive information: Prevent direct access to configuration files and secrets.
  7. Command execution: Avoid passing user-controlled input to shell commands. Prefer safe APIs and strict input validation.

9. Conclusion

The Support room was an interesting exercise because it demonstrated how seemingly small implementation mistakes can be chained into a much larger security compromise.

What initially appeared to be a straightforward employee login page eventually exposed several weaknesses involving authentication, authorization, API security, file inclusion, and command execution.

My biggest takeaway from this room was the importance of examining how different application components interact rather than focusing on individual vulnerabilities in isolation.

In a real-world penetration test, identifying a weakness is only the first step. Understanding its impact, finding opportunities to chain it with other weaknesses, and documenting the complete attack path are equally important.


Technical Notes

  • Author: Victor Hoang
  • Platform: TryHackMe
  • Room: Support
  • Category: Web Application Security / Web Exploitation
  • Difficulty: Medium
  • Tools: Burp Suite, Gobuster, curl, CyberChef
  • Key Techniques: Password Brute Force, Authentication Bypass, MD5 Analysis, BOLA, Path Traversal, LFI, Command Injection
  • Exploit References: OWASP API Security Top 10 — API1: Broken Object Level Authorization; OWASP Path Traversal; OWASP Command Injection

All activities were performed in the authorized TryHackMe lab environment. Sensitive credentials and flag values have been intentionally excluded.

Top comments (0)