aur3lius-marcu5/Thoth

GitHub: aur3lius-marcu5/Thoth

Thoth 是一款被动 OSINT 域名侦察工具,整合多公共数据源实现子域名枚举、证书监控、网络归属分析及自动化变更检测。

Stars: 0 | Forks: 0

# Thoth

Python 3.8+ License Status

被动侦察与监控工具
用于域名情报收集、证书透明度监控和变更检测的自动化 OSINT 工具。

## 概述 Thoth 是一款专为安全研究人员和渗透测试人员设计的被动 OSINT 工具。它可以在不进行主动扫描或身份验证尝试的情况下,自动收集域名情报。 **核心功能:** - 通过 DNS 暴力破解和证书透明度日志进行子域名枚举 - 用于 IP 归属和地理位置查询的 WHOIS/ASN 查找 - 用于网络前缀识别的 BGP 路由分析 - 集成 Shodan 进行开放端口和服务发现 - 自动检测运行间的变更 ## 功能 | 模块 | 来源 | 收集的数据 | |--------|--------|----------------| | 子域名解析 | DNS + crt.sh | 子域名、IP 地址 | | 证书透明度 | crt.sh | 证书 ID、签发日期、通用名称 | | WHOIS/ASN | ipinfo.io | ASN、所有者、网络块范围、位置 | | BGP 分析 | bgp.he.net | 宣告的前缀、路由状态 | | 端口扫描 | Shodan | 开放端口、服务 banner、vhosts | ## 安装说明 ### 前置条件 - Python 3.8 或更高版本 - API 密钥(提供免费额度): - [ipinfo.io](https://ipinfo.io/signup) - 每月 50,000 次请求 - [Shodan](https://account.shodan.io/) - 有限的免费查询 ### 快速设置 (Linux/Kali) ``` # Clone 仓库 git clone https://github.com/aur3lius-marcu5/thoth.git cd thoth # 运行自动化 setup(创建 venv、安装 deps、配置 .env) chmod +x setup.sh ./setup.sh ``` 设置脚本将会: 1. 验证是否已安装 Python 3 2. 在 `./venv` 中创建虚拟环境 3. 从 `requirements.txt` 安装所有依赖项 4. 将 `.env.example` 复制为 `.env`(如已存在则会提示) ### 手动设置 ``` # Clone 仓库 git clone https://github.com/aur3lius-marcu5/thoth.git cd thoth # 创建 virtual environment python3 -m venv venv source venv/bin/activate # 安装 dependencies pip install -r requirements.txt # 配置 API keys cp .env.example .env # 使用您的 API keys 编辑 .env ``` ## 使用说明 ### 交互模式 不带参数运行以显示引导菜单: ``` python thoth.py ``` ``` ______ __ /\__ _\ __ __ __ /\ \__ __ \/\ \/\ \/\ \/\ \ /\ \ _\/\ \ \ \ \ \ \ \_\ \\ \ \/\ \ \ \ \ \_\ \_\ \____/ \ \_\ \ \_\ \ \/_/\/_/\/___/ \/_/ \/_/ v1.0 Passive Reconnaissance & Monitoring API Key Status: ipinfo.io : configured Shodan : NOT SET ======================================== Enter target domain: example.com Select scan type: ---------------------------------------- [1] Full scan (all modules) [2] Quick scan (DNS + certs only) [3] Custom scan (choose modules) ---------------------------------------- Select option: 1 Output directory [./runs]: Enable verbose output? [y/N]: y ``` ### CLI 模式 ``` # 使用 defaults 进行快速扫描 python thoth.py example.com # 进行完整扫描并输出 verbose python thoth.py example.com -v # 跳过特定 modules python thoth.py example.com --skip-bgp --skip-shodan # 自定义输出目录 python thoth.py example.com --output-dir ./results # 使用自定义 wordlist 进行 subdomain brute-force python thoth.py example.com --wordlist wordlists/common.txt ``` ### 所有选项 | 标志 | 描述 | |------|-------------| | `domain` | 目标域名(位置参数) | | `--output-dir DIR` | 输出目录(默认:`./runs`) | | `--skip-bgp` | 跳过 BGP 路由查找 | | `--skip-shodan` | 跳过 Shodan 端口扫描 | | `--skip-whois` | 跳过 WHOIS/ASN 查找 | | `--wordlist FILE` | 自定义子域名字典(每行一个) | | `-v, --verbose` | 启用详细/调试日志 | ## 输出 ### 目录结构 ``` runs/ example.com_2024-01-15T10-30-00.json # Full structured data example.com_2024-01-15T10-30-00.md # Human-readable report example.com_2024-01-16T14-22-00.json # Second run (for diffing) example.com_2024-01-16T14-22-00.md ``` ### JSON 报告 ``` { "domain": "example.com", "timestamp": "2024-01-15T10-30-00", "subdomains": [ {"subdomain": "www.example.com", "ips": ["93.184.216.34"]}, {"subdomain": "mail.example.com", "ips": ["93.184.216.35"]} ], "certificates": [ {"id": 1234567890, "logged_at": "2024-01-10", "common_name": "*.example.com"} ], "hosts": { "93.184.216.34": { "whois": {"asn": "AS15133", "owner": "Edgecast Inc.", "range": "93.184.216.0/24", "location": "US"}, "bgp": {"prefix": "93.184.216.0/24", "announced": true}, "shodan": {"ports": [80, 443], "banners": ["80/tcp nginx"], "vhosts": []} } }, "diff": { "is_first_run": false, "new_subdomains": ["api.example.com"], "new_certificates": [9876543210], "new_hosts": ["93.184.216.36"] } } ``` ### Markdown 报告 ``` # Thoth Reconnaissance Report **Domain:** example.com **Date:** 2024-01-15T10-30-00 ## 发现的 Subdomains | Subdomain | IPs | |-----------|-----| | www.example.com | 93.184.216.34 | | mail.example.com | 93.184.216.35 | ## Host 详情 ### 93.184.216.34 - **ASN:** AS15133 (Edgecast Inc.) - **BGP Prefix:** 93.184.216.0/24 - **Open Ports:** 80, 443 ## 自上次运行以来的更改 - **New subdomains:** api.example.com - **New hosts:** 93.184.216.36 ``` ## 变更检测 Thoth 会自动将每次运行与上一次扫描进行对比,并标记以下内容: - 自上次运行以来发现的**新子域名** - 记录在 CT(证书透明度)日志中的**新证书** - 基础设施中出现的新主机 (IP) 这使得无需手动对比即可实现持续监控。 ## 项目结构 ``` thoth/ thoth.py # Main entry point with interactive menu setup.sh # Automated setup script (Linux) modules/ resolve.py # DNS subdomain resolution crtsh.py # Certificate Transparency lookup whois_lookup.py # WHOIS/ASN via ipinfo.io bgp.py # BGP route analysis shodan_lookup.py # Shodan API integration utils/ rate_limiter.py # Per-service rate limiting error_handler.py # Retry logic with exponential backoff output.py # JSON + Markdown report generation .env.example # API key template requirements.txt # Python dependencies ``` ## 安全与道德 Thoth 专为**被动侦察**设计: - 不进行身份验证尝试或登录绕过 - 不进行主动端口扫描(仅使用 Shodan 的被动数据) - 不进行 payload 注入或漏洞利用 - 对公共 API 的请求进行速率限制 - 所有数据均来自公共来源(crt.sh、ipinfo.io、bgp.he.net、Shodan) **请负责任地使用。** 仅扫描您拥有或获得明确授权进行测试的域名。 ## Kali Linux Thoth 针对 Kali Linux 进行了优化。快速启动: ``` cd thoth chmod +x setup.sh ./setup.sh source venv/bin/activate python thoth.py ``` 所有依赖项均可在 Kali 上原生运行。无需额外的系统软件包。 ## 许可证 MIT 许可证 - 详见 [许可证](LICENSE)。 ## 致谢 - [crt.sh](https://crt.sh/) - 证书透明度日志 - [ipinfo.io](https://ipinfo.io/) - IP 地理位置和 ASN 数据 - [bgp.he.net](https://bgp.he.net/) - BGP 路由信息 - [Shodan](https://www.shodan.io/) - IoT 和基础设施搜索引擎

为重视被动情报收集的安全研究人员而打造。

标签:GitHub, Python, 子域名枚举, 实时处理, 无后门, 系统安全, 进程管理, 逆向工具