OSINT 工具集
OSINT (Open Source Intelligence,开源情报) 工具用于从公开渠道收集和分析信息。本文整理了常用的 OSINT 工具和资源。
综合性 OSINT 框架
自动化 OSINT 收集框架,支持 100+ 数据源。
1 2 3 4 5 6 7 8 9 10 11 12
| git clone https://github.com/smicallef/spiderfoot.git cd spiderfoot pip3 install -r requirements.txt python3 sf.py -l 127.0.0.1:5001
python3 sf.py -m auto_scan -t example.com -o output.json python3 sf.py -m scan_all -t example.com
|
支持的扫描类型:
- 域名和 DNS 信息
- 邮箱地址收集
- 社交媒体账号
- 网络基础设施
- 文档和元数据
- 恶意软件关联
2. Maltego
可视化情报分析平台,支持图形化展示关联关系。
版本:
- Maltego Community (免费)
- Maltego Classic (商业)
常用转换:
- DNS 枚举
- Whois 查询
- 社交媒体搜索
- 域名关联分析
- 邮箱关联分析
- IP 地址关联
3. OSINT Framework
在线 OSINT 工具集合,按用途分类。
域名和 DNS 工具
DNS 查询
SecurityTrails
DNS Dumpster
ViewDNS
子域名发现
1 2 3 4 5 6 7 8 9
| subfinder -d example.com -o subs.txt
amass enum -passive -d example.com
go install github.com/tomnomnom/assetfinder@latest assetfinder --subs-only example.com
|
网络资产测绘
Shodan
互联网设备搜索引擎。
1 2 3 4 5 6 7 8 9 10 11 12
| pip install shodan shodan init YOUR_API_KEY
shodan host 8.8.8.8
shodan search "port:80 product:nginx"
curl "https://api.shodan.io/shodan/host/search?query=apache&key=YOUR_API_KEY"
|
Censys
互联网资产搜索引擎。
1 2 3 4 5 6
| pip install censys censys search "services.tls.certificate.parsed.names: example.com"
curl "https://search.censys.io/api/v2/hosts/search?q=services.service_name:HTTP"
|
Fofa
中文网络资产搜索引擎。
1 2 3 4 5
| # 搜索语法 domain="example.com" cert="example.com" port="8080" country="CN"
|
Hunter
面向中文的网络空间测绘。
1 2 3 4
| # 搜索语法 domain.example.com web.body="example.com" ip="1.1.1.1"
|
ZoomEye
网络设备搜索引擎。
1 2 3 4 5 6 7
| curl "https://api.zoomeye.org/host/search?query=nginx"
pip install zoomeye from zoomeye import ZoomEye ze = ZoomEye(api_key="YOUR_API_KEY")
|
搜索引擎和 Google Dorks
Google 高级搜索语法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| # 站点内搜索 site:example.com
# 搜索特定文件类型 site:example.com filetype:pdf site:example.com filetype:xls site:example.com filetype:env
# 搜索敏感信息 site:example.com intext:"password" site:example.com intext:"api_key" site:example.com inurl:admin
# GitHub 搜索 site:github.com password site:github.com api_key
|
GHDB (Google Hacking Database)
Bing 高级搜索
1 2 3 4 5 6 7 8
| # 链接到站点 linkfromdomain:example.com
# 包含关键词 inbody:password
# URL 包含 inurl:admin
|
社交媒体侦察
Sherlock
查找用户名在各社交平台的账号。
1 2 3 4 5 6 7 8 9 10
| git clone https://github.com/sherlock-project/sherlock.git cd sherlock python3 -m pip install -r requirements.txt
python3 sherlock user123
python3 sherlock --folderoutput output user1 user2 user3
|
Social-Analyzer
社交媒体和用户名分析工具。
1 2 3 4 5 6
| git clone https://github.com/qeeqbox/social-analyzer.git cd social-analyzer
docker run --rm -v /local/output:/app/output qeeqbox/social-analyzer --username "user123" --websites "github,linkedin,twitter"
|
Maigret
收集用户在各平台的信息。
1 2 3 4 5 6 7 8
| pip3 install maigret
maigret user123
maigret user123 --folderoutput reports/
|
邮箱和用户名工具
theHarvester
邮箱、子域名和主机名收集工具。
1 2 3 4 5 6 7 8 9 10 11 12 13
| git clone https://github.com/laramies/theHarvester.git cd theHarvester pip3 install -r requirements.txt
python3 theHarvester.py -d example.com -b google -l 500
python3 theHarvester.py -d example.com -b google,bing,bingapi,yahoo,linkedin
python3 theHarvester.py -d example.com -b google -f results.html
|
Holehe
检查邮箱是否在网站注册。
1 2 3 4 5 6 7 8
| pip3 install holehe
holehe example@gmail.com
holehe emails.txt
|
IP 和地理位置工具
IPinfo
IP 地址信息查询。
1 2 3 4 5 6 7 8
| pip install ipinfo
ipinfo 8.8.8.8
cat ips.txt | ipinfo batch
|
MaxMind GeoIP
高精度地理位置数据库。
1 2 3 4 5 6 7 8 9
| pip install geoip2
python3 import geoip2.database reader = geoip2.database.Reader('GeoLite2-City.mmdb') response = reader.city('8.8.8.8') print(response.country.names['zh-CN'])
|
证书透明度日志
crt.sh
证书透明度日志查询。
1 2 3 4 5
| curl "https://crt.sh/?q=%.example.com&output=json" | jq -r '.[].name_value' | sort -u
curl -s "https://crt.sh/?q=example.com&output=json" | jq -r '.[].name_value'
|
Censys Certificate Search
1 2
| curl "https://search.censys.io/api/v2/certificates/search?q=parsed.names: example.com"
|
GitHub 情报搜集
GitHub Dorks
常用搜索语法:
1 2 3 4 5 6 7 8 9 10
| # 搜索代码 org:target filename:.env password org:target filename:config.ini api_key
# 搜索仓库 org:target stars:>100 org:target language:python
# 搜索问题 org:target is:open security
|
GitDorker
GitHub 敏感信息搜索工具。
1 2 3 4 5 6 7
| git clone https://github.com/UncleJ4ck/gitdorker.git cd gitdorker pip3 install -r requirements.txt
python3 gitdorker.py -i domains.txt -s dorks.txt -o output/
|
TruffleHog
搜索代码仓库中的敏感信息。
1 2 3 4 5 6 7 8
| go install github.com/trufflesecurity/trufflehog/v3/cmd/trufflehog@latest
trufflehog git https://github.com/org/repo --json
trufflehog filesystem /path/to/code --json
|
威胁情报工具
VirusTotal
恶意软件和 URL 分析。
1 2 3 4 5
| curl "https://www.virustotal.com/vtapi/v2/ip-address/report?apikey=YOUR_API_KEY&ip=8.8.8.8"
pip install virustotal-python
|
AlienVault OTX
开放威胁交换平台。
1 2 3 4 5
| curl "https://otx.alienvault.com/api/v1/indicators/IPv4/8.8.8.8"
pip install OTXv2
|
人员信息工具
人员和企业信息收集工具。
1 2 3 4 5 6 7
| git clone https://github.com/spiderfoot/Hunchly.git cd Hunchly pip install -r requirements.txt
python3 hunchly.py -n "姓名" -l "地点"
|
Pipl
人员搜索 API(商业)。
1 2 3 4
| curl -X POST "https://api.pipl.com/v5/search/" \ -H "Authorization: bearer YOUR_API_KEY" \ -d '{"email": "example@gmail.com"}'
|
图像情报工具
TinEye
反向图像搜索。
Google 图片搜索
Yandex 图片
元数据分析
读取和写入文件元数据。
1 2 3 4 5 6 7 8 9 10 11 12
|
exiftool image.jpg
exiftool -r /path/to/images/
exiftool -json image.jpg
|
在线元数据查看器。
工作流整合
自动化 OSINT 收集脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| #!/bin/bash
DOMAIN="example.com" OUTPUT_DIR="osint_results_${DOMAIN}" mkdir -p $OUTPUT_DIR
echo "[*] OSINT 枚举开始: $DOMAIN"
echo "[+] 子域名发现" subfinder -d $DOMAIN -silent > $OUTPUT_DIR/subdomains.txt assetfinder --subs-only $DOMAIN >> $OUTPUT_DIR/subdomains.txt cat $OUTPUT_DIR/subdomains.txt | sort -u > $OUTPUT_DIR/subdomains_final.txt
echo "[+] DNS 枚举" dig $DOMAIN ANY > $OUTPUT_DIR/dns_any.txt whois $DOMAIN > $OUTPUT_DIR/whois.txt
echo "[+] 邮箱收集" theHarvester.py -d $DOMAIN -b google -l 500 -f $OUTPUT_DIR/emails.html
echo "[+] 证书透明度日志" curl -s "https://crt.sh/?q=%.$DOMAIN&output=json" | \ jq -r '.[].name_value' | sort -u > $OUTPUT_DIR/certs.txt
echo "[+] 存活主机检测" httpx -l $OUTPUT_DIR/subdomains_final.txt -o $OUTPUT_DIR/alive.txt
echo "[+] Web 技术栈" httpx -l $OUTPUT_DIR/alive.txt -tech-detect -o $OUTPUT_DIR/tech.txt
echo "[+] 端口扫描" nmap -sV -oA $OUTPUT_DIR/nmap $DOMAIN
echo "[*] OSINT 枚举完成!结果保存在 $OUTPUT_DIR"
|
最佳实践
1. 合法合规
2. 信息验证
3. 数据管理
- 妥善保存收集的信息
- 定期更新数据
- 及时删除过期信息
4. 工具选择
- 根据目标选择合适工具
- 组合使用多种工具
- 关注工具更新情况
防御建议
减少信息暴露
域名配置
- 使用隐私保护服务
- 定期审查 DNS 记录
- 监控证书透明度日志
代码安全
- 检查代码中的敏感信息
- 使用 pre-commit hooks
- 定期扫描仓库
人员管理
- 制定社交媒体使用规范
- 加强安全意识培训
- 定期检查信息泄露
监控机制
- 设置 Google Alerts
- 使用泄漏监控服务
- 定期进行自我 OSINT