XCTF 2ex1
程序员文章站
2022-05-15 19:52:08
...
一个mips架构大端序的程序,还有一个密文
运行下程序看看
一开始我没想出解题思路,看了大佬的wp,大佬一眼看出这是被替换了????表的base64加密
ghidra打开加解二进制文件
找到了一个足够64位的奇怪的字符串
@,.1fgvw#`/2ehux$~"3dity%_;4cjsz^+{5bkrA&=}6alqB*-[70mpC()]89noD
解密脚本
d = ""
ret = ""
string = "│_r-+_Cl5;vgq_pdme7#7eC0=".replace("=","")
base64_list = '@,.1fgvw#`/2ehux$~"3dity%_;4cjsz^+{5bkrA&=}6alqB*-[70mpC()]89noD'
for i in string:
try:
d += str(bin(base64_list.index(i))[2:]).rjust(6,"0")
except Exception as e:
continue
for i in range(0,len(d),8):
if 32 <= int(d[i:i+8],2) <= 126:
ret += chr(int(d[i:i+8],2))
print(ret)
flag
flag{change53233}