buuctf Crackme6

这道题涉及的知识点说实话还是蛮多的。。。
buuctf Crackme6_第1张图片首先是这里的加密
主要是看汇编,不难,yafu一下知道是[2,3,5,7,11,13,17,19,23]

a = [2 , 3, 5, 7, 11 ,13,17,19,23]
 b = [0x33,0x21,0x22,0x21,0x35,0x7c,0x62,0x65,0x6e]
 for i in range(9):
    a[i] = a[i] +0x41
    a[i] = a[i] ^b[i]
"".join(chr(a[i]) for i in range(9))
#pediy2016

之后进入异常(因为/0,)
buuctf Crackme6_第2张图片这里是个虚拟机保护,得慢慢解析每条指令,由于太繁琐了我就简单说一下过程,就不演示了
首先检查是否数量是0x14,之后直接对比字符串,是cool1,最后6个字符,是要解两个方程
(当然,解方程之前把你的ascii码值变成相应数字,比如0x31 变 1)

import z3
x = z3.Int('x')
y = z3.Int('y')
z = z3.Int('z')
s = z3.Solver()
s.add(x<=9,x>=0)
s.add(y<=9,y>=0)
s.add(z>=0,z<=9)
s.add(x==1)
s.add(x+y*y*y+z*z*z==0x64+10*y+z)
print(s.model())
# 1 5 3
import z3
x = z3.Int('x')
y = z3.Int('y')
z = z3.Int('z')
g = z3.Int('g')
s = z3.Solver()
s.add(x<=9,x>=0)
s.add(y<=9,y>=0)
s.add(z>=0,z<=9)
s.add(g<=9,g>=0)
s.add(10*x+y+10*z+g==0x23)
s.add(4*(10*x+y)+2*(10*z+g)==0x5e)
print(s.model())
#2312

flag:pediy20161532312

你可能感兴趣的:(buuctf)