str.lc

web security ramblings

ctf in 202(6-7)

A rogue-like ASCII-based game hacking CTF challenge created for DiceCTF Finals 2026.

game

Loading…

Arrows or wasd move · e attack · f defend · . wait · i inventory · b talk or trade · x pulls 2027's levers · Esc for the menu, which holds save, load, help and restart.

flags

  1. Shop flag

    Dustfall Village

    Buy a flag worth 1000 gold.

    spoiler

    The shop lets you enter a negative quantity when buying an item. It calculates the price with cost * quantity and subtracts that from your gold, so a negative order adds money instead of spending it. There is a check for quantity > 0, but it only controls whether you receive the items; the money has already changed hands. Buy -100000 arrows at 1 gold each to give yourself 100000 gold, then use it to buy the flag from the same shop for 1000.

  2. Sokoban flag

    The Sunken Storehouse

    Find the flag out of bounds in the Sokoban level.

    spoiler

    Putting a box on each button opens the route deeper into the dungeon, but this flag is outside the storehouse, behind a wall four squares thick. To reach it, you need to push the boxes through the wall. The bug is in canPushBox: when the next square contains a button, it allows the push without checking whether another box is already there or whether that box can move. pushBox then moves every box in the chain anyway, including any that end up inside a wall. By feeding all five boxes onto the same button, you can push the chain through the outer wall and follow it out to the flag.

  3. Dragon flag

    The Dragon’s Hoard

    Kill the Dragon at the end of the game.

    spoiler

    This flag comes from playing through the dungeon and beating the dragon. The shop bug makes the preparation easier: use it to buy a long spear, chainmail and plenty of potions. Collect both crypt keys, solve the storehouse puzzle by covering all five buttons, then kill the seven defenders in the antechamber to open the gate. The dragon itself has 64 HP and stays in one place. Since your spear reaches two squares and its attacks only reach one, you can fight it from a safe distance. Keep potions handy for the approach, then collect the flag once it is dead.

  4. Nowhere flag

    Nowhere

    Find a way to reach the level with no entrance.

    spoiler

    There is a hidden level named flag in the world data, but nothing in the game leads to it. You can get there through the Workshop map loader, which unlocks after collecting the dragon flag. The loader trusts the starting level specified by an uploaded map without checking that the level belongs to that map. Set workshop.start.level to flag and the starting coordinates to the flag at (7, 3). Loading the map teleports you straight into the hidden level and picks it up.

  5. Ember flag

    The Ember Run

    Survive the Ember Run and get to the other side.

    spoiler

    The vents have a 50% chance of firing each turn, and getting caught in the fire without defending kills you and deletes all ten saves. You can watch the vents from outside the hall, though, and their pattern reveals information about the random number generator. Each random() < 0.5 result tells you one bit of an output from the V8-style xorshift128+ generator. Because its state changes through XORs and bit shifts, those observations can be turned into linear equations for its 128 state bits. The replay records 200 turns and solves those equations, keeping 40 observations aside to check the predictions. Once you can predict the fire, cross by defending on burning turns and moving on safe ones. If more than one state fits and their predictions disagree, defend until further observations resolve the uncertainty.