目录爆破:dirsearch与ffuf实战

目录爆破实战:dirsearch 和 ffuf 完整对比,字典选择、参数爆破、Header 爆破、输出过滤。

写在前面:合法学习边界

目录爆破只在授权测试环境进行。对非授权目标爆破目录可能触犯法律。

一、工具对比

目录爆破工具对比
1
2
dirsearch:功能全面,内置字典,适合快速扫描
ffuf:速度快,灵活,适合高级用法(参数/Header/POST)

二、dirsearch 命令

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 基础扫描
dirsearch -u http://target -e .php,.html

# 指定字典
dirsearch -u http://target -w /path/big.txt

# 深度扫描
dirsearch -u http://target --deep

# 带 Cookie
dirsearch -u http://target -H "Cookie: admin=1"

# 过滤状态码
dirsearch -u http://target --exclude-status 404

三、ffuf 命令

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 目录爆破
ffuf -u http://target/FUZZ -w words.txt

# 参数爆破
ffuf -u http://target/?id=FUZZ -w params.txt

# POST 数据
ffuf -u http://target -d "id=FUZZ" -w words.txt

# 排除 404
ffuf -u http://target/FUZZ -w words.txt -fc 404

四、小结

dirsearch 适合快速发现目录,ffuf 适合高级爆破。两者结合使用效率最高:先 dirsearch 快速摸底,再 ffuf 深度挖掘。