Ghidralligator 开源项目使用教程
ghidralligator 项目地址: https://gitcode.com/gh_mirrors/gh/ghidralligator
1. 项目介绍
Ghidralligator 是一个基于 Ghidra 的 C++ 多架构 Pcode 模拟器,专为使用 AFL++ 进行模糊测试而设计。它能够在处理运行在非主流架构上的二进制文件时保持较高的性能,适用于漏洞研究,尤其是在针对嵌入式设备应用程序或固件时。Ghidralligator 是 afl_ghidra_emu 的后继者,显著提升了执行速度,并包含了许多有用的功能,如堆内存损坏检测(ASAN)。
2. 项目快速启动
安装步骤
-
安装 AFL++
首先,克隆并安装 AFL++:
git clone https://github.com/AFLplusplus/AFLplusplus cd AFLplusplus make distrib sudo make install
-
克隆并编译 Ghidralligator
克隆 Ghidralligator 项目并进行编译:
git clone https://github.com/airbus-cyber/ghidralligator cd ghidralligator make ghidralligator
快速启动示例
标准模拟运行
./ghidralligator -m replay -c examples/x86/config.json -I -i examples/x86/input/normal_use_case.bin
标准 AFL++ 模糊测试会话
mkdir afl_inputs afl_outputs
echo -n "AAAAAA" > /afl_inputs/input.bin
AFL_SKIP_BIN_CHECK=1 afl-fuzz -D -i /afl_inputs -o /afl_outputs/ -- ./ghidralligator -m fuzz -c examples/x86/config.json
3. 应用案例和最佳实践
应用案例
Ghidralligator 主要用于以下场景:
- 漏洞研究:在闭源二进制文件中进行漏洞研究,特别是针对嵌入式设备应用程序或固件。
- 模糊测试:通过模拟运行,检测内存损坏等漏洞。
最佳实践
- 配置文件:编写配置文件以定义内存映射布局和程序的初始状态。
- 用户钩子:编写用户钩子文件以扩展 Ghidralligator 的功能。
- SLA 文件:获取或编写适合目标架构的 SLA 文件。
4. 典型生态项目
- AFL++:Ghidralligator 依赖 AFL++ 进行模糊测试。
- Ghidra:Ghidralligator 基于 Ghidra 的 Pcode 模拟器,Ghidra 是一个开源的逆向工程工具。
- ASAN:Ghidralligator 集成了 ASAN(AddressSanitizer)用于检测内存损坏。
通过以上步骤和示例,您可以快速上手 Ghidralligator 项目,并利用其强大的功能进行漏洞研究和模糊测试。
ghidralligator 项目地址: https://gitcode.com/gh_mirrors/gh/ghidralligator