Skip to main content
  1. Posts/

HackTheBox CyberApocalypse 2025 - Web CTF writeup

·294 words·2 mins
Lacroix Raphaël (Chepycou)
Author
Lacroix Raphaël (Chepycou)
I’m Raphaël LACROIX, a French computer scientist developping various applications in my free time ranging from definitely useless to somewhat usefull. I also do quite a lot of Capture the flag and cybersecurity challenges.
Table of Contents

What’s that about ?
#

This weekend I spent a few hours having some fun with the HackTheBox CyberApocalypse CTF. Here are the flags I got in the Web category, although I wished I could have spent more time since the challenges, lore and visuals were top-notch !

Trial by Fire
#

This web game looks like it’s running locally. There is no way we could beat the dragon without cheating (1300 health vs 100, and we deal the same amount of damage)

alt text

Looking at the code we see a -simplistic- konami code :

alt text

This adds a new button :

alt text

The capture device does not seem sufficient :

alt text

Based on the message we look for an SSTI :

alt text

The name field does not seem to trigger an SSTI at first in the “combat” page, but things change in the final battle report screen and the 7*7 is actually computed.

alt text

Note we could poison the battle report screen with other parameters since the checks seem to be only client side:

alt text

We try to exploit the SSTI using the following payload :

{{url_for.__globals__.os.popen('ls').read()}}

Since the front-end limits the length of characters we can replay the request via Burp to get the Set-Cookie response :

alt text

This gives us Remote Code Execution :

alt text

We can now get the session cookie for a cat command :

alt text
alt text

HTB{Fl4m3_P34ks_Tr14l_Burn5_Br1ght_e992ef2db5dc4162967d210af654cecf}

Whispers of the Moonbeam
#

We are greeted with a terminal with a set of commands we can use (examine for whoami, observe for ps and gossip - 🤣 - for ls), but we would need to cat.

We can try basic command injections such as ; or &, and it works first time (I don’t know why this one was not put as the first in terms of difficulty) :

alt text

HTB{Sh4d0w_3x3cut10n_1n_Th3_M00nb34m_T4v3rn_91bd11f988e6914e2565d5ac7457d3cf}