笔者最近在学习导向型fuzz,这就不得不提到AFLGO了。由于之前改代码弄环境把虚拟机搞得很杂,新开虚拟机进行搭建实验。网上相关教程较少,大部分是关于AFL的,所以写下此篇博客记录从一无所有的虚拟机到搭建完成测试的过程。由于作者本身也是小白,所以写的也很详细,如有已完成或觉得啰嗦的步骤请自行跳过。有不对的地方还请大佬们指正。
一、环境
ubuntu 18.04.5 LTS
内存:8G(建议分配8G以上,不然搭建AFLGO时编译可能会出错)
存储:60G
值得注意的是如果要做对比实验可能需要用ubuntu 16,但是里面许多东西都太老了,不能直接从apt中获取。大部分东西需要下压缩包然后./configure+make+make install,具体可以看里面的README
二、换源
初始安装完系统后apt的东西较为古早,导致如果直接进行aflgo搭建前的llvm安装会提示版本问题,建议换源后再进行。
关于换源的教程比较多了,放一个参考
1.打开sources.list文件
sudo gedit /etc/apt/sources.list
2.用"#"注释掉以前的源(deb开头)
3.增加自己想加的源后保存,以下为阿里源。
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
4.更新
sudo apt-get update
sudo apt-get upgrade
三、AFLGO搭建
AFLGO项目地址
https://github.com/aflgo/aflgo
0.git
(*)未安装则sudo apt-get install git
(-)建议配置git
代理git config --global http.proxy ‘http://192.168.x.x:10809’
(*)git clone https://github.com/aflgo/aflgo
1.修改搭建脚本
AFLGO提供了sh脚本可以自动完成搭建,但是需要进行一些修改。
(*)编辑aflgo/scripts/build/aflgo-build.sh
(*)配置proxy,后续需要用到wget。如果不配置,中间很容易被超时被中断。
加入两行即可
export http_proxy=“http://192.168.x.x:10809”
export htt