fayazmohmmand/threat-intel-platform
GitHub: fayazmohmmand/threat-intel-platform
一个集成了多源情报聚合、MITRE ATT&CK 映射和 YARA 规则匹配的命令行威胁情报查询与分析平台。
Stars: 1 | Forks: 0
# 威胁情报平台 (TIP)
由 **FAK Security Labs** 构建,这是一个用作作品集级别的威胁情报工具,用于演示真实的 SOC 分析师和威胁狩猎工作流。
## 功能
| 模块 | 功能 |
|---|---|
| **IOC 检测** | 自动检测 IPv4、IPv6、domain、URL、MD5、SHA1、SHA256、SHA512、email、CVE |
| **IP 信誉** | AbuseIPDB 滥用分数 + AlienVault OTX pulse 计数 + Shodan 端口/CVE 数据 |
| **Domain 信誉** | OTX pulse 查询、被动 DNS、whois 注册商 |
| **Hash 搜索** | OTX 恶意软件家族识别 + YARA 规则匹配 |
| **CISA KEV** | 已知被利用漏洞目录查询(无需 API 密钥) |
| **MITRE ATT&CK** | 恶意软件家族 -> 技术 映射(Emotet、WannaCry、Cobalt Strike、APT28...) |
| **YARA 规则** | 精选规则数据库:WannaCry、Emotet、Mirai、Cobalt Strike、Ryuk、webshell |
| **IOC 图谱** | 关系图谱(IOC -> 恶意软件 -> 基础设施 -> 技术) |
| **报告** | 带有侧边栏导航的专业 JSON + HTML 报告 |
| **批量查询** | 通过一条命令处理包含多个 IOC 的文件 |
## 架构
```
threat-intel-platform/
├── tip_platform.py # CLI entrypoint
├── tip/
│ ├── ioc.py # IOC detection and classification
│ ├── config.py # API key management (.env loader)
│ ├── lookup.py # Central orchestrator
│ ├── graph.py # IOC relationship graph builder
│ ├── reporter.py # JSON + HTML report generator
│ ├── http_client.py # Shared HTTP client (retry, rate limit)
│ ├── logger.py # Colored logging
│ └── sources/
│ ├── otx.py # AlienVault OTX integration
│ ├── abuseipdb.py # AbuseIPDB integration
│ ├── shodan.py # Shodan integration
│ ├── cisa_kev.py # CISA KEV catalog (no key needed)
│ ├── mitre_attack.py # MITRE ATT&CK framework
│ └── yara_search.py # YARA rule database
├── tests/
│ └── test_tip.py # 30 unit tests
├── .env.example # API key template
└── requirements.txt
```
## 快速开始
```
git clone https://github.com/fayazmohmmand/threat-intel-platform.git
cd threat-intel-platform
pip install -r requirements.txt
```
### 配置 API 密钥(可选,但推荐)
```
cp .env.example .env
# 使用您的免费 API keys 编辑 .env
```
免费密钥:
- **AlienVault OTX** — https://otx.alienvault.com(免费,需注册)
- **AbuseIPDB** — https://www.abuseipdb.com(免费,每天 1000 次查询)
- **Shodan** — https://account.shodan.io(免费额度)
- **CISA KEV + MITRE ATT&CK** — 无需密钥
## 用法
### IP 信誉查询
```
python tip_platform.py -i 185.220.101.45
python tip_platform.py -i 8.8.8.8
```
### Domain 查询
```
python tip_platform.py -i malware.example.com
python tip_platform.py -i phishing-site.ru
```
### 文件 Hash 搜索
```
python tip_platform.py -i 44d88612fea8a8f36de82e1278abb02f
python tip_platform.py -i e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
```
### CVE 查询 (CISA KEV)
```
python tip_platform.py -i CVE-2021-44228 # Log4Shell
python tip_platform.py -i CVE-2017-0144 # EternalBlue
python tip_platform.py -i CVE-2019-0708 # BlueKeep
```
### 恶意软件家族 / 威胁行为者 (MITRE ATT&CK)
```
python tip_platform.py --malware emotet
python tip_platform.py --malware "cobalt strike"
python tip_platform.py --malware wannacry
python tip_platform.py --malware apt28
python tip_platform.py --malware lazarus
```
### YARA 规则搜索
```
python tip_platform.py --yara ransomware
python tip_platform.py --yara emotet
python tip_platform.py --yara webshell
```
### MITRE ATT&CK 技术查询
```
python tip_platform.py --technique T1566.001
python tip_platform.py --technique T1486
```
### CISA KEV 目录
```
# 最近 7 天内添加的 CVEs
python tip_platform.py --cve-recent 7
# 完整目录统计信息
python tip_platform.py --kev-stats
```
### 批量 IOC 处理
```
# 创建一个文件,每行包含一个 IOC
echo "8.8.8.8
185.220.101.45
malware.example.com
CVE-2021-44228" > targets.txt
python tip_platform.py --bulk targets.txt
```
### CLI 选项
```
-i, --ioc IOC to look up (IP, domain, hash, URL, CVE)
--malware Malware/actor name (MITRE ATT&CK lookup)
--yara YARA rule search by family or tag
--technique MITRE ATT&CK technique ID (e.g. T1566.001)
--cve-recent N CISA KEV entries added in last N days
--kev-stats CISA KEV catalog statistics
--bulk FILE File of IOCs to process
--no-graph Skip IOC relationship graph
--json-only JSON report only (skip HTML)
--no-report Terminal output only, no files saved
--output-dir DIR Report directory (default: reports/)
--sources Show configured API sources
```
## 示例输出
```
IOC : 185.220.101.45
TYPE : IPV4
RISK : CRITICAL (Score: 87/100)
FAMILIES : Tor Exit, DDoS
TAGS : tor, abuse, brute-force, scanner
--- Source Results ---
[otx ] HIGH pulses=12
[abuseipdb ] CRITICAL abuse=94% reports=847
[shodan ] HIGH ports=3
```
## 检测内容
### IP 信誉 (AbuseIPDB + OTX + Shodan)
- 滥用置信度分数 (0-100%)
- 滥用报告总数和独立报告者数量
- ISP、使用类型、国家
- Tor 出口节点检测
- Shodan:开放端口、服务 banner、CVE
- OTX:pulse 计数、恶意软件家族、威胁标签
### CVE 情报 (CISA KEV)
- 主动利用确认
- 受影响的供应商/产品
- 补丁截止日期(联邦强制要求)
- 勒索软件活动关联
### 恶意软件 / 威胁行为者 (MITRE ATT&CK)
内置数据库涵盖:Emotet、WannaCry、Mirai、Cobalt Strike、TrickBot、Ryuk、Lazarus Group、APT28 (Fancy Bear) + 实时 ATT&CK STIX 数据。
### YARA 规则
精选规则涵盖:WannaCry、Emotet、Mirai、Cobalt Strike、Ryuk、通用勒索软件、Webshell。
## 运行测试
```
pip install pytest pytest-cov
pytest tests/ -v
pytest tests/ --cov=tip --cov-report=term-missing
```
## 展示技能
- **威胁情报**:多源 IOC 富化、置信度评分、风险聚合
- **API 集成**:AlienVault OTX、AbuseIPDB、Shodan、CISA KEV(无外部库)
- **MITRE ATT&CK**:恶意软件家族和威胁行为者的框架映射
- **YARA**:规则语法、恶意软件检测逻辑、签名编写
- **Python 工程**:模块化设计、重试/速率限制处理、缓存、单元测试
- **SOC 工作流**:IOC 分流、CVE 优先级排序、威胁行为者画像
## 法律免责声明
## 作者
**Fayaz Ahmad Khan** — FAK Security Labs
CEH | ISC2 CC | 网络安全学士 @ AWKUM
[GitHub](https://github.com/fayazmohmmand) · [LinkedIn](https://linkedin.com/in/fayazkhan)
标签:DNS信息、DNS暴力破解, IOC检测, YARA规则, 命令行工具(CLI), 威胁情报, 安全规则引擎, 安全运营中心(SOC), 开发者工具, 逆向工具