Fuzz学习入门之Fuzzing-OpenEuler-file5.41
下载AFL
git clone https://github.com/google/AFL.git
Tips:需要将AFL/llvm_mode目录下alf-clang-fast.c中131~134行的代码给去掉,不然编译的时候会报错
在AFL下make生成fuzzer
下载测试的项目:
git clone https://gitee.com/src-openeuler/file.git
把C和C++的编译器改为afl的afl-clang-fast和afl-clang-fast++
1 | export CC=/home/re1own/github/AFL/afl-clang-fast |
指定下安装目录
1 | ./configure --enable-shared=no --prefix=/home/re1own/Project/install/ |
编译安装
1 | make |
编译安装完之后可以发现在之前创建和制定的install目录下有了用AFL插桩生成的目标程序了
strings file | grep "afl"
检查下是否插桩成功,字符串中有afl结合前面编译安装没有报错说明应该插桩成功了
创建input、output文件夹,测试项目的tests文件下有输入文件,我们把它们转到input中当作种子,然后就可以用afl去fuzzing了
afl-fuzz -i input -o output -m none -t 500+ -- /home/re1own/Project/install/bin/file @@
实验相关文件链接:https://github.com/Re1own/IoT_Sec/tree/main/Fuzz/openEuler/file-5.41
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.