python_crackme(2019安恒杯1月月赛)

(拿安恒杯1月月赛的题目she来讲)首先,你会拿到一个由python编译的exe文件,使用pyinstxtractor.py脚本(下载地址:https://sourceforge.net/projects/pyinstallerextractor/
)反编译exe文件

image.png

得到一个文件夹里面有一大堆东西

image.png

用010editor打开与exe文件同名的二进制文件

image.png

添加上python3.6的.pyc文件的文件头(即前12字节)然后再加上后缀名.pyc

image.png

再在线反编译一下(反编译地址:https://tool.lu/pyc/)即可得到python源码:

#!/usr/bin/env python
# encoding: utf-8
# 如果觉得不错,可以推荐给你的朋友!http://tool.lu/pyc
import os
n1 = input('Tell me your name?')
n2 = input('Tell me your pasw')
n11 = chr(ord(n1[0]) + 12)
s = ''
st3 = '51e'
st2 = '9f1ff1e8b5b91110'
st1 = 'c4e21c11a2412'
st0 = 'wrong'
if n11 + 'AnHeng' == n2:
    for i in range(0, 4):
        s += st1[3 - i]

    print('Congratulations')
    ts = st2[0] + st3 + st2[1] + s
    print('flag{' + st3[:1] + st1 + st2 + st3[-2:] + '}')
    os.system('pause')
else:
    print('no,' + st0)
import os
n1 = input('Tell me your name?')
n2 = input('Tell me your pasw')
n11 = chr(ord(n1[0]) + 12)
s = ''
st3 = '51e'
st2 = '9f1ff1e8b5b91110'
st1 = 'c4e21c11a2412'
st0 = 'wrong'
if n11 + 'AnHeng' == n2:
    for i in range(0, 4):
        s += st1[3 - i]

    print('Congratulations')
    ts = st2[0] + st3 + st2[1] + s
    print('flag{' + st3[:1] + st1 + st2 + st3[-2:] + '}')
    os.system('pause')
else:
    print('no,' + st0)

你可能感兴趣的:(python_crackme(2019安恒杯1月月赛))