aivxx02/ip-investigator
GitHub: aivxx02/ip-investigator
一个用Go编写的命令行工具,可并发查询9大威胁情报源并利用AI生成总结报告,帮助安全人员快速完成IP威胁背景调查。
Stars: 0 | Forks: 0
# ip-investigator
一个 CLI 工具,可同时查询 9 个威胁情报 API,并打印带有 AI 摘要的彩色终端报告。

## 功能介绍
你只需提供 IP 地址,它会同时检查 9 个安全数据库,在工作时显示实时进度指示器,然后将所有内容以彩色报告的形式打印出来——还会附带一段 AI 摘要,为你解释这些信息的含义。
```
$ ./ip-investigator.exe 8.8.8.8
```
## 工作原理
```
flowchart TD
A([You run: ip-investigator 8.8.8.8]) --> B[Load API keys from .env]
B --> C[Start 9 enrichers at the same time]
C --> D1[IPInfo]
C --> D2[ReverseDNS]
C --> D3[WHOIS]
C --> D4[VirusTotal]
C --> D5[GoogleTI]
C --> D6[AbuseIPDB]
C --> D7[GreyNoise]
C --> D8[OTX]
C --> D9[Shodan]
D1 & D2 & D3 & D4 & D5 & D6 & D7 & D8 & D9 --> E[Live progress ticker updates as each one finishes]
E --> F[OpenRouter AI reads all results and writes a summary]
F --> G([Colored report printed to terminal])
```
## 9 个数据源
| 数据源 | 告知的内容 |
|---|---|
| **IPInfo** | 国家、城市、ISP、组织 |
| **ReverseDNS** | 与该 IP 关联的主机名 |
| **WHOIS** | 谁注册了该 IP 段 |
| **VirusTotal** | 有多少安全供应商将其标记为恶意 |
| **Google Threat Intelligence** | Google 自己的威胁判定和严重程度 |
| **AbuseIPDB** | 社区报告的滥用评分 (0–100) |
| **GreyNoise** | 此 IP 是否正在对互联网进行大规模扫描? |
| **OTX** (AlienVault) | 已知的恶意软件和攻击活动 |
| **Shodan** | 此 IP 暴露的开放端口和服务 |
## 关键术语
- **Enricher** — 与单一数据源通信的模块。所有 9 个模块同时(并发)运行,因此总等待时间等于最慢的那个——而不是所有模块的时间总和。
- **Threat Intelligence** — 收集的关于已知恶意、涉及攻击或运行扫描操作的 IP 的数据。
- **OpenRouter** — 一项允许你使用单一 API 密钥访问多种 AI 模型(Gemma、LLaMA 等)的服务。在这里用于将调查结果总结为通俗易懂的文本。
- **Context timeout** — 对 enricher 强制设定的 30 秒限制。如果 API 挂起,它会被直接切断,而不会导致工具卡死。
## 状态图标
| 图标 | 含义 |
|---|---|
| `✓` | 成功获取数据 |
| `~` | 频率受限(请稍后重试) |
| `-` | 未找到此 IP 的数据 |
| `✗` | 错误 — 密钥缺失、超时或 API 宕机 |
## 安装与设置
**1. 克隆仓库**
```
git clone https://github.com/aivxx02/ip-investigator.git
cd ip-investigator
```
**2. 在二进制文件旁边创建一个 `.env` 文件**(复制 `.env.example` 作为起点):
```
IPINFO_KEY=your_key_here
VIRUSTOTAL_KEY=your_key_here
GOOGLE_TI_KEY=your_key_here
ABUSEIPDB_KEY=your_key_here
GREYNOISE_KEY=your_key_here
OTX_KEY=your_key_here
SHODAN_KEY=your_key_here
OPENROUTER_KEY=your_key_here
OPENROUTER_MODEL=google/gemma-2-9b-it:free
```
所有密钥均为可选——缺少密钥的 enricher 将在报告中显示 `✗` 并被跳过。
**3. 构建**
```
go build -o ip-investigator.exe . # Windows
go build -o ip-investigator . # Linux/macOS
```
**4. 运行**
```
./ip-investigator.exe 1.1.1.1
```
## API 密钥
| 服务 | 免费额度 | 链接 |
|---|---|---|
| IPInfo | 5万次请求/月 | https://ipinfo.io |
| VirusTotal | 500次请求/天 | https://virustotal.com |
| Google TI | 有限免费 | https://cloud.google.com/threat-intelligence |
| AbuseIPDB | 1000次请求/天 | https://abuseipdb.com |
| GreyNoise | 社区免费版 | https://greynoise.io |
| AlienVault OTX | 免费 | https://otx.alienvault.com |
| Shodan | 免费(受限) | https://shodan.io |
| OpenRouter | 提供免费模型 | https://openrouter.ai |
标签:AbuseIPDB, AI摘要, Ask搜索, ChatGPT, CLI, ESC4, EVTX分析, GitHub, Golang, GreyNoise, IP地址查询, IP调查, OSINT, OTX, PB级数据处理, Promptflow, VirusTotal, WHOIS, WiFi技术, 反DNS解析, 反取证, 商业软件, 威胁情报, 威胁情报聚合, 安全编程, 安全评估, 安全运维, 并发查询, 开发者工具, 恶意IP, 数据统计, 无线安全, 日志审计, 端口扫描, 网络安全, 隐私保护