We are given a text document justterrible.txt.
We inspect the file with
xxd justterrible.txt
We see a lot of
The amounts of
with open("justterrible.txt", "rb") as f:
data = f.read()
# find the first 00 byte
start = data.find(b"\x00")
# until we reach the end of the file
while start < len(data):
# find the first 01 byte
end = data.find(b"\x01", start)
# print the amount of 00 bytes
print(chr(end - start), end="")
# find the next 00 byte
start = data.find(b"\x00", end)
if start == -1:
break
python3 solve.py
This gives us the flag.
byuctf{wh4ts_4_nu11_byt3_4nyw4ys}