Cobblestone from HackTheBox features a second-order SQL injection, stored XSS to hijack an admin session, and Twig template injection for code execution under AppArmor. Then multiple paths to root through Cobbler running as root.
0xdf.gitlab.io
HTB: Cobblestone
Cobblestone hosts a cluster of Minecraft-themed PHP sites across a few subdomains. I’ll find a second-order SQL injection, use it to read the application source, and abuse stored cross-site scripting to hijack an admin session. That admin access opens up a Twig template injection for code execution as the web user, which is locked down hard by AppArmor. I’ll pull credentials from the database and crack one to get an SSH login as the next user. From there I’ll find Cobbler running as root and show multiple ways to abuse it for a root shell, reaching its API through both default credentials and an authentication bypass. In Beyond Root, I’ll dig into why the SQL injection crashes the page.