Catégorie: Web
Difficulté: easy
Flag: HTB{f13ry_t3mpl4t35_fr0m_th3_d3pth5!!}
Challenge
Description
You and your faction find yourselves cornered in a refuge corridor inside a maze while being chased by a KORP mutant exterminator. While planning your next move you come across a translator device left by previous Fray competitors, it is used for translating english to voxalith, an ancient language spoken by the civilization that originally built the maze. It is known that voxalith was also spoken by the guardians of the maze that were once benign but then were turned against humans by a corrupting agent KORP devised. You need to reverse engineer the device in order to make contact with the mutant and claim your last chance to make it out alive.
Ce challenge tourne sur un docker, disponible sur
Etape 1 : Reconnaissance
On est sur une techno Java avec l’utilisation d’un render template nommé Velocity :
Dans le code source on voit que l’input utilisateur n’est pas assainie, donc potentiellement on a une SSTI.
En cherchant les SSTI de cette techno, on tombe sur :
Etape 2 : PoC
Dans le fichier challenge/src/main/java/Main.java à la ligne 44 on trouve : **context.put("name", "World")**
On peut donc essayer d’afficher cette variable en envoyant $name dans la requête :
On reçoit bien Hello World donc la variable a bien été interprétée.
Etape 3 : Exploit
Dans le lien fourni plus haut, on nous donne un payload tout prêt pour exécuter des commandes :