首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >winafl编译与测试

winafl编译与测试

作者头像
用户1423082
发布2024-12-31 20:15:34
发布2024-12-31 20:15:34
2180
举报
文章被收录于专栏:giantbranch's bloggiantbranch's blog

实验环境

Visual Studio 2017 (你也可用更加新的版本) git perl cmake git windows 10 DynamoRIO-Windows-8.0.0-1.zip

注意好像win10需要DynamoRIO 8.0.0以上

上面的都搞好后,下载winafl

代码语言:javascript
复制
git clone --recursive https://github.com/googleprojectzero/winafl.git

编译32位,打开x86,64位打开x86_x64

以64为例

代码语言:javascript
复制
D:\Program Files (x86)\Microsoft Visual Studio>cd D:\Temp\test\winafl

D:\Temp\test\winafl>mkdir build64

D:\Temp\test\winafl>cd build64

D:\Temp\test\winafl\build64>cmake -G"Visual Studio 15 2017" -A x64 .. -DDynamoRIO_DIR=D:\Temp\DynamoRIO-Windows-8.0.0-1\cmake -DINTELPT=1

D:\Temp\test\winafl\build64>cmake --build . --config Release

程序就在build64\bin\Release里面

使用test_gdiplus.exe进行测试,通过ida查看main函数是sub_1400010E0,偏移是0x10e0,这个编译器不同,偏移肯定不同

再搞一个1.bmp的测试文件

先用drrun测试一下,没有报错

代码语言:javascript
复制
D:\Temp\DynamoRIO-Windows-8.0.0-1\bin64\drrun.exe -c winafl.dll -debug -target_module test_gdiplus.exe -target_offset 0x10e0 -fuzz_iterations 5 -nargs 2 -- test_gdiplus.exe 1.bmp

还生成了一个log,那基本应该没啥问题了

那可以上afl了,新建一个in目录,放1.bmp进去

代码语言:javascript
复制
afl-fuzz.exe -i in -o out -D D:\Temp\DynamoRIO-Windows-8.0.0-1\bin64\ -t 20000 -- -coverage_module gdiplus.dll -target_module test_gdiplus.exe -target_offset 0x10e0 -fuzz_iterations 20 -nargs 2 -- test_gdiplus.exe @@
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-12-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档