每天学一个Kali工具·Day04|ffuf:WebFuzzing瑞士军刀

admin 2026-09-14 04:31:43 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 本文介绍Kali工具ffuf的用法,作为Web模糊测试瑞士军刀,支持目录爆破、虚拟主机发现、GET/POST参数爆破等场景。核心是FUZZ关键词替换请求任意位置,配合匹配器与过滤器精准筛选结果。文章详解四大经典示例、多字典组合模式及10条实战命令,并强调授权测试与限速合规要求。 综合评分: 82 文章分类: 渗透测试,WEB安全,安全工具


每天学一个 Kali 工具 · Day04 | ffuf:Web Fuzzing 瑞士军刀

原创

0day收割机 0day收割机

0day收割机

2026年8月22日 16:30 山东

在小说阅读器读本章

去阅读

在公众号小说中沉浸阅读

摘要:「每天学一个 Kali 工具」第四天。前三天我们把目录爆破三件套(dirb / feroxbuster)学了个遍,今天换个玩法——ffuf 不只能扫目录,还能 Fuzz 参数、Fuzz 主机头、Fuzz POST 数据,一把真正的 Web 模糊测试瑞士军刀。文末附官方示例精讲 + 实战速查,建议收藏。


写在前面

回顾一下这个系列的前三天:

  • Day01 Nmap:摸清目标开了哪些端口;
  • Day02 dirb:挖出网站的隐藏目录;
  • Day03 feroxbuster:更快更智能的目录爆破。

今天的主角ffuf(全称Fuzz Faster U Fool,名字就很狂)是同类工具里最灵活的一个。它同样是 Go 语言编写、速度飞快,但定位不一样:

目录爆破只是它的副业,它真正的主业是”模糊测试”(Fuzzing)——任何能放进 HTTP 请求的东西,它都能拿来爆破。


一、ffuf 是什么?

Kali 官网的定义:

ffuf 是一款用 Go 编写的快速 Web 模糊测试工具,支持目录发现、虚拟主机发现(无需 DNS 记录)以及 GET/POST 参数模糊测试。

官网还特意点明:它对渗透测试工程师、道德黑客和取证专家都很有用。

理解 ffuf 只需要抓住一个核心概念——FUZZ 关键词:

你在请求的任何位置放上一个 FUZZ,ffuf 就会用字典里的每个词去替换它,然后发请求、比结果:

http://目标/FUZZ            → 目录爆破http://目标/?id=FUZZ        → GET 参数爆破Host: FUZZ                  → 虚拟主机爆破{”name”: ”FUZZ”}            → POST 数据爆破

同一个工具,换个位置就是完全不同的攻击面。这就是它”瑞士军刀”称号的由来。


二、快速上手:官网四大经典示例精讲

示例 1:目录爆破(最基础用法)

ffuf -w wordlist.txt -u https://example.org/FUZZ -mc all -fs 42 -c -v

参数解读:

  • -w wordlist.txt

    :指定字典文件;

  • -u

    :目标 URL,FUZZ 标记爆破点;

  • -mc all

    :匹配所有状态码;

  • -fs 42

    :过滤掉响应大小为 42 字节的页面——典型的”伪 404″过滤手法;

  • -c -v

    :彩色输出 + 详细模式。

示例 2:虚拟主机发现(隐藏子域名)

ffuf -w hosts.txt -u https://example.org/ -H ”Host: FUZZ” -mc 200

把 FUZZ 放到 Host 请求头里,就能爆破出没有 DNS 记录的虚拟主机——比如 admin.example.org、dev.example.org 这种只在服务器配置里存在、公网查不到的站点。

示例 3:POST JSON 参数爆破

ffuf -w entries.txt -u https://example.org/ -X POST \  -H ”Content-Type: application/json” \  -d '{”name”: ”FUZZ”, ”anotherkey”: ”anothervalue”}' -fr ”error”

这次 FUZZ 进了 POST 请求体。-fr “error” 表示过滤掉响应里包含 “error” 的结果——只保留可能”打对了”的请求。

示例 4:多字典组合爆破(高阶玩法)

ffuf -w params.txt:PARAM -w values.txt:VAL \  -u https://example.org/?PARAM=VAL -mr ”VAL” -c

同时用两本字典:PARAM 爆破参数名,VAL 爆破参数值。-mr “VAL” 只保留响应中回显了参数值的结果——典型的反射点检测,是挖 XSS 的经典手法。


三、ffuf 的精髓:匹配器与过滤器

ffuf 的输出是一个漂亮的交互式表格,每行包含状态码、行数、单词数、响应大小和目标地址。但字典几万个词,真正的”发现”往往就几条——所以过滤是 ffuf 的核心技能。

匹配器(要什么):

-mc 200,301 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;匹配指定状态码(默认含 200-299、301、302、401、403、500 等)-mr <正则> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 匹配响应内容(正则表达式)-ms <大小> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 匹配响应字节数-ml <行数> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 匹配响应行数-mw <词数> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 匹配响应单词数-mt >100 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 匹配响应时间(如大于 100 毫秒,盲注检测思路)

过滤器(不要什么):

-fc 404 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;过滤状态码-fr <正则> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 过滤响应内容-fs 42 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 过滤响应大小-fl <行数> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 过滤行数-fw <词数> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 过滤词数

自动校准(懒人福音):

-ac &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;自动校准:ffuf 自己探测目标的”默认响应”长什么样,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;自动把这类响应过滤掉,不用再手动 -fs/-fw

新手建议:先加-ac跑一遍,搞不定再手动配过滤器。


四、常用参数速查表(建议截图收藏)

① HTTP 请求

-u &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 目标地址(FUZZ 标记爆破点)-X <方法> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 请求方法(GET/POST 等)-H <请求头> &nbsp; &nbsp; &nbsp; &nbsp; 自定义请求头,可多个-d <数据> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; POST 请求体-b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;携带 Cookie(支持”Copy as cURL”格式)-r &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;跟随重定向-x <代理> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 走代理(http 或 socks5)-replay-proxy &nbsp; &nbsp; &nbsp; 只把命中的请求发给代理(Burp 用户福音)-timeout <秒> &nbsp; &nbsp; &nbsp; 请求超时(默认 10 秒)-recursion &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;递归扫描-recursion-depth &nbsp; &nbsp;递归深度

② 通用控制

-t <线程数> &nbsp; &nbsp; &nbsp; &nbsp; 并发线程(默认 40)-rate &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;限制每秒请求数-p <延迟> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 请求间延迟,支持随机范围如 ”0.1-2.0”-maxtime <秒> &nbsp; &nbsp; &nbsp; 整体最长运行时间-sf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 95% 以上响应都是 403 时自动停止(防白跑)-c &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;彩色输出-v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;详细模式,显示完整 URL-s &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;静默模式-ac &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 自动校准过滤

③ 字典与输入

-w <路径> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 字典文件(可用 :关键词 命名,如 wordlist.txt:USER)-e <扩展名> &nbsp; &nbsp; &nbsp; &nbsp; 附加扩展名(配合 -D 兼容 DirSearch 风格)-ic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 忽略字典中的注释行-mode <模式> &nbsp; &nbsp; &nbsp; &nbsp;多字典组合模式:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clusterbomb(全组合,默认)/ pitchfork(逐行配对)/ sniper(逐个替换)-input-cmd <命令> &nbsp; 用命令动态生成字典(如 crunch、seq)-enc <编码> &nbsp; &nbsp; &nbsp; &nbsp; 关键词编码,如 'FUZZ:urlencode b64encode'-request <文件> &nbsp; &nbsp; 从原始 HTTP 请求文件导入(可从 Burp 复制)

④ 输出

-o <文件> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结果保存到文件-of <格式> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;输出格式:json / html / md / csv / all-od <目录> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;把每条命中的响应单独存成文件-noninteractive &nbsp; &nbsp; 关闭交互式界面(脚本化必备)


五、三种多字典模式,一次讲透

同时传两本字典时,-mode 决定怎么组合:

| 模式 | 行为 | 适用场景 | | — | — | — | | clusterbomb (默认) | 全排列组合:A 字典每个词 × B 字典每个词 | 参数名+参数值、用户名+密码 | | pitchfork | 逐行配对:A 第 1 行配 B 第 1 行 | 已知成对数据,如账号:密码列表 | | sniper | 每次只替换一个位置,其他保持原值 | 排查哪个位置才是关键变量 |

举个例子:users.txt 100 行、pass.txt 100 行——

  • clusterbomb

    :100 × 100 = 10000 个请求

  • pitchfork

    :100 个请求

算清楚请求量再选模式,不然字典一大就收不了场。


六、实战速查:10 条最常用的 ffuf 命令

# 1. 目录爆破 + 自动校准(万能起手式)ffuf&nbsp;-u http://目标/FUZZ -w /usr/share/wordlists/dirb/common.txt -ac -c&nbsp;# 2. 目录爆破 + 扩展名ffuf&nbsp;-u http://目标/FUZZ -w common.txt -e .php,.html,.txt -ac&nbsp;# 3. 虚拟主机发现(挖隐藏站点)ffuf&nbsp;-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt&nbsp;\&nbsp; -u http://目标/ -H ”Host: FUZZ.目标.com” -ac&nbsp;# 4. GET 参数名发现ffuf&nbsp;-u ”http://目标/index.php?FUZZ=1” -w 参数字典.txt -ac&nbsp;# 5. POST 登录参数爆破ffuf&nbsp;-u http://目标/login -X POST -d ”username=admin&password=FUZZ”&nbsp;\&nbsp; -w 密码字典.txt -fc&nbsp;401&nbsp;# 6. 多字典组合爆破(clusterbomb)ffuf&nbsp;-w users.txt:USER -w pass.txt:PASS&nbsp;\&nbsp; -u http://目标/login -d ”user=USER&pass=PASS” -mode clusterbomb -fc&nbsp;401&nbsp;# 7. 递归扫描子目录ffuf&nbsp;-u http://目标/FUZZ -w common.txt -recursion -recursion-depth&nbsp;3&nbsp;-ac&nbsp;# 8. 结果输出为 Markdown 报告ffuf&nbsp;-u http://目标/FUZZ -w common.txt -ac -o result -of md&nbsp;# 9. 命中结果重放到 Burp 细看ffuf&nbsp;-u http://目标/FUZZ -w common.txt -ac&nbsp;\&nbsp; -replay-proxy http://127.0.0.1:8080&nbsp;# 10. 限速 + 超时控制,礼貌扫描ffuf&nbsp;-u http://目标/FUZZ -w big.txt -rate&nbsp;20&nbsp;-timeout&nbsp;5&nbsp;-ac

七、合规提醒(重要!)

照例,每天必念的安全经:

  • ffuf 默认 40 线程,配合大字典短时间内能发出海量请求,只在自有或已获书面授权的目标上使用;
  • 参数爆破、登录爆破类操作极易触发告警和封禁,务必先用 -rate 限速小范围试探;
  • 爆破出来的账号、密码等敏感数据,仅限授权测试场景使用。

今日小结

  • ffuf 是 Go 编写的快速 Web 模糊测试工具,核心思想是”一切皆可 FUZZ”;
  • 四大主场:目录爆破、虚拟主机发现、GET 参数爆破、POST 数据爆破;
  • 玩转过滤就玩转了 ffuf:-ac 自动校准打底,-fc/-fs/-fw/-fr 精细过滤;
  • 多字典三模式要记牢:clusterbomb 全组合、pitchfork 逐行配、sniper 逐个试。

觉得有用的话,点赞 + 在看 + 转发,你的支持是我日更的动力!关注本号,每天 5 分钟,一起从小白练成 Kali 老鸟。


参考资料:Kali Linux 官方工具文档

(https://www.kali.org/tools/ffuf/)

官方仓库与更多示例:https://github.com/ffuf/ffuf


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:0day收割机 0day收割机 0day收割机《每天学一个 Kali 工具 · Day04 | ffuf:Web Fuzzing 瑞士军刀》

评论:0   参与:  0