CTF_python-trade
2021-03-29 18:28
标签:文件 put lag return ima tps += master flag 下载得到一个pyc文件,随便找一个python在线反编译网站,把pyc放进去: 得到代码之后,就可以写解密脚本了: 最后运行就可以了: CTF_python-trade 标签:文件 put lag return ima tps += master flag 原文地址:https://www.cnblogs.com/lex-shoukaku/p/13601914.htmldef encode(message):
s = ‘‘
for i in message:
x = ord(i) ^ 32
x = x + 16
s += chr(x)
return base64.b64encode(s)
correct = ‘XlNkVmtUI1MgXWBZXCFeKY+AaXNt‘
flag = ‘‘
print ‘Input flag:‘
flag = raw_input()
if encode(flag) == correct:
print ‘correct‘
else:
print ‘wrong‘
import base64
s=‘XlNkVmtUI1MgXWBZXCFeKY+AaXNt‘
str=base64.b64decode(s)
flag=‘‘
for i in str:
i-=16
i^=32
flag+=chr(i)
print(flag)