# Let's Crack the Great lapland monolith (421 PTS)
### Description
>"Psst, I got a task for you. There's this monolith to which I need to get access, but I can't get the numbers right. Can you help me? I pay well." ~ A shady dealer gnome>>_Authors: Milkdrop + Gabies_
Links:- Server: [http://199.247.6.180:12000](http://199.247.6.180:12000)
Flag: ```X-MAS{LCG_0n_7h3_LapL4nd_m0n0LiTh_1s_n0t_7ha7_s3cur3}```
### Solution
#### This solution is unintended! Intended solution is described in [the second part](../Let%27s%20Crack%20the%20Greater%20lapland%20monolith/README.md).


Website contains a single input field sending a given number to the server. Also it holds user's session in cookie `PHPSESSID`.


We need to get _guess streak_, but I'm not enough lucky to catch even 1 correct guess. And we don't even know the type of the random generator.
Since [all PRNG's are periodic](https://cs.stackexchange.com/q/24420), we can try to **determine the period** of the number generator.
The website prints each generated number, so let's generate some numbers from the same session and get the output. If we could receive certain number twice, we'll detect generator's period.
I wrote a simple [python script](solver.py) for that. It was worked for a few minutes and printed:
```shFOUND PERIOD: 22530PHPSESSID=27734bdc6ce06142d374b1c613d18c9dNEXT 20 NUMBERS ARE:29351182661408112541738732335153502116992261612120819607620419521387732424173532952963217864```
Ok, let's try to send these numbers to Monolith. Don't forget to change `PHPSESSID`!


It works! After the sending of 20 _guessed_ numbers we'll receive the flag:


And also we've got the type of PRNG from the flag's text: [Linear congruential generator](https://en.wikipedia.org/wiki/Linear_congruential_generator).