参考:https://blog.csdn.net/qq_38081870/article/details/106858458
一,llvm安装:
llvm提供了Pre-Built Binaries。这是预编译好的llvm相关的工具,下载解压后,配置一下环境变量就可以直接使用了,不需要make,快捷省时!
gedit ~/.bashrc
在bashrc文件添加如下命令
export LLVM_HOME=/home/xxx(your usrname)/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-16.04/bin
export PATH=$LLVM_HOME:$PATH
生效
source ~/.bashrc
二,afl安装:
error: clang frontend command failed due to signal (use -v to see invocation)。
从https://lcamtuf.coredump.cx/afl/releases/?O=D这里下载的afl-2.52b,而下载https://github.com/google/AFL github上的afl后进行make就顺利完成。
编译时:
先cd AFL-master
make
cd llvm-mode
make
cd ...
sudo make install
三,afl 测试 binutils-2.36
export CC=afl-clang-fast
export CXX=afl-clang-fast++
export AFL_PATH=/home/do/Desktop/AFL-master/
afl-fuzz -i /home/do/Desktop/in -o /home/do/Desktop/out /home/do/Downloads/binutils-2.36/binutils/objdump -d @@