Kodjocares/OSINT

GitHub: Kodjocares/OSINT

一个包含35个模块的Python OSINT框架,支持用户名枚举、泄露检测、威胁情报、云资产发现等功能,可生成HTML报告和实体关系图。

Stars: 0 | Forks: 0

``` ██████╗ ███████╗██╗███╗ ██╗████████╗ ██╔═══██╗██╔════╝██║████╗ ██║╚══██╔══╝ ██║ ██║███████╗██║██╔██╗ ██║ ██║ ██║ ██║╚════██║██║██║╚██╗██║ ██║ ╚██████╔╝███████║██║██║ ╚████║ ██║ ╚═════╝ ╚══════╝╚═╝╚═╝ ╚═══╝ ╚═╝ v3.0 — 35 Modules ``` **开源情报框架 · Python 3.9+** [![Python](https://img.shields.io/badge/Python-3.9%2B-3776AB?style=flat-square&logo=python&logoColor=white)](https://python.org) [![License: MIT](https://img.shields.io/badge/License-MIT-22863a?style=flat-square)](LICENSE) [![Modules](https://img.shields.io/badge/Modules-35-00d4ff?style=flat-square)](#modules) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-ff6b35?style=flat-square)](CONTRIBUTING.md) [![Maintenance](https://img.shields.io/badge/Maintained-yes-3fb950?style=flat-square)]() [![GitHub Stars](https://img.shields.io/github/stars/YOUR_USERNAME/osint-tool?style=flat-square&color=f0b429)](https://github.com/YOUR_USERNAME/osint-tool/stargazers) **一个模块化、可扩展的 OSINT 框架,包含 27 个情报模块 —— 用户名枚举、泄露检测、威胁情报、区块链追踪、云资产发现、实体关系图可视化等功能。** [安装](#installation) · [使用说明](#usage) · [模块](#modules) · [API 密钥](#api-keys) · [贡献指南](#contributing)
## 什么是 OSINT Tool? OSINT Tool 是一个全面的模块化 Python 框架,用于开源情报收集。它将 27 个专业模块整合在一个交互式 CLI 下,并生成专业的 HTML 报告、JSON 导出和交互式实体关系图。 无论您是独立安全研究人员、渗透测试人员、数字取证分析师,还是调查公共记录的记者 —— OSINT Tool 都能通过单个终端命令提供结构化、可重复的工作流程。 **核心设计原则:** - 每个模块可独立使用,也可作为完整调查的一部分 - 优雅降级 —— 所有 API 密钥都是可选的;免费来源无需注册即可使用 - 尊重隐私 —— 密码通过 k-anonymity 验证,绝不传输 - Tor 兼容 —— 只需一行配置即可通过 Tor 路由所有流量 - 报告优先 —— 每次运行都会生成结构化 JSON + 样式化 HTML 输出 ## 模块 ### 原始模块 | # | 模块 | 文件 | 功能 | |---|--------|------|-------------| | 1 | **用户名 / 邮箱** | `username_lookup.py` | 并行枚举 30+ 平台;邮箱 MX、Gravatar、Hunter.io | | 2 | **域名与 IP 情报** | `domain_intel.py` | WHOIS、完整 DNS、子域名枚举(crt.sh + 暴力破解)、SSL 证书、Shodan、VirusTotal、技术指纹识别 | | 3 | **电话追踪** | `phone_lookup.py` | E.164 解析、运营商、线路类型、地区;AbstractAPI + NumVerify | | 4 | **泄露检查** | `breach_check.py` | HaveIBeenPwned 邮箱泄露查询、粘贴泄露 | | 5 | **密码泄露** | `breach_check.py` | k-anonymity SHA-1 检查 —— 密码绝不传输 | | 6 | **社交媒体** | `social_media.py` | GitHub 完整 API(仓库/组织/事件)、Reddit API、通用爬虫 | | 7 | **元数据提取** | `metadata_extractor.py` | 图片 EXIF/GPS、PDF 作者信息、DOCX 用户元数据 | | 8 | **Google Dorking** | `google_dorking.py` | 15+ 个 dork 类别、自定义操作符构建器、DDG 执行 | | 9 | **地理定位** | `geolocation.py` | IP/域名/GPS 地理定位、反向地理编码、Folium HTML 地图 | | 10 | **监控与告警** | `monitoring.py` | SHA-256 变更检测、邮件告警、后台调度器 | ### 新模块(v2.0) | # | 模块 | 文件 | 功能 | |---|--------|------|-------------| | 11 | **网页归档** | `web_archive.py` | Wayback Machine 快照、域名时间线、已删除内容提取、快照对比 | | 12 | **GitHub 侦察** | `github_recon.py` | 秘密模式扫描(30+ 正则)、提交邮箱收集、域名/组织代码泄露 | | 13 | **粘贴监控** | `paste_monitor.py` | 搜索 Pastebin/Ghostbin/Gist/Rentry;自动分类为凭证转储、哈希转储或财务数据 | | 14 | **公司情报** | `company_intel.py` | OpenCorporates 注册信息 + 官员、SEC EDGAR 文件、LinkedIn 职位发布抓取 | | 15 | **威胁情报** | `threat_intel.py` | AlienVault OTX、VirusTotal、AbuseIPDB、MalwareBazaar、URLhaus —— IP/域名/哈希/URL | | 16 | **邮件头分析** | `email_header.py` | 跳数链重建、欺骗检测、SPF/DKIM/DMARC、发送者 IP 地理定位 | | 17 | **反向图片搜索** | `reverse_image.py` | 搜索 URL 生成(Google/Yandex/TinEye/Bing)、OCR 文本提取、图片哈希 | | 18 | **加密货币追踪** | `crypto_tracer.py` | 比特币和以太坊余额/交易、Blockchair 多链、钱包风险分类 | | 19 | **DNS 历史** | `dns_history.py` | HackerTarget 被动 DNS(免费)、SecurityTrails 历史、ViewDNS IP 历史、反向 IP | | 20 | **ASN / 网络情报** | `network_intel.py` | BGPView ASN 详情、IP→ASN、组织 IP 范围、RDAP 注册、快速端口检查 | | 21 | **云资产发现** | `cloud_discovery.py` | S3/Azure Blob/GCS 存储桶枚举(30+ 排列)、Firebase 泄露检查 | | 22 | **网页爬虫** | `web_crawler.py` | 全站爬取、表单提取、登录/管理页面检测、批量邮箱/电话收集 | | 23 | **IP 分类器** | `ip_classifier.py` | Tor 出口节点列表、VPN/代理/数据中心/住宅检测(IPQualityScore + AbuseIPDB) | | 24 | **图可视化** | `graph_viz.py` | 交互式 D3.js 实体关系图、从任何 OSINT 结果自动构建、pyvis/NetworkX 导出 | ### 新类别(v3.0) | # | 模块 | 文件 | 功能 | |---|--------|------|-------------| | 27 | **恶意软件分析** | `malware_analysis.py` | PE 头、字符串提取、YARA 签名、VirusTotal 沙箱、Hybrid Analysis | | 28 | **暗网情报** | `darkweb_intel.py` | Ahmia 搜索、勒索软件泄露追踪(RansomWatch + ransomware.live)、暗网粘贴 | | 29 | **证书透明度** | `cert_transparency.py` | crt.sh 子域名历史、组织搜索、域名仿冒检测、证书时间线 | | 30 | **WiFi / 蓝牙** | `wireless_intel.py` | WiGLE SSID/BSSID 地理定位、MAC 厂商查询、蓝牙设备分类 | | 31 | **车辆与物理** | `physical_intel.py` | VIN 解码(NHTSA)、FAA 飞机查询、OpenSky 实时追踪、船舶搜索 | | 32 | **财务情报** | `financial_intel.py` | OFAC 制裁(OpenSanctions)、ICIJ 离岸泄露、SEC Form 4、受益所有权 | | 33 | **职业情报** | `career_intel.py` | 职位发布、H-1B 签证数据、USPTO 专利、历史招聘广告恢复 | | 34 | **剧本运行器** | `workflow.py` | 6 个内置剧本、批量 CSV 处理、Slack/Discord/Teams webhook 告警 | ### 支持模块 | 模块 | 文件 | 用途 | |--------|------|---------| | **匿名性** | `utils/anonymity.py` | 通过 stem 使用 Tor、代理轮换、DNS 泄露检查、身份验证 | | **HTTP 客户端** | `utils/helpers.py` | 速率限制、重试逻辑、User-Agent 轮换 | | **报告生成器** | `reporting/report_generator.py` | 深色主题 HTML 报告、JSON 导出、matplotlib 图表 | ## 项目结构 ``` osint-tool/ ├── main.py # CLI entry point & interactive menu (27 options) ├── config.py # All API keys, settings, platform lists ├── .env.example # Environment variables template ├── requirements.txt # Runtime dependencies ├── requirements-dev.txt # Dev/test dependencies ├── pyproject.toml # Package metadata & build config │ ├── modules/ # Intelligence modules │ ├── username_lookup.py │ ├── domain_intel.py │ ├── phone_lookup.py │ ├── breach_check.py │ ├── social_media.py │ ├── metadata_extractor.py │ ├── google_dorking.py │ ├── geolocation.py │ ├── monitoring.py │ ├── web_archive.py # NEW │ ├── github_recon.py # NEW │ ├── paste_monitor.py # NEW │ ├── company_intel.py # NEW │ ├── threat_intel.py # NEW │ ├── email_header.py # NEW │ ├── reverse_image.py # NEW │ ├── crypto_tracer.py # NEW │ ├── dns_history.py # NEW │ ├── network_intel.py # NEW │ ├── cloud_discovery.py # NEW │ ├── web_crawler.py # NEW │ ├── ip_classifier.py # NEW │ └── graph_viz.py # NEW │ ├── reporting/ │ └── report_generator.py # HTML/JSON reports + charts │ ├── utils/ │ ├── helpers.py # HTTP client, rate limiting │ └── anonymity.py # Tor & proxy management │ ├── tests/ │ └── test_modules.py # pytest test suite │ ├── output/ # Generated reports (git-ignored) ├── wordlists/ # Custom wordlists (git-ignored) │ └── .github/ ├── workflows/ │ ├── ci.yml # Lint, test, security scan │ └── release.yml # Auto-release on tag push ├── ISSUE_TEMPLATE/ │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ``` ## 安装 ### 要求 - Python **3.9** 或更高版本 - `pip` + `venv` - Tor*(可选 —— 用于匿名路由* - Tesseract OCR*(可选 —— 用于图片文本提取)* ### 步骤 1 — 克隆 ``` git clone https://github.com/Kodjocares/osint.git cd osint ``` ### 步骤 2 — 虚拟环境 ``` # Linux / macOS python3 -m venv venv source venv/bin/activate # Windows (PowerShell) python -m venv venv venv\Scripts\Activate.ps1 ``` ### 步骤 3 — 安装依赖 ``` pip install -r requirements.txt ``` ### 步骤 4 — 配置 API 密钥 ``` cp .env.example .env # 打开 .env 并添加您的 API 密钥 — 全部可选 ``` ### 步骤 5 — 验证 ``` python main.py --anonymity ``` ## 使用方法 ### 交互式菜单 ``` python main.py ``` ``` ╔══════════════════════════════════════════════════════════╗ ║ OSINT INTELLIGENCE TOOL v2.0 ║ ╠══════════════════════════════════════════════════════════╣ ║ ORIGINAL MODULES ║ ║ [1] Username / Email Lookup [2] Domain & IP ║ ║ [3] Phone Tracking [4] Breach Check ║ ║ [5] Password Exposure [6] Social Media ║ ║ [7] Metadata Extraction [8] Google Dorks ║ ║ [9] Geolocation [10] Monitoring ║ ╠══════════════════════════════════════════════════════════╣ ║ NEW MODULES ║ ║ [11] Web Archive / Wayback [12] GitHub Recon ║ ║ [13] Paste Site Monitor [14] Company Intel ║ ║ [15] Threat Intelligence / IOC [16] Email Header ║ ║ [17] Reverse Image Search [18] Crypto Trace ║ ║ [19] DNS History [20] ASN / Network ║ ║ [21] Cloud Asset Discovery [22] Web Crawler ║ ║ [23] IP Classifier [24] Graph Viz ║ ╠══════════════════════════════════════════════════════════╣ ║ [25] Full Target Investigation [26] Anonymity ║ ╚══════════════════════════════════════════════════════════╝ ``` ## 命令行参考 ### 原始模块 ``` # 用户名 — 扫描 30+ 平台 python main.py --username johndoe # 邮箱 — MX 记录、Gravatar、Hunter.io python main.py --email target@example.com # 域名 — WHOIS + DNS + 子域名 + SSL + 技术栈 + 地理 python main.py --domain example.com # IP — 反向 DNS + Shodan + VirusTotal + 地理定位 python main.py --ip 8.8.8.8 # 电话 — 运营商、线路类型、地区 (E.164 格式) python main.py --phone "+14155552671" # 邮箱泄露检查 (HaveIBeenPwned) python main.py --breach user@example.com # 密码泄露 — k-匿名性,密码永不传输 python main.py --password-check # 社交媒体抓取 (GitHub + Reddit 公开数据) python main.py --social johndoe # 元数据提取 — 图片、PDF、DOCX;本地或 URL python main.py --metadata /path/to/photo.jpg python main.py --metadata https://example.com/doc.pdf # Google dork 生成 python main.py --dork example.com python main.py --dork example.com --dork-execute # 地理定位 — IP、域名或 GPS 坐标 python main.py --geo 8.8.8.8 python main.py --geo "37.7749,-122.4194" ``` ### 新模块(v2.0) ``` # 网页档案 — Wayback Machine 时间线 python main.py --archive example.com python main.py --archive https://example.com/page --archive-snapshot python main.py --archive https://example.com --archive-ts 20200101120000 # GitHub 侦察 — 个人资料、仓库、提交邮箱 python main.py --github johndoe python main.py --github johndoe --scan-secrets python main.py --github org/repository --scan-secrets # deep secret scan # 粘贴网站监控 — 搜索 Pastebin、Gist、Ghostbin 等 python main.py --paste "user@example.com" python main.py --paste "example.com" python main.py --paste-url https://pastebin.com/AbCdEfGh # 公司情报 — 注册信息、SEC 文件、职位发布 python main.py --company "Acme Corporation" python main.py --company "Tesla Inc" # 威胁情报 — IP、域名、文件哈希、URL python main.py --threat 8.8.8.8 python main.py --threat example.com python main.py --threat d41d8cd98f00b204e9800998ecf8427e # MD5 hash python main.py --threat https://malicious-site.example.com --ioc-type url # 邮箱头分析 — 检测欺骗、追踪来源 python main.py --email-header /path/to/raw_headers.txt # 反向图片搜索 — 生成搜索 URL + OCR python main.py --image https://example.com/photo.jpg python main.py --image /path/to/local/image.jpg # 加密货币追踪 — Bitcoin 和 Ethereum python main.py --crypto 1A1zP1eP5QGefi2DMPTfTL5SLmv7Divf python main.py --crypto 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 # DNS 历史 — 被动 DNS、IP 历史、反向 IP python main.py --dns-history example.com # ASN / 网络情报 python main.py --asn AS15169 # Google's ASN python main.py --asn 8.8.8.8 # Auto-resolve IP to ASN python main.py --asn "Cloudflare Inc" # Org name search # 云资产发现 — S3、Azure、GCS、Firebase python main.py --cloud example.com # 网页爬虫 — 爬取整个网站 python main.py --crawl https://example.com python main.py --crawl https://example.com --max-pages 100 python main.py --crawl https://example.com/page --quick-scrape # IP 分类器 — VPN、Tor、代理、数据中心、住宅 python main.py --classify-ip 8.8.8.8 python main.py --classify-ip 185.220.101.1 # 实体关系图 python main.py --graph target@example.com python main.py --graph target@example.com --graph-data output/results.json # 完全自动化调查(所有相关模块 + 图) python main.py --full target@example.com python main.py --full example.com --output html,json python main.py --full 1.2.3.4 python main.py --full johndoe # 匿名性 / Tor 状态 python main.py --anonymity ``` ### 输出文件 每次运行都会将结果保存到 `output/`: ``` output/ ├── example_com_20240315_143022.html # Styled HTML report ├── example_com_20240315_143022.json # Full JSON data export ├── graph_example_com_20240315.html # Interactive entity graph ├── breach_chart.png # Matplotlib breach chart ├── geo_map.html # Folium geolocation map ├── osint_tool.log # Execution log └── alerts/ # Monitoring change alerts ``` ## API 密钥参考 | 服务 | 模块 | 免费套餐 | 注册 | |---------|--------|-----------|---------| | [Shodan](https://shodan.io) | 域名与 IP | 是 —— 有限 | [account.shodan.io](https://account.shodan.io/register) | | [VirusTotal](https://virustotal.com) | 域名、IP、威胁情报 | 是 —— 4 次/分钟 | [virustotal.com](https://www.virustotal.com/gui/join-us) | | [Hunter.io](https://hunter.io) | 邮箱查询 | 是 —— 25 次/月 | [hunter.io](https://hunter.io/users/sign_up) | | [IPInfo](https://ipinfo.io) | 地理定位 | 是 —— 50k/月 | [ipinfo.io](https://ipinfo.io/signup) | | [HaveIBeenPwned](https://haveibeenpwned.com/API/Key) | 泄露检查 | 付费 —— $3.50/月 | [haveibeenpwned.com](https://haveibeenpwned.com/API/Key) | | [AbstractAPI](https://abstractapi.com) | 电话 | 是 | [app.abstractapi.com](https://app.abstractapi.com/users/signup) | | [NumVerify](https://numverify.com) | 电话 | 是 —— 250/月 | [numverify.com](https://numverify.com) | | [Google CSE](https://programmablesearchengine.google.com) | Dork 执行 | 是 —— 100/天 | [programmablesearchengine.google.com](https://programmablesearchengine.google.com) | | [GitHub](https://github.com/settings/tokens) | GitHub 侦察 | 是 —— 免费 | [github.com/settings/tokens](https://github.com/settings/tokens) | | [AlienVault OTX](https://otx.alienvault.com) | 威胁情报 | 是 —— 免费 | [otx.alienvault.com](https://otx.alienvault.com) | | [AbuseIPDB](https://www.abuseipdb.com/register) | 威胁情报、IP 分类器 | 是 —— 1k/天 | [abuseipdb.com](https://www.abuseipdb.com/register) | | [SecurityTrails](https://securitytrails.com) | DNS 历史 | 是 —— 50/月 | [securitytrails.com](https://securitytrails.com/corp/api) | | [Etherscan](https://etherscan.io/apis) | 加密货币追踪 | 是 —— 免费 | [etherscan.io/apis](https://etherscan.io/apis) | | [IPQualityScore](https://ipqualityscore.com) | IP 分类器 | 是 —— 200/天 | [ipqualityscore.com](https://www.ipqualityscore.com/create-account) | | [TinEye](https://tineye.com/api) | 反向图片 | 付费 | [tineye.com/api](https://services.tineye.com/TinEyeAPI) | **无需 API 密钥:** 密码检查(HIBP k-anonymity)、crt.sh 子域名枚举、ip-api.com 地理定位、DNS 查询、WHOIS、SSL 检查、GitHub/Reddit 公共 API、DuckDuckGo 搜索、Wayback Machine、OpenCorporates(基础)、HackerTarget 被动 DNS、BGPView ASN 查询、Tor 出口节点列表、Blockchain.info BTC 查询、AlienVault OTX(有限)、URLhaus、MalwareBazaar。 ## 使用 Tor 匿名化 ### 安装 Tor ``` # Ubuntu / Debian sudo apt update && sudo apt install tor sudo service tor start # macOS brew install tor brew services start tor # 验证 curl --socks5-hostname 127.0.0.1:9050 https://check.torproject.org/api/ip ``` ### 在 `.env` 中启用 ``` USE_TOR=true TOR_PROXY=socks5h://127.0.0.1:9050 TOR_CONTROL_PORT=9051 TOR_CONTROL_PASSWORD=your_control_password # optional ``` ### 验证匿名性 ``` python main.py --anonymity ``` ## 持续监控 注册目标以进行自动化变更检测: ``` from modules.monitoring import Monitor from modules.domain_intel import DomainIntel import threading monitor = Monitor() intel = DomainIntel() # 注册 monitor.register_target("corp-domain", "domain", "example.com", description="Watch for DNS/WHOIS changes") # 一次性检查 result = monitor.check_target("corp-domain", intel.whois_lookup, domain="example.com") print(f"Changed: {result['changed']}") # 后台调度器(每 24 小时) t = threading.Thread( target=monitor.start_scheduler, args=("corp-domain", intel.whois_lookup), kwargs={"domain": "example.com"}, daemon=True ) t.start() ``` 在 `.env` 中配置邮件告警: ``` ALERT_EMAIL=you@example.com SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your_gmail@gmail.com SMTP_PASS=your_app_password MONITOR_INTERVAL_HOURS=24 ``` ## 运行测试 ``` # 安装开发依赖 pip install -r requirements-dev.txt # 运行所有测试 pytest tests/ -v # 带覆盖率 pytest tests/ -v --cov=modules --cov=utils --cov=reporting --cov-report=term-missing # 单个测试类 pytest tests/test_modules.py::TestBreachCheck -v # 代码检查 flake8 . --max-line-length=100 black --check . # 安全扫描 bandit -r modules/ utils/ reporting/ main.py ``` ## 可选的系统依赖 ``` # Tesseract OCR(用于 reverse_image 模块的图片文字提取) # Ubuntu / Debian sudo apt install tesseract-ocr # macOS brew install tesseract # 然后安装 Python 绑定 pip install pytesseract ``` ## 发布到 GitHub ``` cd osint-tool git init git add . git commit -m "feat: initial release — OSINT Tool v2.0 (27 modules)" # 在 github.com 创建仓库 → 新建仓库 git remote add origin https://github.com/YOUR_USERNAME/osint-tool.git git branch -M main git push -u origin main # 标记第一个版本 git tag -a v2.0.0 -m "v2.0.0 — 27 modules" git push origin v2.0.0 ``` GitHub Actions 将在每次推送和 PR 时自动运行 lint + test。 ## 贡献指南 请在提交 PR 前阅读 [CONTRIBUTING.md](CONTRIBUTING.md)。 ``` # 创建功能分支 git checkout -b feat/my-new-module # 遵循 modules/ 中的模块模式 # 在 main.py 中添加 CLI 标志 # 更新本 README # 运行测试和代码检查 pytest tests/ -v flake8 . --max-line-length=100 # 使用 conventional commits 提交 git commit -m "feat(modules): add LinkedIn public profile scraper" git push origin feat/my-new-module ``` ## 安全 发现工具本身存在漏洞?请参阅 [SECURITY.md](SECURITY.md) —— 请私下披露,不要通过公开 issue。 ## 更新日志 完整版本历史请参阅 [CHANGELOG.md](CHANGELOG.md)。 ## 许可证 [MIT 许可证](LICENSE),并附加道德使用条款。 使用本工具即表示您同意仅对您已获得明确书面授权的目标进行调查,遵守所有适用法律,且不使用本工具对个人或组织造成伤害。
为安全研究社区构建 · 负责任地使用 · 如果有用请点星 ⭐
## 网页界面 在浏览器中运行完整的仪表板: ``` # 安装 GUI 依赖 pip install flask flask-cors # 启动 python app.py ``` 打开 **http://localhost:5000** —— 所有 27 个模块都可从仪表板访问。 **功能:** - 深色赛博朋克仪表板,带侧边栏导航 - 异步作业系统 —— 结果流式输入,不会阻塞 UI - JSON 结果查看器,带语法高亮 - 报告浏览器 —— 直接打开任何生成的 HTML 报告 - 匿名状态指示器(Tor 检查) - 键盘快捷键:`Ctrl+Enter` 运行任何模块 网页界面和 CLI 完全并行 —— 使用哪种方式取决于您的工作流程。
标签:Breach Detection, Dark Web, DAST, DNS通配符暴力破解, ESC4, GitHub, HTTP工具, OSINT, Pentest, Python框架, Threat Hunting, 云资产发现, 区块链追踪, 威胁情报, 实时处理, 密码管理, 开发者工具, 恶意软件分析, 情报收集, 数字取证, 数据外泄检测, 无线安全, 枚举工具, 模块化工具, 漏洞研究, 特权检测, 用户名枚举, 社交媒体情报, 网络安全, 网络安全审计, 自动化脚本, 隐私保护