当前位置:网站首页>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
![]()
边栏推荐
- Mouse monitor, Paintbrush
- 基础背包问题
- Configuring ROS development environment with vscode: Causes and solutions to the problem of ineffective code modification
- Set creation and common methods
- 多线程——五大状态
- Subtotal of rospy odometry sinkhole
- An ASP code that can return to the previous page and automatically refresh the page
- 用户喜好
- Dynamic planning, shopping list problem
- Ubuntu20.04系统下安装MySQL数据库5.7.29版本
猜你喜欢

Attention is all you need 论文精读笔记 Transformer

Download and installation of QT 6.2

UE4 快速找到打包失败的原因

字典树的使用

@Import, conditional and @importresource annotations

【专栏】RPC系列(理论)-夜的第一章

Pow(x,n)

安装 oh my zsh

See how a junior student of double non-2 (0 Internship) can get an offer from Alibaba and Tencent

UE4 外部打开exe文件
随机推荐
PyTorch 对 Batch 中每个样本计算损失 Loss for each sample
Yarn quick reference manual
软件测试笔记,测试用例设计
Swing的组件图标
用户喜好
集合的创建,及常用方法
Loam transformtoend function integrating IMU details
Vant problem record
CentOs安装redis
JSONObject解析json格式的终极总结
message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“
静态路由的配置(以华为eNSP为例)
多线程——Runnable接口,龟兔赛跑
C3D模型pytorch源码逐句详析(二)
复现 ASVspoof 2021 baseline RawNet2
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.
cookie and session
CentOS install redis
多数相合问题总结
GUI窗口