Numbers
Solution
When we connect to address from task description, we need to guess some numbers. It seems like the numbers are 32-bit. I’ve done similar challenge before and I assumed that the goal of this challenge is to rebuild Mersenne Twister’s matrix state. I utilized RandCrack Python library to do that.
import socket
from randcrack import RandCrack
= RandCrack()
rc
= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s print("connecting")
connect(("challs.dvc.tf", 3096))
s.print("connected")
print(s.recv(256))
for _ in range(624):
'1\n')
s.send(b= int(s.recv(4096).decode().replace("Nice try! I was thinking of ", "").split("\n")[0])
n print(n)
rc.submit(n)
= rc.predict_getrandbits(32)
guessed_number print(guessed_number)
"%i\n" % guessed_number).encode("ASCII"))
s.send((while True:
print(s.recv(4096))
Flag
dvCTF{tw1st3d_numb3rs}
Credits
License
CC BY 4.0 WaletSec + everl0stz