web信息收集
web信息收集的目标:
- 确认web服务使用的组件:服务器、框架,通过版本确认是否有漏洞可以利用
- 确认web服务是否存在漏洞
- OWASP Top 10漏洞
1. 指纹识别
- whatweb / wappalyzer - Web 技术栈识别
- nuclei - 自动化漏洞指纹扫描
- httpx - 批量存活与元数据探测
Banner Grabbing / Web Server Headers.
bash
curl -IL https://www.inlanefreight.com
whatweb 10.10.10.121
whatweb --no-errors 10.10.10.0/242. Web目录/子域爆破
Web 目录爆破(目录扫描)是渗透测试中寻找隐藏文件、备份文件或管理后台的关键步骤。其核心原理是通过字典比对或暴力尝试,根据服务器返回的 HTTP 状态码(如 200 表示存在,404 表示不存在)来确定路径。
web目录爆破工具:ffuf、gobuster、dir、dirsearch
dirsearch: 基于python,速度快且输出美观。目前主流 https://github.com/maurosoria/dirsearch
bash
python3 dirsearch.py -u $url -e php,html,txtFuzz: Faster U Fool,是公认速度最快的模糊测试工具之一,用 Go 语言编写。极高的并发能力,不仅能爆破目录,还能爆破参数、子域名等。
bash
# 目录
ffuf -u http://$IP/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
# 虚拟主机
ffuf -u http://$IP/ -H "Host: FUZZ.example.com" -w subdomains.txt -fs <size>
# 参数
ffuf -u "http://$IP/api?FUZZ=test" -w params.txt -fs <size>gobuster: 同样基于 Go 语言,专注于 URI 目录和子域名的爆破。
bash
gobuster dir -u https://example.com -w /path/to/wordlist.txt其他工具:Dirbuster、Dirb
3. 子域名枚举
bash
# Subfinder
subfinder -d example.com -o subs.txt
# Amass
amass enum -d example.com
# crt.sh (证书透明度日志)
curl -s "https://crt.sh/?q=%.example.com&output=json" | jq -r '.[].name_value' | sort -u
gobuster dns -d inlanefreight.com -w /usr/share/SecLists/Discovery/DNS/namelist.txt4. 手动枚举
网页源代码 网页源代码中可能会在注释中残留敏感信息,如账号/密码。
robots.txt robots.txt文件的目的是告诉浏览器引擎,哪些目录网络爬虫可以访问,哪些禁止被访问。可能会揭示一些隐藏的文件/目录
数字证书 SSL/TLS 数字证书中可能包含公司名称、子域名、邮箱等信息。 

