The dragon sleeps at night

Challenge overview

The challenge description provided solely an ip & port in order to connect to a remote machine with netcat.

Once connecting, we were displayed with a game menu that enabled performing various actions on a character we control.

The goal of the game is eventually to kill a dragon in his lair. In order to do that, we need to equip our character with a sword strong enough for the task.

The character can:
1. Go to work in order to earn money
2. Enter the swords shop in order to buy a sword
3. Enter the vault in order to deposit/withdraw the sword
4. Go to sleep in order to rest the character
5. Go in the dragons lair in order to fight the dragon

Challenge solution

In order to kill the dragon, one must obtain a high level sword.
In order to obtain a high level sword, one must “go to work” and earn money, though the highest amount of money one can make in one work session is limited by an input of 3 digits, meaning that naively, we could only earn 999$ for each work session.
It seemed suspicious that resting the character doesn’t really have a practical benefit, and only degrades the sword for every day of rest, and so we tried resting the character for negative value of days in order to reverse the effect on the sword and upgrade it. It seemed it worked. That way we upgraded the sword to level 6 and were able to kill the dragon.