मुख्य कंटेंट तक स्किप करें

Deterministic

There is a locked door in front of us that can only be opened with the secret passphrase. There are no keys anywhere in the room, only this .txt. There is also a writing on the wall.. "State 0: 69420, State N: 999, flag ends at state N, key length: one".. Can you figure it out and open the door?

given deterministic.txt

deterministic.txt
The states are correct but just for security reasons, 
each character of the password is XORed with a very super secret key.
100 H 110
110 T 111
111 B 112
- - -
- - -

Solution

This WriteUp Solution is password protected by the flag of the challenge.

As we can see first value in line is start,third is end and second is xored value(key).So we need to start from 69420 and store values untill end becomes 999.

once we get bytes we need to xor each byte with key ,so brute force key and get flag.

solve.py
from Crypto.Util.number import *
rules = {}
with open("deterministic.txt", "r") as fd:
for line in fd.readlines():
try:
src, val, target = map(int, line.split(" "))
rules[src] = (target, val)
except:
pass # just ignore invalid lines lol

curr = 69420
values = []

while curr != 999:
curr, val = rules[curr]
values.append(val)

for i in range(255):
x=bytes([i^j for j in values])
if b"HTB{" in x:
print(x.decode().split(": ")[1])
break

After running script we get flag HTB{4ut0M4t4_4r3_FuUuN_4nD_N0t_D1fF1cUlt!!}