c++ - 如何在终端上使用 AFL 运行代码
问题描述
我有一些我正在尝试使用 AFL 运行的 github。代码:https ://github.com/karimmd/CScanner/tree/cfe7d08bf46b1eed0443f9e27bc089d68a830a45
我想运行该项目并找到漏洞。我已经把github的所有文件都放在了一个文件夹里面code
,所以文件结构是CScanner-master/code/all the files here。我在终端上使用这个命令:
hemlatamahaur@Hemlatas-MacBook-Pro desktop % afl-fuzz -i CScanner-master -o code ./input-testcode.c
afl-fuzz 2.56b by <lcamtuf@google.com>
[+] You have 4 CPU cores and 2 runnable tasks (utilization: 50%).
[+] Try parallel jobs - see /usr/local/Cellar/afl-fuzz/2.57b/share/doc/afl/parallel_fuzzing.txt.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'CScanner-master'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[-] PROGRAM ABORT : Program './input-testcode.c' not found or not executable
Location : check_binary(), afl-fuzz.c:6873
它一直说没有文件作为 input-testcode.c
我是 AFL 的新手,所以我可能做错了。如何使用 AFL 运行此代码以查找漏洞。非常感谢任何帮助。
解决方案
您必须先使用 afl-clang 构建代码
afl-clang
$ afl-clang input-testcode.c -o input-testcode
.
然后:
$ afl-fuzz -i CScanner-master -o code ./input-testcode
.
我希望它有效 Afl-fuzz 适用于可执行文件
推荐阅读
- c++ - Visual Studio 不显示符号表?
- c# - PostgreSQL 中的 ROW_NUMBER 查询?
- php - 如何将值传递给泛光灯自定义变量
- python - 如何将类绑定到另一个小部件
- api - SPA 隐式流 vs 授权流 vs 混合流
- f# - 将 F# (FSharp.Core 4.3.4) 类型提供程序与 .NET Core 2.1 一起使用
- java - 即使在 Java 中加载属性文件后,getProperty 也会返回 null
- excel - 带索引函数的条件百分位数
- php - 短信中的字符串中断(PHP)
- javascript - 使用jquery通过控制台添加创建列表