【问题标题】:How to run the code using AFL on terminal如何在终端上使用 AFL 运行代码
【发布时间】:2021-02-13 14:32:19
【问题描述】:

我有一些我正在尝试使用 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 运行此代码以查找漏洞。非常感谢任何帮助。

【问题讨论】:

    标签: c++ c unit-testing testing terminal


    【解决方案1】:

    您必须首先使用 afl-clang 构建您的代码

    afl-clang

    $ afl-clang input-testcode.c -o input-testcode .

    然后:

    $ afl-fuzz -i CScanner-master -o code ./input-testcode .

    我希望它有效 Afl-fuzz 适用于可执行文件

    【讨论】:

      猜你喜欢
      • 2022-12-07
      • 1970-01-01
      • 2015-01-19
      • 2013-04-14
      • 2012-09-04
      • 2021-02-09
      • 1970-01-01
      • 2017-04-18
      • 2016-04-17
      相关资源
      最近更新 更多