BUUCTF:[MRCTF2020]pyFlag
题目来源:https://buuoj.cn/challenges#[MRCTF2020]pyFlag
题目给了三张jpg
010打开发现每张jpg文件尾附了zip的一部分
将他们合并 得到zip
zip加密 暴力破解 得到密码:1234
得到一个hint和flag.txt
官方脚本
#!/usr/bin/env python import base64 import re def baseDec(text,type): if type == 1: return base64.b16decode(text) elif type == 2: return base64.b32decode(text) elif type == 3: return base64.b64decode(text) elif type == 4: return base64.b85decode(text) else: pass def detect(text): try: if re.match("^[0-9A-F=]+$",text.decode()) is not None: return 1 except: pass try: if re.match("^[A-Z2-7=]+$",text.decode()) is not None: return 2 except: pass try: if re.match("^[A-Za-z0-9+/=]+$",text.decode()) is not None: return 3 except: pass return 4 def autoDec(text): while True: if b"MRCTF{" in text: print("\n"+text.decode()) break code = detect(text) text = baseDec(text,code) with open("flag.txt",'rb') as f: flag = f.read() autoDec(flag)
得到flag{Y0u_Are_4_p3rFect_dec0der}
参考:https://blog.csdn.net/mochu7777777/article/details/109829704