afl-fuzz的设计宗旨 ================ 速度、可靠、易用 覆盖率计算 ======== 通过在编译期间instrument一些指令来捕获branch (edge 我们也可以用afl-cmin去专门处理数据,这个工具会永久丢弃冗余的entries,然后产生一个供afl-fuzz或其他工具使用的语料。 afl-fuzz内置的trimmer试图用计算变量长度和step over的方法,循序地减少数据块。 这个trimmer试图在精确和产生的进程数之间做一个平衡。 afl-fuzz一开始所做的工作都是确定性的,之后才会有一些随机性的更改和test case的拼接,这些确定性策略包括: - Sequential bit flips with varying 调查crashes ============ 对不同类型的crash进行探索是有歧义的,afl-fuzz提供了一个crash探索模式。
/afl-latest.tgz cd afl-2.52b/ sudo make && sudo make install 安装成功 root@giant:~# afl-fuzz afl-fuzz 2.52b by <lcamtuf@google.com> afl-fuzz [ options ] -- /path/to/fuzzed_app [ ... ] Required parameters: afl_out root@giant:~/aflfuzz/fuzztarget/upx# cp /usr/bin/file afl_in root@giant:~/aflfuzz/fuzztarget/upx# afl-fuzz /afl_in/ cp /usr/bin/readelf . afl-fuzz -i afl_in -o afl_out -Q .
随后执行命令 afl-fuzz -i fuzz_input -o fuzz_output . QEMU环境配置完成后提示 然后使用命令afl-fuzz -i fuzz_input -o fuzz_output1 -Q -m 200 . afl-fuzz -i input_dir -o fuzz_output -M master . /test @@ afl-fuzz -i input_dir -o fuzz_output -S slave1 . afl-fuzz -i- -o fuzz_output -M master ./test @@ afl-fuzz -i- -o fuzz_output -S slave1 .
/tools/tiff2pdf @@ /dev/null 最终6000多个减少到800个 corpus minimization tool for afl-fuzz by <lcamtuf@google.com 开fuzz afl-fuzz -i testcase_cmin/ -o afl_output/ tools/tiff2pdf @@ /dev/null
AFL_DISABLE_TRIM :设置 AFL_DISABLE_TRIM 告诉 afl-fuzz 不要修剪测试用例。这通常是一个坏主意! /bin/bash FUZZ_DIR=`dirname $(realpath -s $0)` source "$FUZZ_DIR/afl_config.sh" "$afl_path"/afl-fuzz } # Run 1 afl-fuzz instance with CMPLOG (-c 0 + AFL_COMPCOV_LEVEL=2) AFL_COMPCOV_LEVEL=2 start_child "'$afl_path/afl-fuzz' -Q -c 0 -S 'afl-compcov' -i '$corpus_path' -o '$output_path' -- '$target_path' instance "$afl_path/afl-fuzz" -Q -M "afl-main" -i "$corpus_path" -o "$output_path" -- "$target_path"
,它其实是个LD_PRELOAD library 5、只插桩你需要的部分 只对我们想要测试的库插桩,全部库插桩便会降低fuzz的性能 6、并行执行fuzzer 可以启用一个-M,多个-S的方式启用多个afl-fuzz kernel/sched_child_runs_first echo 1 >/proc/sys/kernel/sched_autogroup_enabled 9、如果上面都无效,使用-d 这个模式可以使afl-fuzz
看过afl-fuzz的源码,之后再看afl-showmap,很多代码都是copy过去的 main函数 首先还是参数解析 -o:指定afl-showmap输出的文件名 -m:内存限制 -t:设置超时值 - 就是只获取边,不用获取边的频率 -q:安静模式 -Z:安静模式,和cmin_mode置1,会影响输出文件的格式 -A:指定输入的文件,替代命令行的@@ -Q:qemu模式 -b:输出的是二进制格式,类似于afl-fuzz
RAM磁盘以及从AFL Fuzzing中保存你的SSD 使用American Fuzzy Lop狩猎Bug American Fuzzy Lop在真实案例中的高级使用 使用afl-fuzz隔离Python Fuzzing Perl: American Fuzzy Lops的故事 使用AFL-Fuzz Fuzzing,一个练习示例(AFL vs Binutils) Fuzzing的重要性? Fuzzer(仅适用于Linux)- American Fuzzy Lop Fuzzer 由Michal Zalewski aka lcamtuf发布 Win AFL- Linux下的智能模糊测试神器afl-fuzz
/afl-fuzz 出现如下界面,说明安装成功。 ? AFLSmart 的使用 熟悉 AFL 的朋友,对于 AFLSmart 的使用应该不会太陌生,AFlSmart 的使用方法与 AFL 基本一致。 /afl-fuzz -i ../testaflsmart/tcpdump/in/ -o ..
} 修改后只需要重新编译这个模块即可: make -C modules/wechat_qrcode 生成的测试二进制文件为 build/bin/opencv_test_wechat_qrcode: afl-fuzz int len = __AFL_FUZZ_TESTCASE_LEN; fuzz_buf(buf, len); } return 0; } 这次执行就不需要 @@ 了,可以直接运行: afl-fuzz 我们的目标是创建一个代表二维码图片的 Mat,最好是能够保存到磁盘中并从磁盘读取,方便我们使用 afl-fuzz 指定语料并进行 fuzz。 并使用下面的命令去启动: env AFL_CUSTOM_MUTATOR_ONLY=1 PYTHONPATH=$PWD/mutators AFL_PYTHON_MODULE=random_qrcode afl-fuzz Anyway,最终运行结果: $ afl-whatsup -s output/ /usr/local/bin/afl-whatsup status check tool for afl-fuzz by
American Fuzzy Lop (AFL) 虽然现代AFL已加入覆盖率引导,但最初版本是基于变异的经典工具: # AFL基本使用方法 afl-fuzz -i input_dir -o output_dir /configure make 模糊测试执行: # 执行模糊测试 afl-fuzz -i input_dir -o output_dir . /target @@ # 从实例 afl-fuzz -i- -o output_dir -S slave1 . /target @@ afl-fuzz -i- -o output_dir -S slave2 . -limage_library 5.1.3 执行模糊测试 # 使用AFL执行模糊测试 afl-fuzz -i seeds/jpeg -o results/jpeg -m none -t 2000 .
1.首先使用以下命令编译该程序: afl-gcc -g -fsanitize=address imgRead.c -o imgread 2.运行以下命令: afl-fuzz -i input -o output
以AFL++代理运行Fpicker,并跟目标进程绑定,然后测试指定功能函数: afl-fuzz -i examples/test-network/in -o .
/configure $ AFL_USE_UBSAN=1/AFL_USE_ASAN=1/AFL_HARDEN=1 make -j$(nproc) $ afl-fuzz -i seed -o out /expr_asan $ AFL_IMPORT_FIRST=1 AFL_NO_UI=1 afl-fuzz -i- -o out -L 0 -x expr.dict -S slaveX .
/bin/bash afl-fuzz -m none -i input -o output -U python3 ./wrapper_fuzz.py @@ 希望能帮到路过的人。
/afl-fuzz -Safl -i /tmp/seeds -o /tmp/workdir/ .
/configuremake# 启动模糊测试afl-fuzz -i input_cases/ -o output_dir/ -- .
afl-fuzz进程树 我们可以得到 drrun.exe 执行的命令参数如下: C:\temp\DynamoRIO\bin32\drrun.exe -pidfile childpid_95fa18fc9031bf0d.txt
libprotobuf-mutator_fuzzing_learning/4_libprotobuf_aflpp_custom_mutator/lpm_aflpp_custom_mutator.so \ AFL_SKIP_CPUFREQ=1 \ afl-fuzz
/afl-fuzz -i testcase_dir -o findings_dir /path/to/program @@ .