Recruit – TryHackMe Write-up

1. Introduction

In this write-up, I will document my experience completing the Recruit room on TryHackMe, focusing on web enumeration, information disclosure, SQL injection, and privilege escalation within a recruitment management application.

The challenge provides a web application called Recruit, which appears to be an internal recruitment portal used by an HR department to manage candidate applications.

During the assessment, I explored the available web endpoints, investigated exposed resources, analyzed application configuration files, and tested the candidate search functionality.

One of the most interesting discoveries was that the application exposed internal information through multiple endpoints. By combining these findings with SQL injection testing, I was able to enumerate the backend database and eventually reach the administrative interface.

This room was a good opportunity to practice a realistic web application assessment workflow, especially the importance of connecting seemingly unrelated information disclosure vulnerabilities.

2. Initial Reconnaissance

After starting the machine, I accessed the target web application through its IP address.

The first page presented a login form with the application name Recruit. There was also an Access API link below the login interface.

At this stage, I did not have any credentials, so I started with basic web reconnaissance.

2.1 Directory Enumeration

I used Gobuster to identify publicly accessible directories and files.

gobuster dir \ -u http://<TARGET_IP> \ -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt 

The scan identified several interesting paths:

  • /mail
  • /javascript
  • /phpmyadmin

I also performed another enumeration using a smaller common wordlist, which revealed additional resources, including /assets, /finder, and /sitemap.xml.

These discoveries gave me several potential attack surfaces to investigate.

Rather than focusing exclusively on the login page, I decided to inspect the publicly accessible directories first.

3. Information Disclosure – Exposed Mail Directory

One of the interesting discoveries was the /mail directory.

When I accessed it, the server displayed a directory listing containing a file named mail.log.

http://<TARGET_IP>/mail/ 

I opened the log file to investigate whether it contained useful information.

The mail log contained an internal email from the HR Operations team confirming that the recruitment portal had been deployed successfully.

More importantly, the email included several deployment details:

  • The recruitment portal login page was accessible.
  • The candidate dashboard was functioning.
  • API documentation was available.
  • HR login credentials were temporarily stored in the application's configuration file.
  • Administrator credentials were maintained in the backend database.

This was a significant finding.

The email provided information about the application's authentication architecture and suggested that configuration files could contain useful credentials.

Instead of guessing passwords or attempting brute force, I now had a concrete lead to investigate.

4. Sitemap Analysis

Next, I examined the application's sitemap.xml.

http://<TARGET_IP>/sitemap.xml 

The sitemap contained several interesting endpoints and comments describing their intended functionality.

Among the discovered paths were:

  • /file.php – CV Retrieval Service
  • /mail/ – Mail resources
  • /dashboard.php – Authenticated dashboard
  • /logout.php – Logout functionality
  • /assets/ – Static assets

The comments also mentioned that some directories might contain internal documentation or logs and that certain endpoints were intended for internal HR integrations.

This information helped me understand the application's structure and identify another endpoint worth investigating.

In particular, I focused on the CV retrieval service.

5. Investigating the CV Retrieval Endpoint

The sitemap identified file.php as the CV Retrieval Service.

I accessed the endpoint directly:

http://<TARGET_IP>/file.php 

The application returned:

Missing cv parameter 

This indicated that the endpoint expected a parameter named cv.

I decided to investigate how this parameter was processed and whether the endpoint exposed sensitive application files.

During testing, I discovered that the endpoint could return the application's configuration information.

The disclosed configuration included:

  • Application name: Recruit
  • Environment: production
  • Application version: 1.2.4
  • Debug mode: disabled
  • Temporary HR credential configuration
  • API configuration information

The configuration file was particularly valuable because it contained a credential field associated with the initial deployment.

I have intentionally omitted the credential itself from this write-up.

Security observation

Exposing application configuration files is a serious information disclosure issue.

Depending on the contents, these files may reveal:

  • Database credentials.
  • Application secrets.
  • Authentication configuration.
  • API keys.
  • Internal service information.

In a production environment, configuration files should never be directly accessible through public file retrieval functionality.

6. Exploring the Recruitment Dashboard

After investigating the exposed resources, I returned to the main recruitment application.

The dashboard displayed a candidate application table containing several records.

The available information included:

ID Candidate Position Status
1 Alice Johnson Frontend Developer Approved
2 Bob Smith Backend Developer Under Review
3 Charlie Brown Security Analyst Rejected
4 Diana Prince HR Executive Selected

There was also a search field that allowed users to search for candidates by name.

At first glance, the search functionality appeared straightforward.

However, search parameters are an important area to test during web application security assessments because they are frequently used to construct backend database queries.

I decided to investigate how the application handled user-controlled input.

7. Identifying SQL Injection

I started by submitting a single quotation mark (') through the candidate search field.

The application returned a SQL error:

SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%"' at line 1 

This was an important observation.

The error indicated that the application was likely constructing a SQL query using the supplied search parameter without correctly handling special characters.

A database syntax error alone does not conclusively prove SQL injection, but it provided a strong indication that the input required further testing.

7.1 Capturing the HTTP Request

To investigate the parameter more carefully, I captured the request generated by the application.

The relevant request was:

GET /dashboard.php?search=%27 HTTP/1.1 Host: <TARGET_IP> User-Agent: Mozilla/5.0 Accept: text/html Cookie: PHPSESSID=<SESSION_ID> 

The important parameter was:

search 

I saved the complete HTTP request into a file named request.txt.

This allowed me to reproduce the request consistently during further testing.

7.2 SQL Injection Testing with SQLmap

After identifying the potentially vulnerable parameter, I moved to SQLmap.

I used the captured HTTP request instead of manually constructing a new request.

My initial database enumeration command was:

sqlmap -r request.txt --dbs 

During testing, SQLmap identified the backend database management system as MySQL.

The application environment was also identified as:

  • Operating System: Linux Ubuntu
  • Web Server: Apache 2.4.41
  • Database: MySQL

SQLmap successfully identified the injection point and retrieved the available database names.

The discovered databases included:

information_schema mysql performance_schema phpmyadmin recruit_db sys 

The database that caught my attention was:

recruit_db 

This appeared to be the application's primary database.

8. Database Enumeration

With the database identified, I continued investigating its structure.

First, I enumerated the available tables:

sqlmap -r request.txt -D recruit_db --tables 

SQLmap returned two tables:

Database: recruit_db Tables: - candidates - users 

The table names revealed a basic separation between candidate application records and user authentication information.

The candidates table appeared to contain recruitment-related information, while the users table was particularly interesting because it likely stored application accounts.

8.1 Enumerating the Users Table

Next, I investigated the structure and contents of the users table.

I used:

sqlmap -r request.txt -T users --dump 

SQLmap successfully retrieved the table information.

The table contained the following columns:

id password username 

It also reported one database entry.

I have intentionally excluded the actual credential values from this write-up.

This finding confirmed that the SQL injection vulnerability was not limited to retrieving candidate information. It also allowed access to the application's user database.

From a security perspective, this represented a much more serious impact because authentication-related information was accessible through the vulnerable search functionality.

9. Accessing the Administrative Dashboard

After investigating the application configuration and backend database, I continued following the authentication-related information uncovered during the assessment.

The final stage of my investigation led to the administrative dashboard.

Compared with the earlier candidate dashboard, the administrative interface contained additional functionality.

In particular, the candidate table now included action buttons:

  • Approve
  • Reject

The dashboard also displayed an administrator-related banner.

This confirmed that the application exposed functionality beyond the ordinary candidate viewing interface.

It also demonstrated the potential impact of combining information disclosure with SQL injection in an application that handled sensitive recruitment information.

I have deliberately kept the flag and credential values out of this article.

10. Vulnerability Analysis

Looking back at the investigation, several security weaknesses contributed to the overall attack surface.

10.1 Information Disclosure

The publicly accessible /mail/ directory exposed an internal mail log containing deployment information.

Impact: An attacker could learn about internal infrastructure, authentication mechanisms, and potentially sensitive deployment details.

10.2 Sensitive File Disclosure

The CV retrieval endpoint exposed application configuration information.

Impact: Configuration disclosure can expose credentials, secrets, and other sensitive application information.

10.3 SQL Injection – CWE-89

The candidate search parameter was vulnerable to SQL injection.

The application returned SQL syntax errors when special characters were supplied, and SQLmap successfully identified the MySQL backend and enumerated the database.

Impact:

  • Database enumeration.
  • Access to candidate-related information.
  • Exposure of authentication-related database records.
  • Potential compromise of application accounts.

10.4 Insufficient Access Control

The administrative dashboard contained additional candidate management functionality.

The assessment demonstrated why access to sensitive administrative operations must be protected by server-side authorization checks.

An application should never rely solely on hiding interface elements or assuming that a user cannot access an administrative function.

11. Lessons Learned

This room reinforced several important lessons for practical web application security testing.

  1. Start with reconnaissance. Public directories, sitemap files, and exposed logs can reveal valuable information about an application's architecture.

  2. Investigate every interesting endpoint. A file retrieval endpoint might expose more than the intended document if input validation is insufficient.

  3. Pay attention to error messages. Database errors can provide useful indicators of unsafe query construction.

  4. Capture and reproduce HTTP requests. Saving requests in Burp Suite-compatible formats makes automated testing with SQLmap much easier.

  5. Understand database relationships. Identifying tables such as candidates and users helps establish which application components may be affected.

  6. Think about the combined impact. Multiple low-level weaknesses can create a much more serious security issue when chained together.

Recommended Mitigations

From a defensive perspective, I would recommend:

  • Use parameterized SQL queries and prepared statements.
  • Disable public directory listing.
  • Prevent direct access to application configuration files.
  • Implement strict file path validation for document retrieval.
  • Store credentials securely using appropriate password hashing.
  • Enforce role-based access control on administrative operations.
  • Avoid exposing detailed database errors to users.
  • Monitor suspicious search requests and repeated database errors.

12. Conclusion

The Recruit room was a useful practical exercise in web application penetration testing.

What I particularly enjoyed was how the investigation developed through several different attack surfaces rather than relying on a single vulnerability.

I started with basic directory enumeration, discovered an exposed mail log, analyzed the sitemap, and investigated the CV retrieval endpoint.

Later, I identified a SQL injection vulnerability in the candidate search functionality and used SQLmap to enumerate the backend MySQL database.

The most important takeaway for me was that web application security assessments should not focus on individual vulnerabilities in isolation.

Understanding how information disclosure, SQL injection, and authentication weaknesses interact is essential when evaluating the real-world impact of an application compromise.

Another room completed, and another opportunity to improve my practical web security testing skills.

Write-up Information

Field Details
Author Victor Hoang
Platform TryHackMe
Room Recruit
Category Web Application Security
Difficulty Medium
Target Recruitment Management Portal
Main Vulnerability SQL Injection
Additional Findings Information Disclosure, Sensitive File Disclosure
Database MySQL
Tools Gobuster, curl, SQLmap, Browser
Exploit Reference CWE-89, CWE-200, OWASP SQL Injection

Note: Flags, passwords, and sensitive credential values have intentionally been excluded from this write-up.