nullcon2023-chall-babyrand

Python PRNG prediction challenge for NullCon 2023 Berlin
git clone https://git.sinitax.com/sinitax/nullcon2023-chall-babyrand
Log | Files | Refs | sfeed.txt

app.py (349B)


      1#!/usr/bin/python3 -u
      2
      3import random
      4import os
      5
      6max_retries = 100
      7for _ in range(max_retries):
      8    print("Hints:")
      9    for i in range(9):
     10        print(random.getrandbits(32))
     11
     12    real = random.getrandbits(32)
     13    print("Guess:")
     14    resp = input()
     15    if int(resp) == real:
     16        print("FLAG", os.getenv("FLAG"))
     17
     18print("No tries left, sorry!")