当前位置:网站首页>Angr (VI) -- angr_ ctf
Angr (VI) -- angr_ ctf
2022-07-25 10:20:00 【c1rcl3】
adopt angr_ctf be familiar with angr How to use
Reference link :
bilibili - angr Symbol execution
08
1. Direct download angr_ctf Provided ELF Executable file 08_angr_constraints
2. use IDA Static analysis

main Function call scanf Read 16 Byte string input to buffer buffer, And then call complex_function The function processes the input . Last call check_equals_AUPDNNPROEZRJWKB Complete character by character string comparison , And output according to the results .
3. Write a script to solve the program output Good Job Input corresponding to , To avoid path explosion caused by string comparison function , You can avoid being right check Part of the logic performs symbolic execution
import angr
import claripy
p = angr.Project("./08")
start_addr = 0x8048625
check_addr = 0x8048565
init_state = p.factory.blank_state(addr=start_addr)
pass_addr = 0x804A050
pass = claripy.BVS('pass', 16 * 8)
init_state.memory.store(pass_addr, pass)
sm = p.factory.simulation_manager(init_state)
sm.explore(find=check_addr)
for i in range(0, len(sm.found)):
found_state = sm.found[i]
target = "AUPDNNPROEZRJWKB".encode()
param1 = pass_addr
param2 = 16
bvt = found_state.memory.load(param1, param2)
found_state.add_constraints(bvt == target)
res = found_state.solver.eval(pass, cast_to=bytes).decode()
print(res)4. Run the script to see the results
![]()
5. Check the correctness of the results
![]()
09
1. Direct download angr_ctf Provided ELF Executable file 09_angr_hooks
2. use IDA Static analysis

main Functional logic can be divided into two parts :
The first part : First read a 16 Character string to buffer buffer in , Then call complex_function Function pair buffer The content in is processed character by character , Finally, the processed buffer Content and content in password Compare strings in the buffer .
The second part : Read one again 16 Character string to buffer buffer in , Then call complex_function Function pair password The content in is processed character by character , Finally, the processed password Content and content in buffer Compare strings in .
3. Write a script to solve the program output Good Job Input corresponding to , To avoid path explosion caused by string comparison function , It can be done to check Function hook, No symbolic execution
import angr
import claripy
def isGood(state):
return b'Good Job.' in state.posix.dumps(1)
def isBad(state):
return b'Try again.' in state.posix.dumps(1)
p = angr.Project("./09")
check_addr = 0x80486B3
skip_size = 5
init_state = p.factory.entry_state()
@p.hook(check_addr, length=skip_size)
def check_hook(state):
pass_addr = 0x804A054
pass_size = 0x10
bvt = state.memory.load(pass_addr, pass_size)
target = "XYMKBKUHNIQYNQXE".encode()
state.regs.eax = claripy.If(target == bvt, claripy.BVV(1, 32), claripy.BVV(0, 32))
sm = p.factory.simulation_manager(init_state)
sm.explore(find=isGood, avoid=isBad)
for i in range(0, len(sm.found)):
found_state = sm.found[i]
print("{}".format(found_state.posix.dumps(0)))4. Run the script to see the results

5. Verify the correctness of the results
![]()
边栏推荐
猜你喜欢

虚拟专线网络部署

message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“

UE4 LoadingScreen动态加载启动动画

Pow(x,n)

Number theory -- negative Radix conversion

IDEA整体字体大小修改

Trojaning Attack on Neural Networks 论文阅读笔记

拷贝过来老的项目变成web项目

复现 SSL_Anti-spoofing, 使用 wav2vec 2.0 和数据增强的自动说话人认证的欺骗攻击与深度伪造检测

Attention is all you need 论文精读笔记 Transformer
随机推荐
JSP details
SQL 题目整理
The way of code neatness -- hit the pain point directly
语音自监督预训练模型 CNN Encoder 调研总结
Basic knapsack problem
Strut2 form label
关于slf4j log4j log4j2的jar包配合使用的那些事
Bug分类和定级
message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“
字典树的使用
Detailed explanation of chrome developer tools
修改mysql的分组报错Expression #1 of SELECT list is not in GROUP
Pytorch 通过 Tensor 某一维的值将 Tensor 分开的方法(简易)
Angr(四)——angr_ctf
Duplicate SSL_ Anti spoofing, spoofing attacks and deep forgery detection using wav2vec 2.0 and data enhanced automatic speaker authentication
Swing组件之单选与多选按钮
虚拟专线网络部署
Dataset 和 Dataloader数据加载
UE4 框架介绍
conda 配置深度学习环境 pytorch transformers