OSINT工具
yc Lv1

OSINT 工具集

OSINT (Open Source Intelligence,开源情报) 工具用于从公开渠道收集和分析信息。本文整理了常用的 OSINT 工具和资源。

综合性 OSINT 框架

1. SpiderFoot

自动化 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

# Web 界面访问
# 浏览器打开 http://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
subfinder -d example.com -o subs.txt

# Amass
amass enum -passive -d example.com

# Assetfinder
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"

# API 使用
curl "https://api.shodan.io/shodan/host/search?query=apache&key=YOUR_API_KEY"

Censys

互联网资产搜索引擎。

1
2
3
4
5
6
# Python SDK
pip install censys
censys search "services.tls.certificate.parsed.names: example.com"

# API 使用
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
# API 使用
curl "https://api.zoomeye.org/host/search?query=nginx"

# Python SDK
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 运行
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
# API 查询
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'
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
# API 使用
curl "https://www.virustotal.com/vtapi/v2/ip-address/report?apikey=YOUR_API_KEY&ip=8.8.8.8"

# Python SDK
pip install virustotal-python

AlienVault OTX

开放威胁交换平台。

1
2
3
4
5
# API 使用
curl "https://otx.alienvault.com/api/v1/indicators/IPv4/8.8.8.8"

# Python SDK
pip install OTXv2

人员信息工具

SpiderFoot Hunch

人员和企业信息收集工具。

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
# API 使用
curl -X POST "https://api.pipl.com/v5/search/" \
-H "Authorization: bearer YOUR_API_KEY" \
-d '{"email": "example@gmail.com"}'

图像情报工具

TinEye

反向图像搜索。

Google 图片搜索

Yandex 图片

元数据分析

ExifTool

读取和写入文件元数据。

1
2
3
4
5
6
7
8
9
10
11
12
# 安装
# Arch: sudo pacman -S perl-image-exiftool
# Ubuntu: sudo apt install libimage-exiftool-perl

# 查看元数据
exiftool image.jpg

# 批量处理
exiftool -r /path/to/images/

# 输出 JSON
exiftool -json image.jpg

Metadatatools

在线元数据查看器。

工作流整合

自动化 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
# osint_enum.sh - 自动化 OSINT 收集

DOMAIN="example.com"
OUTPUT_DIR="osint_results_${DOMAIN}"
mkdir -p $OUTPUT_DIR

echo "[*] OSINT 枚举开始: $DOMAIN"

# 1. 子域名发现
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

# 2. DNS 枚举
echo "[+] DNS 枚举"
dig $DOMAIN ANY > $OUTPUT_DIR/dns_any.txt
whois $DOMAIN > $OUTPUT_DIR/whois.txt

# 3. 邮箱收集
echo "[+] 邮箱收集"
theHarvester.py -d $DOMAIN -b google -l 500 -f $OUTPUT_DIR/emails.html

# 4. 证书透明度
echo "[+] 证书透明度日志"
curl -s "https://crt.sh/?q=%.$DOMAIN&output=json" | \
jq -r '.[].name_value' | sort -u > $OUTPUT_DIR/certs.txt

# 5. 存活主机检测
echo "[+] 存活主机检测"
httpx -l $OUTPUT_DIR/subdomains_final.txt -o $OUTPUT_DIR/alive.txt

# 6. Web 技术栈识别
echo "[+] Web 技术栈"
httpx -l $OUTPUT_DIR/alive.txt -tech-detect -o $OUTPUT_DIR/tech.txt

# 7. 端口扫描
echo "[+] 端口扫描"
nmap -sV -oA $OUTPUT_DIR/nmap $DOMAIN

echo "[*] OSINT 枚举完成!结果保存在 $OUTPUT_DIR"

最佳实践

1. 合法合规

  • 遵守当地法律法规
  • 仅用于授权测试
  • 不侵犯个人隐私

2. 信息验证

  • 交叉验证多个来源
  • 确认信息的时效性
  • 记录数据来源

3. 数据管理

  • 妥善保存收集的信息
  • 定期更新数据
  • 及时删除过期信息

4. 工具选择

  • 根据目标选择合适工具
  • 组合使用多种工具
  • 关注工具更新情况

防御建议

减少信息暴露

  1. 域名配置

    • 使用隐私保护服务
    • 定期审查 DNS 记录
    • 监控证书透明度日志
  2. 代码安全

    • 检查代码中的敏感信息
    • 使用 pre-commit hooks
    • 定期扫描仓库
  3. 人员管理

    • 制定社交媒体使用规范
    • 加强安全意识培训
    • 定期检查信息泄露
  4. 监控机制

    • 设置 Google Alerts
    • 使用泄漏监控服务
    • 定期进行自我 OSINT
由 Hexo 驱动 & 主题 Keep