CeWL 使用指南:基础与进阶方法
一、基础使用方法
1. 基本爬取
cewl http://example.com -w output.txt
- 爬取目标网站所有可见文本
- 生成字典保存到
output.txt
2. 控制爬取深度
cewl http://example.com -d 2 -w depth_words.txt
3. 设置最小单词长度
cewl http://example.com -m 6 -w long_words.txt
4. 包含数字组合
cewl http://example.com --with-numbers -w num_words.txt
二、进阶使用方法
1. 元数据收集
cewl http://example.com -a -w meta_data.txt
-a
:收集作者、邮件等元信息- 可获取如
<meta name="author" content="admin">
等内容
2. 邮箱地址抓取
cewl http://example.com -e -w emails.txt
3. 登录页面关键词抓取
cewl http://example.com/login -m 5 --lowercase -w login_terms.txt
- 针对登录页面收集关键词
--lowercase
:统一转为小写
4. 代理设置
cewl http://example.com --proxy http://127.0.0.1:8080
5. 组合优化字典
cewl http://example.com -m 5 | sort | uniq > final_dict.txt
三、实战技巧
1. 密码策略分析
cewl http://company.com/careers -m 8 --with-numbers
- 通过招聘页面收集公司密码策略(如"要求8位含数字")
2. 多站点联合字典
cewl http://site1.com -w temp1.txt
cewl http://site2.com -w temp2.txt
cat temp1.txt temp2.txt | sort -u > combined.txt
3. 特殊字符处理
cewl http://example.com | sed 's/$/!/' > with_special.txt
- 给所有单词添加特殊字符(如"password!")
四、工具联动
1. 结合Hydra爆破
cewl http://target.com/login -w passwords.txt
hydra -L users.txt -P passwords.txt http-post-form "/login:user=^USER^&pass=^PASS^:Invalid"
2. 使用John优化字典
cewl http://target.com -w base.lst
john --wordlist=base.lst --rules --stdout > enhanced.lst
3. 搭配Crunch生成组合
cewl http://target.com -m 3 -w words.txt
crunch 6 6 -t @@@%%% -p $(cat words.txt | head -5) > combos.txt
五、注意事项
- 合法性:仅对授权目标使用
- 速率控制:添加
--delay 3
参数(3秒延迟) - 递归深度:商业站点建议
-d 1
避免封禁 - 用户代理:使用
-u "Mozilla/5.0"
伪装浏览器 - HTTPS证书:遇到错误时添加
--no-ssl-check
六、典型输出示例
company2023
Welcome@123
admin
qwerty
john.doe@example.com
summer_secret
七、替代方案对比
工具 | 特点 | 适用场景 |
---|
CeWL | 动态生成目标相关字典 | 精准爆破 |
SecLists | 预置通用字典 | 快速测试 |
Mentalist | 图形化规则生成 | 复杂组合 |
Wfuzz | 参数模糊测试 | API测试 |