freeBuf
主站

分类

云安全 AI安全 开发安全 终端安全 数据安全 Web安全 基础安全 企业安全 关基安全 移动安全 系统安全 其他安全

特色

热点 工具 漏洞 人物志 活动 安全招聘 攻防演练 政策法规

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

Fpicker:一款支持多种模式的模糊测试工具套件
Alpha_h4ck 2021-09-25 01:04:31 230420

关于Fpicker

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

工具要求

Fpicker运行要求

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;

项目地址

Fpicker:GitHub传送门

参考资料

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

# 模糊测试 # 模糊测试工具
本文为 Alpha_h4ck 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
Alpha_h4ck LV.10
好好学习,天天向上
  • 2359 文章数
  • 1023 关注者
Tetragon:一款基于eBPF的运行时环境安全监控工具
2025-01-21
DroneXtract:一款针对无人机的网络安全数字取证工具
2025-01-21
CNAPPgoat:一款针对云环境的安全实践靶场
2025-01-21
文章目录