buuctf crypto-丢失的MD5

1.下载zip压缩包
buuctf crypto-丢失的MD5
2.解压压缩包得到一个py文件
buuctf crypto-丢失的MD5
3.尝试用pycharm打开文件得到一串py代码
buuctf crypto-丢失的MD5
4.解析py代码

python3
print des -格式错误
改为
print(des)

运行

import hashlib   
for i in range(32,127):
    for j in range(32,127):
        for k in range(32,127):
            m=hashlib.md5()
            m.update('TASC'+chr(i)+'O3RJMV'+chr(j)+'WDJKX'+chr(k)+'ZM')
            des=m.hexdigest()
            if 'e9032' in des and 'da' in des and '911513' in des:
                print(des)

发现结果为
buuctf crypto-丢失的MD5

m.update('TASC'+chr(i)+'O3RJMV'+chr(j)+'WDJKX'+chr(k)+'ZM')
 des=m.hexdigest()
改为
  str='TASC'+chr(i)+'O3RJMV'+chr(j)+'WDJKX'+chr(k)+'ZM'
  m.update(str.encode('utf -8'))
-对Unicode进行utf -8编码

得到结果

e9032994dabac08080091151380478a2

即flag{e9032994dabac08080091151380478a2}

上一篇:BUUCTF-crypto:四面八方


下一篇:记录8道bugku的Crypto题目