当前位置:网站首页>Angr(九)——angr_ctf
Angr(九)——angr_ctf
2022-07-25 09:27:00 【c1rcl3】
通过angr_ctf熟悉angr的使用方法
参考链接:
14
1. 直接下载angr_ctf提供的ELF可执行文件14_angr_shared_library
2. 用IDA静态分析

函数逻辑比较简单,与前面几例的不同之处在于validate函数在动态链接库(.so文件)中。动态链接库中的共享对象最终装载地址在编译的时候是不确定的,需要装载器根据当前地址空间的空闲情况,动态分配一块足够大小的虚拟地址空闲。共享库中的所有地址都是 base+offset。
3. 编写脚本求解程序输出Good Job时对应的输入
import angr
import claripy
base = 0x4000000
p = angr.Project('./lib14_angr_shared_library.so', load_options={
'main_opts': {
# backend —— 使用哪个后台,可以是一个对象,也可以是一个名字(字符串)
# custom_base_addr —— 使用的基地址
# custom_entry_point —— 使用的入口点
# custom_arch —— 使用的处理器体系结构的名字
'custom_base_addr': base
}
})
pass_addr = claripy.BVV(0x3000000, 32)
validate_addr = base + 0x6D7
init_state = p.factory.call_state(validate_addr, pass_addr, claripy.BVV(8, 32))
password = claripy.BVS('password',8*8)
init_state.memory.store(pass_addr, password)
sm = p.factory.simulation_manager(init_state)
sm.explore(find=base+0x783)
for i in range(0, len(sm.found)):
found_state = sm.found[i]
found_state.add_constraints(found_state.regs.eax != 0)
print(found_state.solver.eval(password,cast_to=bytes).decode())4. 运行脚本查看结果

5. 验证结果的正确性
![]()
关于运行时报错error while loading shared libraries: lib14_angr_shared_library.so: cannot open shared object file: No such file or directory的解决方法:
1. 编辑/etc/ld.so.conf文件,在include /etc/ld.so.conf.d/*.conf的下方添加一行,添加xxx.so文件所在的目录

2. 运行命令行/sbin/ldconfig -v
![]()
边栏推荐
猜你喜欢

JS uses requestanimationframe to detect the FPS frame rate of the current animation in real time

Pow(x,n)
![[nearly 10000 words dry goods] don't let your resume don't match your talent -- teach you to make the most suitable resume by hand](/img/2d/e3a326175f04826b9d9c96baedc3a5.png)
[nearly 10000 words dry goods] don't let your resume don't match your talent -- teach you to make the most suitable resume by hand

Use and principle of rest

VS Code 连接远程 Jupyter 服务器

车辆属性最近一次入库时间初始化生成sql脚本文件

PyTorch 代码模板 (CNN)

Redis使用场景

File upload function

UE4 框架介绍
随机推荐
VLAN的配置及其应用(以华为eNSP为例)
Ubuntu20.04系统下安装MySQL数据库5.7.29版本
UE4 外部打开exe文件
@Import,Conditional和@ImportResourse注解
UE4源码的获取和编译
SSM整合(简单的图书管理系统来整合SSM)
记录一些JS工具函数
文件的上传功能
ES6 detailed explanation
软件测试笔记,测试用例设计
Common methods of nodejs version upgrade or switching
复现 SSL_Anti-spoofing, 使用 wav2vec 2.0 和数据增强的自动说话人认证的欺骗攻击与深度伪造检测
Detailed explanation of MySQL database
Dataset 和 Dataloader数据加载
Pow(x,n)
Common methods of JS digital thousand bit segmentation
线程池的死锁事件
Loam transformtoend function integrating IMU details
Download and installation of QT 6.2
Reflection 反射