拿到一串base64编码
XQNGuAc9DEoRTAEFAygFDA6BDwz/DJSYbjpeOBBZCbg37dmLNYgNBA0JDAk/iQgC
AwEGBwaNDAoOAgQKbGJty24RbH8l73NOfIF/Q0y+wr9EkUHKq/oL4smYRouL38/0
w6Yv+yjdx6ZMuqfciszC/kD6jb3A/MCeyv3O887uychMv439SvPNvyn8hKov9Q0f
R62rUQEa0FHDT2hxHmXOdhR+q1oibuRm6khVT81ir3KUWuxgKp3fYggtCAhSBUm5
BxcOJBpHCQQcTQ4NCSMDDgqEBgbwBpCeZThQPh5YDLUz69yKM4AADQMEDg0+gAEL
AwEICwuGDQIjSAoMAg4HAAADDQwADQQLLgYNDg0JAwAODAQFAwoICm5ibsJrFmlw
KOx/TnmOckgLqQkMIQgDCAoIDQILBAMKCh4ODxuFDwc+K252vu4fwapI1wDXcgwf
px1pUVoBGtmvTN0M234FERj21DB42WyFrTjYCdB+BxpcCUeyAlIEbgQOBwkLAAsN
BxENAQMeDAZZqQoNDAAMDVzsCQsEBAcKAwMPDg==
用python脚本解码base64
import base64
str = base64.b64decode(open('1.txt', 'rb').read())
print(str)
再转为十六进制
for i in str:
print(hex(i)[::],end=' ')
每字节保留十六进制高位(去除0x)
for i in str:
print(hex(i)[2:],end=' ')
拼接在一起
print(''.join([hex(i >> 4)[2:]for i in str]))
转化为十六进制
s = bytes.fromhex(''.join([hex(i >> 4)[2:]for i in str]))
print(s)
50 4b 是压缩包格式
f = open('1.zip', "wb")
f.write(s)
f.close
直接解压也可以
总结
import base64
import zipfile
str = base64.b64decode(open('1.txt', 'rb').read())
s = bytes.fromhex(''.join([hex(i >> 4)[2:]for i in str]))
f = open('1.zip', "wb")
f.write(s)
f.close
flag{The_journey_of_looking_for_the_flag_is_really_fun!}