I just solved DutyBound from Hack the Box!
DutyBound Machine Summary
DutyBound is a medium difficulty Linux machine on Hack The Box that focuses on standard industrial communication protocols, insecure graphical session controls, and loose validation in automated management tooling. The machine demonstrates how misconfigured internal access vectors and a lack of input sanitization in background administrative tasks can be chained together to achieve complete system compromise, highlighting the risks of exposed legacy protocols and excessive system-wide trust.
airsnacks.htb virtual host. After performing host configuration, subsequent web enumeration uncovers several sensitive endpoints, specifically an automated checkout workflow containing a boarding pass verification endpoint at /checkout/boarding-pass/verify.INSERT query handling the parsed BCBP parameters. By leveraging PostgreSQL error responses, database environment enumeration confirms that the active database role possesses high system privileges, specifically the pg_execute_server_program permission. This leads to a successful stacked query exploitation attempt utilizing COPY TO PROGRAM, weaponizing the injection vector to achieve initial access as the postgres user via a reverse shell.:0 alongside an Openbox window manager session owned by a separate user named dutyfree-kiosk. Active X11 access verification confirms that a global xhost + access policy is in place, meaning access control checks are completely disabled and local users can interact with the active session without authentication.Ctrl+Alt+T key sequence, which triggers the Openbox desktop environment to spawn an administrative xterm instance. Through X11 window enumeration and tracking internal window metadata, the newly generated terminal's process identifier is successfully captured. By executing input focus manipulation, keyboard focus is forced away from the primary application directly onto the hidden terminal, allowing automated keystroke delivery to run a staging script and grant a secondary reverse shell, achieving user access escalation as dutyfree-kiosk along with the user flag./opt/vrs/bin/apply-duty-rates.sh is found to process external data records using an unvalidated and dangerous eval expression. Cross-referencing this with systemd service enumeration confirms that a path watcher unit dynamically triggers this script to run with elevated privileges whenever changes are made to an associated configuration file.pos-ops group provides write permissions to the monitored /opt/vrs/data/duty-rates.csv path. By executing CSV payload injection, a malicious row containing nested shell commands is appended to the document before triggering the automatic path watcher execution. The elevated service automatically parses the file and triggers the hidden payload through the eval statement, yielding root access via a final reverse shell and allowing retrieval of the root flag to complete the machine.Protected Page
asdf
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
asdf
Keywords
HTB Writeup - TrustFall
HTB Writeup - Unclaimed
HTB Writeup - Garfield
HTB Writeup - PingPong
HTB Writeup - Connected
HTB Writeup - Nimbus
HTB Writeup - Enigma
HTB Writeup - Management
HTB Writeup - Layover
HTB Writeup - Touch
HTB Writeup - Stream
HTB Writeup - Autopilot
HTB Writeup - Takeoff
HTB Writeup - DutyBound
HTB Writeup - Paperwork
HTB Writeup - Bedside
HTB Writeup - DarkZeroReturns
HTB Writeup - Cohort
HTB Writeup - DanglingTree
HTB Writeup - BlockSynergy
HTB Writeup - Scaffold

0 Comments