下载附件,是一个文本,很大,打开看了下,是一个很长的字符串,有0~9,A~Z,怀疑是16进制,
解码后,看到后面有个“=”,怀疑是base64。
多次base64后,看到结尾是“=”,但解码后是乱码,看到题目是base。怀疑不是base32,就是base16。
写脚本:
import base64
with open (r'C: \flag_encode.txt','r',encoding='utf-8') as f:
for a in f:
while 1:
try :
a=base64.b64decode(a).decode("utf-8")
except:
pass
try:
a=base64.b32decode(a).decode("utf-8")
except:
pass
try:
a=base64.b16decode(a).decode('utf-8')
except:
pass
if "{" in a:
print (a)
break
运行后得到flag