LaVita Proving Grounds Write-Up
SUMMARY
This write-up covers the LaVita machine from Offsec’s Proving Grounds, a multi-stage Linux machine requiring lateral movement before privilege escalation.
Port 80 hosted a web application built on Laravel. Navigating to a non-existent path triggered a Laravel error that leaked the version as 8.4.0, vulnerable to CVE-2021-3129. This vulnerability abuses debug mode to achieve remote code execution via log poisoning. A public exploit confirmed RCE and a reverse shell was received as www-data.
pspy revealed a cronjob running php artisan as user skunk. The artisan file was owned by www-data with write access, so it was replaced with a PHP reverse shell script. After the cronjob fired, a shell as skunk was received. As skunk, sudo -l showed the ability to run composer as root. The GTFOBins technique for composer placing a malicious composer.json in the target directory and running sudo composer spawned a root shell.
PATH TO FOLLOW
- Reconnaissance & Laravel Version Leak via Error Page
- CVE-2021-3129 RCE via Debug Mode
- Reverse Shell as
www-data - Cronjob Discovery via
pspy— WritableartisanScript - PHP Shell in
artisan→ Lateral Movement toskunk - Sudo
composerAbuse via GTFOBins - Shell as Root
Due to OffSec’s policy on content sharing, these write-ups will provide hints only rather than full solutions.I know, boring stuff.