A detailed walkthrough of the HackTheBox machine 'Gavel', a Linux box running a PHP auction website. The attack chain involves recovering source code from an exposed .git directory using git-dumper, exploiting a novel SQL injection that bypasses PDO's backtick-quoted prepared statements, cracking a bcrypt hash to access the admin panel, and leveraging PHP's runkit extension to inject arbitrary code for RCE. Privilege escalation involves password reuse to pivot users, then reverse engineering a custom PHP rule validation daemon. By overwriting php.ini using file_put_contents (which wasn't disabled), all PHP restrictions are removed, enabling a root shell via a second submission.

1h 36m read timeFrom 0xdf.gitlab.io
Post cover image
Table of contents
Box InfoReconShell as www-dataShell as auctioneerShell as rootBeyond Root - tmp Sandboxes

Sort: