Fpicker:一款支持多种模式的模糊测试工具套件

admin 2021年10月7日10:21:54评论195 views字数 2568阅读8分33秒阅读模式

Fpicker:一款支持多种模式的模糊测试工具套件

关于Fpicker

Fpicker是一款基于Frida的模糊测试套件,可以帮助广大研究人员以多种模式来进行渗透测试,例如AFL++模式或被动追踪模式等。值得一提的是,该工具可以在所有支持Firda的系统平台上运行。

工具要求

Fpicker运行要求

  • frida_compile

  • frida-core-devkit

AFL++模式要求

macOS:

使用“CFLAGS=”-DUSEMMAP=1””编译。

iOS:

应用aflpp-ios.patch,Fpicker需要在iOS上以root用户身份运行,如果目标不是以root用户身份运行,它将无法读取和写入共享内存。接下来,使用“CFLAGS=”-DUSEMMAP=1””编译。

工具安装

广大研究人员可以使用下列命令将该项目源码克隆至本地:

git clone https://github.com/ttdennis/fpicker.git

项目构建和运行

Fpicker可以在macOS、iOS或Linux平台上运行。Makefile当前仅支持针对iOS和macOS平台进行构建,但我们也可以使用iOS工具链来针对Linux平台进行项目构建。

make fpicker-macos
make fpicker-ios
make fpicker-linux

项目构建完成之后,我们就可以继续构建模糊测试组件了。

首先,我们需要针对目标创建一个自定义模糊测试组件(例如examples/test/test.js)。

接下来,使用frida-compile编译自定义组件:

frida-compile test.js -o harness.js

现在,Fpicker就可以开始对目标进行模糊测试了。具体要执行的命令取决于我们的配置。接下来,我们会给出一些简单的使用样例,大部分样例都在项目中的“examples”目录中给出了。

以AFL++代理运行Fpicker,并跟目标进程绑定,然后测试指定功能函数:

afl-fuzz -i examples/test-network/in -o ./examples/test-network/out -- \./fpicker --fuzzer-mode afl -e attach -p test-network -f ./examples/test-network/harness.js

以单独模式运行Fpicker,跟服务器绑定,运行一个客户端程序来发送模糊测试输出:

./fpicker --fuzzer-mode standalone -e attach -p server-process -f harness.js --input-mode cmd \--command "./client-send @@" -i indir -o outdir

以单独模式运行Fpicker,跟服务器绑定,使用自定义变异cmd进行模糊测试:

./fpicker --fuzzer-mode active --communication-mode shm -e attach -p server-process -f harness.js \-i indir -o outdir --standalone-mutator cmd --mutator-command "radamsa"


以单被动模式运行Fpicker,跟服务器绑定,收集覆盖率和Payload:

./fpicker --fuzzer-mode passive --communication-mode send -e attach -p server-process -o outdir -f harness.js

以单独模式运行Fpicker,跟远程设备上一个正在运行绑定,使用自定义变异cmd进行模糊测试:

./fpicker --fuzzer-mode active -e attach -p test -D remote -o examples/test/out/ -i examples/test/in/ \-f fuzzer-agent.js --standalone-mutator cmd --mutator-command "radamsa"

创建自定义模糊测试组件

我们需要针对不同的目标创建自定义模糊测试组件。下面给出的是一个组件实现样例:

// Import the fuzzer base class
const Fuzzer = require("harness/fuzzer.js");// The custom fuzzer needs to subclass the Fuzzer class to work properly
class TestFuzzer extends Fuzzer.Fuzzer {
constructor() {
// The constructor needs to specify the address of the targeted function and a NativeFunction
// object that can later be called by the fuzzer. const FUZZ_FUNCTION_ADDR = Module.getExportByName(null, "FUZZ_FUNCTION");
const FUZZ_FUNCTION = new NativeFunction(
FUZZ_FUNCTION_ADDR,
"void", ["pointer", "int64"], {
});
        super("test", FUZZ_FUNCTION_ADDR, FUZZ_FUNCTION); }
}
const f = new TestFuzzer();
exports.fuzzer = f;

参考资料

https://insinuator.net/2021/03/fpicker-fuzzing-with-frida/

https://frida.re/docs/javascript-api/#stalker

https://github.com/AFLplusplus/AFLplusplus/

https://github.com/frida/frida-compile

https://github.com/frida/frida/releases

Fpicker:一款支持多种模式的模糊测试工具套件


精彩推荐





Fpicker:一款支持多种模式的模糊测试工具套件

Fpicker:一款支持多种模式的模糊测试工具套件

Fpicker:一款支持多种模式的模糊测试工具套件

Fpicker:一款支持多种模式的模糊测试工具套件

Fpicker:一款支持多种模式的模糊测试工具套件



原文始发于微信公众号(FreeBuf):Fpicker:一款支持多种模式的模糊测试工具套件

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年10月7日10:21:54
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Fpicker:一款支持多种模式的模糊测试工具套件https://cn-sec.com/archives/566854.html

发表评论

匿名网友 填写信息