ariary/cfuzz
GitHub: ariary/cfuzz
Stars: 94 | Forks: 10
# cfuzz
与 [`wfuzz`](https://github.com/xmendez/wfuzz) 类似,但专为**命令行模糊测试**设计。能够模糊测试任意命令行执行并过滤结果。
*也是暴力破解的好帮手*
**为什么?**
执行模糊测试或暴力破解时,我们有大量出色的工具(用于 Web 模糊测试的 [`fuff`](https://github.com/ffuf/ffuf) 和 [`wfuzz`](https://github.com/xmendez/wfuzz),用于网络暴力破解的 [`hydra`](https://github.com/vanhauser-thc/thc-hydra),仅举几例)。**`cfuzz`** 提供了一种不同的思路——退后一步。**目标是能够对任何可以转化为命令行的方式进行模糊测试/暴力破解。** 因此,`cfuzz` 可以被看作是针对简单用例的替代工具,或作为扩展工具,因为它支持极其广泛的用例。 *理念起源:当时对 IPMI 服务进行暴力破解以枚举用户。三个选项:使用 `msfconsole`、为 `hydra` 编写模块、手动或程序化解析 `ipmitool` 输出* ## 演示
与 [`wfuzz`](https://github.com/xmendez/wfuzz) 类似,但专为**命令行模糊测试**设计。能够模糊测试任意命令行执行并过滤结果。
*也是暴力破解的好帮手*
{ 安装 ; 使用 }
执行模糊测试或暴力破解时,我们有大量出色的工具(用于 Web 模糊测试的 [`fuff`](https://github.com/ffuf/ffuf) 和 [`wfuzz`](https://github.com/xmendez/wfuzz),用于网络暴力破解的 [`hydra`](https://github.com/vanhauser-thc/thc-hydra),仅举几例)。**`cfuzz`** 提供了一种不同的思路——退后一步。**目标是能够对任何可以转化为命令行的方式进行模糊测试/暴力破解。** 因此,`cfuzz` 可以被看作是针对简单用例的替代工具,或作为扩展工具,因为它支持极其广泛的用例。 *理念起源:当时对 IPMI 服务进行暴力破解以枚举用户。三个选项:使用 `msfconsole`、为 `hydra` 编写模块、手动或程序化解析 `ipmitool` 输出* ## 演示
|用户密码暴力破解|
|:---:|
||
## 安装
从发行版安装:
```
curl -lO -L -s https://github.com/ariary/cfuzz/releases/latest/download/cfuzz && chmod +x cfuzz
```
使用 Go 安装:
```
go install github.com/ariary/cfuzz/cmd/cfuzz@latest
```
## 用法
指定:
* 命令,其中模糊部分使用关键字 `FUZZ` 标记
* 单词列表
然后开始执行!
```
export CFUZZ_CMD="printf FUZZ | sudo -S id" # Example bruteforcing user password, I haven't found better
cfuzz -w [wordlist]
```
或者如果你希望在一行中完成:
```
# 子域名枚举示例
cfuzz -w [wordlist] ping -c 4 FUZZ.domain.net
```
此外,还可以:
* **[过滤结果](#filter-results)**
* **[自定义显示字段](#displayed-field)**
* **[配置 `cfuzz` 运行](#cfuzz-run-configuration)**
* **[使用 AI 生成单词列表](#ai-features)**
* **[将 `cfuzz` 作为 MCP 服务器使用](#mcp-server)**
### 过滤结果
此外,还可以过滤显示的結果:
**标准输出过滤器:**
```
--stdout-min n show only if stdout character count >= n
--stdout-max n show only if stdout character count <= n
--stdout-eq n show only if stdout character count == n
--stdout-word w show only if stdout contains word w (repeatable)
```
**标准错误过滤器:**
```
--stderr-min n show only if stderr character count >= n
--stderr-max n show only if stderr character count <= n
--stderr-eq n show only if stderr character count == n
--stderr-word w show only if stderr contains word w (repeatable)
```
**执行时间过滤器:**
```
--time-min n show only if execution time >= n seconds
--time-max n show only if execution time <= n seconds
--time-eq n show only if execution time == n seconds
```
**命令退出码过滤器:**
```
--success show only if execution returns exit code 0
--failure show only if execution returns a non-zero exit code
```
要仅显示未通过过滤器的结果,请使用 `-H` 或 `--hide` 标志。
### `cfuzz` 运行配置
为了使 `cfuzz` 更灵活并适应不同约束,支持多种选项:
```
-w, --wordlist wordlist file(s) for fuzzing (repeatable with --spider)
-d, --delay delay in ms between goroutine launches (default: 0)
-j, --threads max concurrent workers (default: 50)
-k, --keyword keyword to replace in command (default: FUZZ)
-s, --shell shell to use for execution (default: /bin/bash)
--timeout command execution timeout in seconds (default: 30)
-i, --input provide command stdin
--stdin-fuzzing fuzz stdin instead of command line
-m, --spider fuzz multiple keyword positions (requires multiple -w)
--stdin-wordlist read wordlist from cfuzz stdin
```
### 显示字段
也可以选择在 `cfuzz` 输出中显示哪些结果字段(支持多选):
```
--stdout-chars display stdout character count
--stderr-chars display stderr character count
-t, --time display execution time
-c, --code display exit code
--no-banner hide banner
-r, --only-word print only matched words (no metadata columns)
-f, --full-output display full command execution output (can't be combined with other display modes)
```
### AI 功能
`cfuzz` 集成了 Claude(通过 Anthropic API)用于两种 AI 驱动的工作流。两者都需要设置 `ANTHROPIC_API_KEY` 环境变量。
**AI 过滤器**——用自然语言描述有趣结果的特征;`cfuzz` 会请求 Claude 评估每个执行结果,仅显示匹配项:
```
cfuzz -w wordlist.txt --ai-filter "output contains an error about invalid credentials" \
curl -s http://target/login -d "user=admin&pass=FUZZ"
```
**AI 单词列表生成**——通过描述需求生成上下文感知的单词列表:
```
cfuzz wordlist "default credentials for network switches"
cfuzz wordlist "common web admin paths" -n 50
```
输出打印到标准输出,每行一个条目,便于直接通过管道传入 `cfuzz`:
```
cfuzz wordlist "linux privilege escalation binaries" | \
cfuzz --stdin-wordlist "sudo -l FUZZ 2>/dev/null | grep -v 'not allowed'"
```
### MCP 服务器
`cfuzz` 可以作为 [模型上下文协议](https://modelcontextprotocol.io) 服务器运行,暴露一个 `fuzz` 工具,任何 MCP 兼容的 AI 助手均可调用:
```
cfuzz mcp
```
要在 Claude Desktop 中注册,请添加到 `~/.claude/claude_desktop_config.json`:
```
{
"mcpServers": {
"cfuzz": { "command": "cfuzz", "args": ["mcp"] }
}
}
```
`fuzz` 工具接受以下参数:`command`(字符串)、`wordlist`(字符串数组),以及可选的 `threads`、`timeout`、`success_only`、`stdout_word` 和 `ai_filter` 参数。标签:DOS头擦除, EVTX分析, Go语言, IPMI, PoC, T1110, T1582, T1589, wfuzz 替代, 二进制发布, 命令行模糊测试, 子域名枚举, 安全测试, 密码爆破, 密码破解, 开源工具, 攻击性安全, 暴力破解, 程序破解, 系统安全