[长城杯 2022 高校组]baby_re
看图标或查壳为python可执行文件
pyinstxtractor 解包
得到一个run.exe_extracted文件
主要看run.pyc,uncompyle6反汇编
可见为base64,但进行了变表,我们也无法直接打开自定义的new库,查看重要函数,不过可以进行爆破。
重要的函数在new.cp37-win_amd64.pyd中,我们直接在同一级文件夹中建立一个py文件来引用new即可,需注意的是编码格式(utf-8),我在这卡了
base64的简单说明:3位加密为4位
import itertools
from new import *
word = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789{}"
enc = '5WEU5ROREb0hK+AurHXCD80or/h96jqpjEhcoh2CuDh='
flag = ''
try:
for i in range(0, len(enc) // 4):
for t1 in itertools.product(word, repeat=3):
t1 = f''.join(t1)
t2 = mmo(flag + t1)()
if t2 == enc[:len(t2)]:
flag += t1
# print(flag)
break
except:
for t1 in itertools.product(word, repeat=2):
t1 = f''.join(t1)
t2 = mmo(flag + t1)()
if t2 == enc[:len(t2)]:
flag += t1
break
print(flag)
# 8b98aa2e10ac53e21240ee10a9054be3