CTF Write-up · Mixed
CTF22: Escape Encoding and Strange Strings
Two short sub-tasks from the EOman 2022 set: decoding decimal character codes, and matching two Base64-encoded files index by index.
Escape encoding
The flag is presented as a list of decimal character codes. Mapping each code to its character and joining the result recovers the plaintext.
flag = [89, 111, 117, 71, 111, 116, 84, 104, 101, 70, 108, 64, 103]
print("".join(map(chr, flag)))
# YouGotTheFl@g
Strange strings
Two Base64-encoded files are provided. Decoding both and keeping only the characters that agree at the same index in each file reconstructs the flag. Positions at which the two files differ are discarded.
file1 = base64.b64decode(open('file1.txt').read()).decode('utf-8')
file2 = base64.b64decode(open('file2.txt').read()).decode('utf-8')
flag = "".join(file1[i] for i in range(len(file1)) if file1[i] == file2[i])
print(flag)
# Flag{YoU_DiD_GooD_MaTcHinG}
← Back to all write-ups