一、安裝AFL
sudo apt-get install clang
sudo apt-get install llvm
官網下載最新安裝包
解壓后進入該目錄
make
sudo make install
*error:
原因:新開的虛擬機沒安裝make :)
二、原理
https://paper.seebug.org/496/ AFL(American Fuzzy Lop)實現細節與文件變異
https://www.wxnmh.com/thread-5948378.htm AFL afl_fuzz.c 詳細分析
三、測試案例
Bind
官網下載 http://www.linuxfromscratch.org/blfs/view/svn/basicnet/bind-utils.html
安裝
./configure --prefix=/usr --without-python && make -C lib/dns && make -C lib/isc && make -C lib/bind9 && make -C lib/isccfg && make -C lib/irs && make -C bin/dig
make -C bin/dig install
命令說明
--without-python
:使用此選項,無需使用未使用的python模塊。
make -C lib / ...:這些命令將構建客戶端程序所需的庫。
make -C bin / dig:此命令生成客戶端程序。
然鵝!!!上面是正常使用的操作
測試應該:
一定要替換CC(或者CXX)再編譯
--without-python 是必要的,不然就會。。。(如下圖)
編譯過程發現新虛擬機各種缺包
pkg-config
libuv(直接安裝libuv沒有包,需要手動編譯)
下載並編譯libuv
libuv需要自己手動下載源碼,並手動編譯。
當前目錄為:/home/xlz/test/github/,在后面,會用$PATH來代替,我的系統的Debian8,64bit.
$git clone https://github.com/libuv/libuv.git
即可下載到libuv源碼
然后$cd libuv 進入到libuv源碼目錄下,准備編譯。
依次運行如下命令:
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
備注:
如果提示缺少一些庫,請自行安裝,apt-get install packagename
如,我運行autogen.sh的時候,就提示缺少automake,libtoolize庫:
xlz@debian:~/test/github/libuv$ sh autogen.sh
autogen.sh: 1: autogen.sh: automake: not found
autogen.sh: 33: test: Illegal number:
autogen.sh: 34: test: Illegal number:
- libtoolize --copy
autogen.sh: 43: autogen.sh: libtoolize: not found
運行如下命令,手動安裝,即可:
$ sudo apt-get install automake
$ sudo apt-get install libtool
沒有盡頭的最后。。。
不玩了QAQ
換一個
測試binutils:
重寫CC編譯環境變量的值(如果是C++程序,且用g++而不是gcc進行編譯,則修改CXX),修改后即可運行configure腳本,然后編譯。
CC=afl-gcc ./configure
make
編譯完成后,要修改一下配置,使系統將coredump輸出到文件,而不是上報給系統的處理程序:echo core > /proc/sys/kernel/core_pattern
建一個input文件夾作為afl fuzz的輸入,再建立一個out文件夾,作為afl fuzz的輸出,afl fuzz會將崩潰、掛起等問題記錄到輸出文件中
mkdir afl_in afl_out
cp /bin/ps afl_in/
接下來,就可以使用afl fuzz進行模糊測試了:
cd ~/binutils-2.25
afl-fuzz -i afl_in -o afl_out ./binutils/readelf -a @@
afl fuzz啟動后,我們將看到如下界面:

———————————————————— 資料總結 ——————————————————————
https://www.jianshu.com/p/b1182441d8ef AFL Fuzz安裝及完成一次簡單的模糊測試
安裝使用
1. AFL入門
https://www.cnblogs.com/0xHack/p/9414444.html
2. [原創][新手向] 使用AFL來fuzz upx
https://bbs.pediy.com/thread-249179.htm
3. [翻譯]使用AFL進行fuzz
https://bbs.pediy.com/thread-250866.htm
4. AFL漏洞挖掘技術漫談(一):用AFL開始你的第一次Fuzzing
https://paper.seebug.org/841/
5. AFL 漏洞挖掘技術漫談(二):Fuzz 結果分析和代碼覆蓋率
https://paper.seebug.org/842/
6. afl-fuzz技術初探
https://www.cnblogs.com/WangAoBo/p/8280352.html
7. AFL使用指南
http://zeroyu.xyz/2019/05/15/how-to-use-afl-fuzz/
8. Fuzz Testing with afl-fuzz (American Fuzzy Lop)
https://spin.atomicobject.com/2015/08/23/fuzz-testing-american-fuzzy-lop/
白皮書及文檔翻譯
1. 使用Afl-fuzz (American Fuzzy Lop) 進行fuzzing測試(一)——使用初體驗
https://blog.csdn.net/youkawa/article/details/45696317
2. 使用Afl-fuzz (American Fuzzy Lop) 進行fuzzing測試(二)——詳細使用說明(README.txt )
https://blog.csdn.net/youkawa/article/details/76405468
3. 使用Afl-fuzz (American Fuzzy Lop) 進行fuzzing測試(三)——技術白皮書(technical whitepaper)
https://blog.csdn.net/youkawa/article/details/76615480
4. afl技術白皮書筆記(1)
https://ljie.space/2018/01/22/afl%E6%8A%80%E6%9C%AF%E7%99%BD%E7%9A%AE%E4%B9%A6%E7%AC%94%E8%AE%B0-1/
5. afl-fuzz技術白皮書
https://blog.csdn.net/gengzhikui1992/article/details/50844857
技術分析
1. ★★ 漏洞挖掘技術之 AFL 項目分析
https://bbs.pediy.com/thread-249912.htm
2. [原創]afl-fuzz源碼情景分析,詳細讀碼筆記,freemind版本和word版本
https://bbs.pediy.com/thread-218671.htm
3. AFL技術實現分析
https://blog.csdn.net/qq_32464719/article/details/80592902#comments
4. ★★ AFL內部實現細節小記
http://rk700.github.io/2017/12/28/afl-internals/
5. ★★ AFL文件變異一覽
http://rk700.github.io/2018/01/04/afl-mutations/
6. AFL改進小試
http://rk700.github.io/2018/02/02/afl-enhancement/
7. ★★ AFL-fuzz工具分析
https://blog.csdn.net/Chen_zju/article/details/80791268
8. AFL源碼分析筆記(一)
https://xz.aliyun.com/t/4628
9. AFL源碼分析1——afl-gcc.c源碼分析
https://ch4r1l3.github.io/2019/03/05/AFL%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%901%E2%80%94%E2%80%94afl-gcc-c%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/
10. AFL源碼分析2——afl-as.c源碼分析
https://ch4r1l3.github.io/2019/03/06/AFL%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%902%E2%80%94%E2%80%94afl-as-c%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/
11. AFL源碼分析3——afl-as.h源碼分析
https://ch4r1l3.github.io/2019/03/08/AFL%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%903%E2%80%94%E2%80%94afl-as-h%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/
12. AFL源碼分析4——afl-fuzz.c源碼分析1
https://ch4r1l3.github.io/2019/03/09/AFL%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%904%E2%80%94%E2%80%94afl-fuzz-c%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%901/
13. AFL源碼分析5——afl-fuzz.c源碼分析2
https://ch4r1l3.github.io/2019/03/10/AFL%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%905%E2%80%94%E2%80%94afl-fuzz-c%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%902/
14. afl fuzzer 源代碼閱讀
https://www.cnblogs.com/jg01/p/9772700.html
15. AFL不同文件結構
https://barro.github.io/2018/06/afl-fuzz-on-different-file-systems/
16. Fuzzing workflows; a fuzz job from start to finish
https://foxglovesecurity.com/2016/03/15/fuzzing-workflows-a-fuzz-job-from-start-to-finish/
AFL 項目
1. AFL最原始版本,源碼地址
https://github.com/google/AFL
2. [翻譯]AFL生態圈 (這篇文章有很多關於AFL的開源項目地址和簡單介紹)
https://bbs.pediy.com/thread-251051.htm
3. AFLplusplus(該工具做了一些集成)
https://github.com/vanhauser-thc/AFLplusplus
4. [分享]關於 fuzz 的 一點總結
https://bbs.pediy.com/thread-249986.htm