[ECW Quals 2020] [MISC] From Dusk Till Down

Challenge description

This challenge was part of the European Cyber Week Qualification.

Challenge description

This goal of this challenge is to find the next number which must be print.


After some researches on Google to understand the title of the challenge, it appears that’s the name of a film. On the wikipedia page in the synopsispart there is a link with Twister. In programmation, twister refers to the mersenne twister generator.
The advantage of this number generator is that it’s a pseudo random generator. So we can predict the next number.

ATTENTION keep the ssh session open during the operation else the seed will be different and we need to start again.
We connect in ssh to the challenge. Then we launch the challenge. It asks us a number to generate a set of values. I take 10 and put them in a file input.txt. Once these values are generated, we need to find a mersenne generator to brute force the seed:
We can use this repo: untwister.
Then with the following command we can brute force the seed:

./untwister -i input.txt -d 1

It takes a long time (~10 min).
Once the seed is find, we can generate the list of numbers create with this seed. The command is:

./untwister -g 6706650

Then the list appear. As I asked 10 numbers, I take the next one (29732694) and send it on the ssh.
Catch the flag and it’s done