BlackRoad-Security/blackroad-threat-intel
GitHub: BlackRoad-Security/blackroad-threat-intel
一个轻量级威胁情报聚合与关联工具,支持多类型 IOC 管理、威胁行为者追踪、FTS5 搜索和 STIX 2.1 标准导出。
Stars: 0 | Forks: 0
# blackroad-threat-intel
[](https://github.com/BlackRoad-Security/blackroad-threat-intel/actions/workflows/ci.yml)
聚合、丰富并关联跨威胁源的 **妥协指标 (IOCs)**。追踪威胁行为者、导出 STIX 2.1 bundle,并运行 FTS5 驱动的查询。
## 功能特性
- 🔍 **IOC 类型**:IP, Domain, Hash, URL, Email, CVE
- 🎯 **置信度 + 严重性**:0–100 置信度分数,info/low/medium/high/critical 严重性
- 👤 **威胁行为者**:追踪 APT 组织、别名、TTPs (MITRE ATT&CK)、动机
- ⚡ **FTS5 搜索**:跨所有 indicator 字段的全文本搜索
- 🔗 **关联引擎**:根据来源、标签和模式查找相关 IOC
- 📦 **STIX 2.1 导出**:导出为符合标准的 STIX 2.1 bundle JSON
- 📥 **批量导入**:从列表或威胁源 JSON 导入
- 💾 **SQLite**:自包含、零配置持久化
## 快速开始
```
# 加载演示威胁数据
python threat_intel.py demo
# 检查 IP 地址
python threat_intel.py check-ip 185.220.101.45
# 检查域名
python threat_intel.py check-domain malware-c2.evil.com
# 添加自定义指标
python threat_intel.py add ip 10.0.0.1 85 high internal-soc
# 搜索指标
python threat_intel.py search "botnet"
# 获取所有 active high+ 指标
python threat_intel.py active high
# 导出为 STIX 2.1
python threat_intel.py export-stix threat_bundle.json
# 关联指标
python threat_intel.py correlate
# 查看统计
python threat_intel.py stats
```
## API
```
from threat_intel import ThreatIntelDB
db = ThreatIntelDB("my_intel.db")
# 添加 IOC
ind = db.add_indicator("ip", "185.220.101.45", confidence=95,
severity="critical", source="abuse.ch",
tags=["tor", "exit-node"])
# 查询
found = db.check_ip("185.220.101.45")
# 从 Feed 批量导入
count = db.bulk_import([
{"type": "domain", "value": "evil.com", "confidence": 90,
"severity": "high", "source": "urlhaus", "tags": ["malware"]}
])
# 获取 active critical 指标
active = db.get_active("critical")
# 关联
related = db.correlate(ind.id)
# 导出 STIX 2.1
stix_json = db.export_stix_json()
# 追踪 Threat Actor
actor = db.add_threat_actor("APT-01", aliases=["Shadow"],
motivation="espionage",
ttps=["T1566", "T1059"])
```
## Indicator 类型
| Type | Example | Notes |
|------|---------|-------|
| `ip` | `185.220.101.45` | 标准化,已验证 |
| `domain` | `evil.com` | 已小写,去点 |
| `hash` | `d41d8cd98f...` | MD5/SHA1/SHA256 |
| `url` | `http://evil.com/payload` | 原样保留 |
| `email` | `phish@bad.com` | 已小写 |
| `cve` | `CVE-2021-44228` | 已大写 |
## 运行测试
```
pip install pytest
pytest test_threat_intel.py -v
```
标签:APT追踪, ATT&CK映射, C2检测, CVE, DAST, ESC4, FTS5, GPT, IOC管理, IP查询, OSINT, Python安全工具, SOC工具, SQLite, STIX 2.1, 信誉库, 入侵指标, 全文搜索, 哈希校验, 域名检测, 威胁情报, 安全运营, 开发者工具, 恶意软件分析, 扫描框架, 攻击归因, 数字签名, 数据关联, 漏洞发现, 漏洞管理, 自动化防御, 逆向工具, 速率限制处理, 黄金证书