ZetaOrioniss/oathtool

GitHub: ZetaOrioniss/oathtool

一款通过 OathNet v2 API 查询泄露记录、Stealer Logs 和受害者设备信息的命令行威胁情报 OSINT 扫描工具。

Stars: 2 | Forks: 0

``` ▄██████▄ ▄████████ ███ ▄█ █▄ ███ ▄██████▄ ▄██████▄ ▄█ ███ ███ ███ ███ ▀█████████▄ ███ ███ ▀█████████▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▀███▀▀██ ███ ███ ▀███▀▀██ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▀ ▄███▄▄▄▄███▄▄ ███ ▀ ███ ███ ███ ███ ███ ███ ███ ▀███████████ ███ ▀▀███▀▀▀▀███▀ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ▄ ▀██████▀ ███ █▀ ▄████▀ ███ █▀ ▄████▀ ▀██████▀ ▀██████▀ █████▄▄██ ```
一款命令行 OSINT 工具,用于通过单条命令查询 [OathNet](https://oathnet.org) v2 API 的所有三种数据源 —— 泄露记录、Stealer Logs 和受害者设备配置文件。 ## 功能 - **自动检测**查询类型 —— 只需传递值,oathtool 会自动处理其余操作 - **支持 10 种查询类型**:email、domain、IP、username、phone、Discord ID、Steam ID、HWID、IBAN、SSN - **一次会话查询三种数据源**:泄露记录、Stealer Logs、受害者清单 - **完整字段提取** —— 每条泄露记录包含 30 多个字段,包括地址、DOB、IBAN、SSN、社交账号 - **基于游标的分页**,可选全量获取 (`--all-pages`) - **结构化过滤器**,通过 OathNet 过滤器语法实现(JSON,内联传递) - **安全的 API key 存储** —— OS keyring(首选)或 chmod-600 配置文件 - **JSON 输出**和文件导出,便于集成到 pipeline - **退出代码**适用于 shell 脚本 (0 = 未找到结果,1 = 找到结果) ## 环境要求 - Python 3.10+ - 一个 [OathNet API key](https://oathnet.org/dashboard?tab=account) ## 安装 ``` git clone https://github.com/yourname/oathtool.git cd oathtool pip install -r requirements.txt ``` 或者直接将 `oathtool.py` 放在任意位置并直接运行。 ## 快速开始 ``` # 保存您的 API key(只需一次) python oathtool.py key --save YOUR_API_KEY # 搜索 — 自动检测类型 python oathtool.py search user@example.com python oathtool.py search 192.168.1.1 python oathtool.py search example.com python oathtool.py search johndoe python oathtool.py search +33612345678 python oathtool.py search 123456789012345678 ``` ## 命令 ### `key` — 管理你的 API key ``` python oathtool.py key --save Save the key locally python oathtool.py key --show Display the saved key (masked) python oathtool.py key --delete Remove the saved key ``` 当安装了 `keyring` 时,key 会存储在 OS keyring 中,或者作为备选方案存储在 `~/.config/oathnet/key` (chmod 600) 中。它绝不会以明文形式存储在可访问的位置。 你随时可以使用 `-k` 为单次运行覆盖已保存的 key: ``` python oathtool.py search user@example.com -k OTHER_KEY ``` ### `search` — 查询 OathNet ``` python oathtool.py search [OPTIONS] ``` #### 自动检测的查询类型 oathtool 会检查查询值,并自动选择正确的查询类型以及要请求的相关数据源。 | 输入示例 | 检测到的类型 | 查询的数据源 | | ------------------------------- | ------------- | --------------------------- | | `user@example.com` | Email | Breach, Stealer, Victims | | `example.com` | Domain | Stealer, Victims | | `192.168.1.1` | IP | Breach, Stealer, Victims | | `johndoe` | Username | Breach, Stealer, Victims | | `+33612345678` / `0612345678` | Phone | Breach | | `123456789012345678` | Discord ID | Breach, Stealer, Victims | | `76561198012345678` | Steam ID | Breach, Stealer | | `ABCD-1234-EFGH-5678` | HWID | Stealer, Victims | | `FR7612345678901234567890189` | IBAN | Breach | | `123-45-6789` | SSN | Breach | #### 选项 | 标志 | 描述 | |------|-------------| | `-k, --key CLE_API` | 为此次运行覆盖已保存的 API key | | `--sources breach stealer victims` | 强制指定特定数据源,而不是自动选择 | | `--all-pages` | 获取所有页面的结果(基于游标)。请谨慎使用 —— 会消耗你的配额 | | `--max-results N` | 每个数据源获取 N 个结果后停止 | | `--page-size N` | 每页的结果数(默认:100,最大:1000) | | `--no-session` | 禁用 OathNet 搜索会话(每个请求单独消耗一次查询) | | `--filter JSON` | 应用结构化的 OathNet 过滤器(见下文) | | `--json` | 输出原始 JSON 而不是格式化视图 | | `--output FILE` | 将结果保存到 JSON 文件 | | `--timeout SEC` | 网络超时时间(秒)(默认:15) | | `-v, --verbose` | 启用 debug 日志 | ## 数据源 ### 💾 Breach 来自受损数据库的凭证和个人数据。 返回的字段包括:`email`、`username`、`password`、`password_hash`、`salt`、`full_name`、`first_name`、`last_name`、`phone_number`、`address_street`、`city`、`state`、`postal_code`、`country`、`date_birth`、`age`、`gender`、`ip`、`discord_id`、`instagram`、`linkedin`、`iban`、`ssn`、`created_at`、`last_login`、`indexed_at`、`dbname` 等。 ### 🦠 Stealer Logs 由 infostealer 恶意软件捕获的凭证,按 URL/domain 索引。 返回的字段包括:`url_str`、`domain`、`subdomain`、`path`、`email`、`username`、`password`、`log_id`、`pwned_at`、`indexed_at`。 ### 💻 Victims 由 Stealer Logs 元数据汇总而成的设备配置文件。 返回的字段包括:`log_id`、`device_user_str`、`hwids_str`、`device_ips`、`device_emails_str`、`discord_ids`、`total_docs`、`pwned_at`、`indexed_at`。 ## 结构化过滤器 对于超出精确匹配的高级过滤,可以通过 `--filter` 传递 JSON 过滤器。过滤器遵循 [OathNet 结构化过滤器语法](https://docs.oathnet.org/guides/structured-filters)。 **简单过滤器:** ``` python oathtool.py search user@example.com \ --filter '{"field":"country","operator":"eq","value":"US"}' ``` **AND 过滤器:** ``` python oathtool.py search user@example.com --filter '{ "and": [ {"field": "country", "operator": "eq", "value": "US"}, {"field": "age", "operator": "gte", "value": "18"} ] }' ``` **OR 过滤器:** ``` python oathtool.py search user@example.com --filter '{ "or": [ {"field": "email", "operator": "ends_with", "value": "@gmail.com"}, {"field": "email", "operator": "ends_with", "value": "@outlook.com"} ] }' ``` **检查字段是否存在:** ``` python oathtool.py search user@example.com \ --filter '{"field":"instagram","operator":"exists","value":true}' ``` **支持的运算符:** `eq`、`neq`、`in`、`not_in`、`contains`、`starts_with`、`ends_with`、`wildcard`、`gt`、`gte`、`lt`、`lte`、`exists` ## 输出格式 ### 默认 —— 格式化的终端输出 ``` 🔍 Email : user@example.com ══════════════════════════════════════════════════════════════ 💾 BREACH — 3 result(s) (3 fetched) ══════════════════════════════════════════════════════════════ #1 ─────────────────────────────────────────────────────── Email : user@example.com Username : johndoe Password : hunter2 Full name : John Doe City : New York Country : US Indexed on : 2024-03-15T00:00:00Z Database : example_breach_2023 ``` ### JSON (`--json`) ``` python oathtool.py search user@example.com --json ``` ``` { "query": "user@example.com", "query_type": "email", "sources": { "breach": { "total": 3, "items": [ ... ] }, "stealer": { "total": 1, "items": [ ... ] }, "victims": { "total": 0, "items": [] } } } ``` ### 文件导出 (`--output`) ``` python oathtool.py search user@example.com --all-pages --output results.json ``` ## 会话管理 默认情况下,oathtool 会在查询之前打开一个 OathNet 搜索会话。这会将所有三个数据源的请求(breach + stealer + victims)归组到同一个 `search_id` 下,因此它们会算作对你的配额的**一次查询**,而不是三次。 传递 `--no-session` 可禁用此行为(例如,如果 session endpoint 不可用)。 ## 退出代码 | 代码 | 含义 | |------|---------| | `0` | 未找到结果 | | `1` | 找到结果(或发生错误) | 这使得 oathtool 易于在 shell 脚本中使用: ``` if python oathtool.py search user@example.com --json --output out.json; then echo "Clean — no hits." else echo "Exposure found, check out.json" fi ``` ## 示例 ``` # 对 email 进行全量搜索,涵盖所有页面,保存至文件 python oathtool.py search user@example.com --all-pages --output dump.json # 仅搜索 breach 源,筛选 US 记录,JSON 输出 python oathtool.py search user@example.com \ --sources breach \ --filter '{"field":"country","operator":"eq","value":"US"}' \ --json # 跨所有源通过 IP 搜索 python oathtool.py search 203.0.113.42 # 通过 Discord ID 搜索 python oathtool.py search 123456789012345678 # 通过 HWID 搜索(仅限 stealer + victims) python oathtool.py search ABCD-1234-EFGH-5678 # 通过电话号码搜索 python oathtool.py search +33612345678 # 详细的 debug 输出 python oathtool.py search user@example.com -v ``` ## 免责声明 本工具仅供教育目的、安全研究以及授权的 OSINT/Threat Intelligence 评估使用。作者不对使用本软件进行的任何滥用、未经授权的分析或恶意行为负责。在查询数据之前,请务必确保你拥有明确的许可或合法的法律依据。 ## License MIT
标签:GitHub, OSINT工具, 威胁情报, 实时处理, 开发者工具, 数据泄露查询, 逆向工具