See here : [https://berryberry.hatenablog.jp](https://berryberry.hatenablog.jp/entry/2022/03/07/230635) First of all, I got a couple of files "log.txt" and "rand.py".
## Given Files"rand.py" is a program that uses UNIX time as a seed value to obtain a pseudorandom number.```import random import time import hashlib
seed = round(time.time())random.seed(seed, version=2)
while True:    rand = random.random()    has = hashlib.sha256(str(rand).encode()).hexdigest()    flag = f"CTF{{{has}}}"    if "7a2" in has:        with open("./flag", "w") as f:            f.write(flag)            break    else:        print(f"Bad random value: {rand}")``` "log.txt" is a output of "rand.py".```Bad random value: 0.33567959567961436Bad random value: 0.8913897703358419Bad random value: 0.3032054069265432Bad random value: 0.6860829464688437Bad random value: 0.2658087107328536Bad random value: 0.8903005048882441Bad random value: 0.914630909612433Bad random value: 0.9688578899818961Bad random value: 0.7925090397955323Bad random value: 0.10136501216336935Bad random value: 0.568451491382639Bad random value: 0.16898065821921437Bad random value: 0.5541712073794856Bad random value: 0.029926361216790154Bad random value: 0.18218590474521223Bad random value: 0.49713845657579536Bad random value: 0.7631162105077507Bad random value: 0.7386939443532723Bad random value: 0.5815609491717452Bad random value: 0.5905894610211082Bad random value: 0.09018146469820387Flag created ```##   ## SolutionWe can see "flag created" in log.txt at 22 lines, so we need to calculate the UNIX time which has "7a2" in line22. I obtained by the use of brute-force.```import randomimport timeimport hashlib
now = 1646547850   # current time when i solved
tmp = [0.33567959567961436, 0.8913897703358419, 0.3032054069265432, 0.6860829464688437, 0.2658087107328536, 0.8903005048882441, 0.914630909612433, 0.9688578899818961, 0.7925090397955323, 0.10136501216336935, 0.568451491382639, 0.16898065821921437, 0.5541712073794856, 0.029926361216790154, 0.18218590474521223, 0.49713845657579536, 0.7631162105077507, 0.7386939443532723, 0.5815609491717452, 0.5905894610211082, 0.09018146469820387]
while (now > 0):    random.seed(now, version=2)    for cnt in range(21):        rand = random.random()        if (rand != tmp[cnt]):            break    else:        print(now)        exit()     now -= 1```Then, run "rand.py" using UNIX time which obtained earlier.Finally, we can get FLAG.```CTF{82eafc43f229ea3ffe489444c973a8bbbfbbbac54095ba207a222e9918290fdc}```