X-MAS CTF 2018 - Let's Crack the Great(er) lapland monolith
These are two very similar challenges: the first one has a bug so that you can solve it in an unintended way, so the organizers realized a second “fixed” challenge. The following method works for both of them.
We’re given a web page that gets a random integer and asks us to guess it, multiple times. After guessing correctly 20 times, it will return a flag.
From the title we can see that the prng is of lcg type (linear congruential generator), that is, given 3 integers
- Construct a sequence
- Observe that
We did this using the Python script from msm from p4team and then did it on the website by hand (input 20 times is faster than scripting). Here’s the code:
from functools import reduce