We start by downloading the source files.
We are give a
from secret import FLAG
flag = FLAG[::-1]
new_flag = ''
for i in range(0, len(flag), 3):
new_flag += flag[i+1]
new_flag += flag[i+2]
new_flag += flag[i]
print(new_flag)
This looks like it could be easily reversed. We can modify the script to decrypt the output:
output = "!?}De!e3d_5n_nipaOw_3eTR3bt4{_THB"
def decrypt(text):
flag = text
new_flag = ''
for i in range(0, len(flag), 3):
new_flag += flag[i+2]
new_flag += flag[i]
new_flag += flag[i+1]
return new_flag[::-1]
print(decrypt(output))
Running this script gives us the flag: