目录
[WhatWeb 简介](#WhatWeb 简介)
[信息收集(渗透测试前期 Recon)](#信息收集(渗透测试前期 Recon))
[配合代理/WAF 绕过](#配合代理/WAF 绕过)
WhatWeb 简介
WhatWeb 是一个网站指纹识别工具(Web scanner),用于快速识别目标网站所使用的:
- Web 服务器类型(Apache、Nginx、IIS...)
- CMS(WordPress、Joomla、Drupal...)
- 脚本语言(PHP、ASP.NET、Python...)
- 中间件 / 插件 / 版本号
- 以及可能的漏洞信息
它类似于 Wappalyzer 或者 BuiltWith,但更加偏向渗透测试和安全审计。
常见使用场景
基础命令
whatweb https://target.com
信息收集(渗透测试前期 Recon)
在渗透测试早期,快速获取网站指纹:
whatweb -a 1 -v https://target.com
👉 输出简洁、隐蔽,不容易触发 WAF。
批量识别多个目标
针对某个企业资产列表,批量收集指纹:
whatweb -i urls.txt --log-json=results.json
👉 JSON 结果可以用 Python/Pandas 二次分析,比如筛选出所有 WordPress 站点。
伪装成浏览器
whatweb --user-agent "Mozilla/5.0" \
--header "Referer: https://www.google.com" \
--header "Accept-Language: en-US,en;q=0.9" \
https://target.com
- --user-agent "Mozilla/5.0"→ 伪装成浏览器,而不是扫描器。
- --header "Referer: https://www.google.com"→ 假装是从 Google 点进来的。
- --header "Accept-Language: en-US,en;q=0.9"→ 模拟浏览器带的语言设置,看起来更真实。
- https://target.com→ 目标网站。
👉 这条命令的作用就是 让 WhatWeb 的扫描流量更像普通用户访问,降低被发现的概率。
配合代理/WAF 绕过
通过 Burp/Tor 代理隐藏来源,配合自定义 UA:
whatweb -a 2 --proxy socks5://127.0.0.1:9050 \
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" \
https://target.com
👉 用来做更隐蔽的探测,避免被目标记录真实 IP。
漏洞初步筛查
有些组件版本可能存在已知漏洞,WhatWeb 可以识别到版本号:
whatweb -a 4 https://target.com
👉 输出包括 WordPress、Joomla、PHP、jQuery 等版本,可以交给漏洞库(如 CVE)进一步比对。
端口/服务结合
先用 Nmap 扫描存活 Web 端口,再用 WhatWeb 做应用识别:
nmap -p 80,443,8080 --open -iL ips.txt -oG web_hosts.txt
cat web_hosts.txt | awk '/open/{print $2}' | \
xargs -I {} whatweb {}
👉 常用于企业资产梳理。
常用组合命令(速查表)
|------------|-----------------------------------------------------------------|
| 场景 | 命令示例 |
| 快速探测单站 | whatweb -a 1 https://target.com
|
| 详细信息(强扫描) | whatweb -a 4 -v https://target.com
|
| 批量扫描列表 | whatweb -i urls.txt --log-brief=out.txt
|
| JSON 输出供分析 | whatweb -i urls.txt --log-json=out.json
|
| 使用代理(HTTP) | whatweb --proxy http://127.0.0.1:8080 https://target.com
|
| 使用代理(Tor) | whatweb --proxy socks5://127.0.0.1:9050 https://target.com
|
| 自定义 UA 探测 | whatweb --user-agent "Mozilla/5.0" https://target.com
|
| 静默模式(少日志) | whatweb --no-errors --log-brief=result.txt https://target.com
|