Nicegreanz/DarkHuntAI-GUI

GitHub: Nicegreanz/DarkHuntAI-GUI

一个基于 Flask 和 CrewAI 构建的多 Agent 威胁狩猎 Web 界面,能够自动分析各类威胁指标并生成综合威胁情报报告。

Stars: 0 | Forks: 0

# 🌑 DarkHuntAI GUI 一个为 [DarkHuntAI](https://github.com/Open-ASPM-Project/DarkHuntAI) 提供的**基于 Web 的 GUI** —— 这是一个由 [CrewAI](https://github.com/crewAIInc/crewAI) 驱动的多 Agent AI 威胁狩猎系统。提交任何 IOC(URL、IP、域名或文件哈希),观看 5 个专业的 AI Agent 协同工作,实时生成完整的威胁情报报告。 ![Python](https://img.shields.io/badge/python-3.10--3.13-blue) ![Flask](https://img.shields.io/badge/flask-3.x-green) ![CrewAI](https://img.shields.io/badge/crewai-0.152+-orange) ![License](https://img.shields.io/badge/license-MIT-yellow) ## ✨ 功能 - **5-Agent AI 团队** — 分诊专家 → 恶意软件猎人 → 基础设施侦探 → 协调者 → 攻击活动战略家 - **实时终端流** — 实时观看 Agent 的思考与行动 - **选项卡式情报报告** — 为每个 Agent 阶段提供单独的报告 - **多 IOC 支持** — URL、IP、域名、MD5/SHA1/SHA256 哈希 - **本地 LLM 支持** — 使用 [Ollama](https://ollama.com) 完全离线运行(例如 `qwen2.5:7b`) - **兼容 OpenAI** — 同时支持 `gpt-4o`、`gpt-4o-mini` 等 - **调查历史记录** — 侧边栏会记录本次会话中所有过去的扫描 - **暗黑网络主题** — 专为 SOC 分析师审美而设计 ## 🤖 AI Agent 团队 | Agent | 角色 | |---|---| | 🔍 分诊专家 | 快速 IOC 评估和优先级识别 | | 🦠 恶意软件猎人 | 深度行为分析和攻击链重建 | | 🕸️ 基础设施侦探 | 通过 URLScan 进行攻击活动关联和基础设施映射 | | 🎼 调查协调者 | 质量保证和跨 Agent 情报关联 | | 🎯 攻击活动战略家 | 战略情报、狩猎假设和归属分析 | ## 🧰 前置条件 | 要求 | 版本 | 说明 | |---|---|---| | Python | 3.10 – 3.13 | **不支持 3.14+** — CrewAI 要求 `<3.14` | | VirusTotal API Key | 免费层 | [注册](https://www.virustotal.com/gui/join-us) | | URLScan.io API Key | 免费层 | [注册](https://urlscan.io/user/signup) | | LLM(任选其一) | — | 请参阅下方的选项 | ### LLM 选项 **选项 A — 本地(免费,推荐):** - 安装 [Ollama](https://ollama.com) - 拉取模型:`ollama pull qwen2.5:7b` **选项 B — OpenAI:** - 从 [platform.openai.com](https://platform.openai.com) 获取 API key - 为您的账户添加账单余额 ## 🚀 安装 ### 1. 克隆仓库 ``` git clone https://github.com/YOUR_USERNAME/DarkHuntAI-GUI.git cd DarkHuntAI-GUI ``` ### 2. 创建 Python 虚拟环境 ``` # Windows py -3.13 -m venv venv venv\Scripts\activate # macOS / Linux python3.13 -m venv venv source venv/bin/activate ``` ### 3. 安装依赖项 ``` pip install -r requirements.txt ``` ### 4. 配置 API Key ``` copy .env.example .env # Windows cp .env.example .env # macOS/Linux ``` 打开 `.env` 并填入您的 key: **使用 Ollama(本地):** ``` MODEL=ollama/qwen2.5:7b OPENAI_API_KEY=NA VIRUSTOTAL_API_KEY=your_virustotal_key_here URLSCAN_API_KEY=your_urlscan_key_here ``` **使用 OpenAI:** ``` MODEL=gpt-4o OPENAI_API_KEY=sk-your_openai_key_here VIRUSTOTAL_API_KEY=your_virustotal_key_here URLSCAN_API_KEY=your_urlscan_key_here ``` ## ▶️ 运行应用程序 确保您的虚拟环境已激活,然后执行: ``` python app.py ``` 您应该会看到: ``` ╔══════════════════════════════════════════╗ ║ 🌑 DarkHuntAI GUI ║ ╠══════════════════════════════════════════╣ ║ Open: http://localhost:5000 ║ ╚══════════════════════════════════════════╝ ``` 在浏览器中打开 **http://localhost:5000**。 ## 🖥️ 如何使用 ### 提交 IOC 1. 在搜索栏中输入任何威胁指标: - **URL**:`http://malicious-site.com/payload` - **域名**:`evil-domain.com` - **IP 地址**:`1.2.3.4` - **哈希**:`d5ac9f4dbc2a2b3f8e7c1a9b8d7e6f5a`(MD5/SHA1/SHA256) 2. 按 **Enter** 键或点击 **Hunt** 3. 随着 5 个专家依次完成各自的阶段,观察 5 个 Agent 卡片逐一激活 4. 实时终端会实时流式传输所有 Agent 的输出 ### 查看结果 调查完成后: | 选项卡 | 内容 | |---|---| | 🎯 最终报告 | 攻击活动情报、IOC 列表、狩猎假设 | | 🔍 分诊 | 初始 IOC 信誉和优先级评估 | | 🦠 恶意软件 | 行为分析、C2 基础设施、释放的文件 | | 🕸️ 基础设施 | URLScan 关联、ASN 聚类、攻击活动映射 | | 🎼 协调 | 跨 Agent 差距分析和调查完整性 | ### 更新 API Key 随时点击右上角的 **⚙ API Keys** 来更新您的 key。更改会立即保存到 `.env` 中 —— 无需重启。 ## 📁 项目结构 ``` DarkHuntAI-GUI/ ├── app.py # Flask web server + SSE stream ├── run_threat_hunter.py # Original CLI entry point ├── requirements.txt ├── .env.example # API key template ├── pyproject.toml │ ├── src/DarkHuntAI/ │ ├── crew.py # CrewAI agent + task definitions │ ├── main.py # Investigation runner │ ├── config/ │ │ ├── agents.yaml # Agent personalities & goals │ │ └── tasks.yaml # Task descriptions & expected outputs │ └── tools/ │ ├── virustotal_tool.py # VirusTotal API integration │ └── urlscan_tool.py # URLScan.io API integration │ ├── templates/ │ └── index.html # Web GUI (single-file frontend) │ └── reports/ # Generated investigation reports (auto-created) ├── triage_assessment.md ├── malware_analysis.md ├── infrastructure_analysis.md ├── final_intelligence_report.md └── campaign_intelligence.md ``` ## 🔧 故障排除 ### 安装 `crewai` 失败并提示 "no matching distribution" 您的 Python 版本是 3.14+。CrewAI 要求 Python 3.10–3.13。请使用 `py -3.13 -m venv venv` 来创建正确版本的环境。 ### 扫描时出现 `super(type, obj)` 错误 这是一个模块导入冲突。请确保您是在 `DarkHuntAI-GUI` 文件夹内,并在激活虚拟环境的情况下运行 `python app.py`。 ### OpenAI 429 配额错误 您的 OpenAI 账户已用完额度。请在 [platform.openai.com/settings/billing](https://platform.openai.com/settings/billing) 添加账单,或者在 `.env` 中设置 `MODEL=ollama/qwen2.5:7b` 以切换到 Ollama。 ### Ollama 连接被拒绝 Ollama 未运行。请在终端中使用 `ollama serve` 启动它,然后重启应用程序。 ### 编辑 `.env` 后未检测到 API Key 请重启 Flask 服务器(`Ctrl+C` → `python app.py`)。当您在 GUI 中点击 ⚙ 时,也会自动重新读取 Key。 ## 🙏 致谢 - 核心多 Agent 系统:由 Open-ASPM-Project 开发的 [DarkHuntAI](https://github.com/Open-ASPM-Project/DarkHuntAI) - Agent 框架:[CrewAI](https://github.com/crewAIInc/crewAI) - 威胁情报:[VirusTotal API](https://developers.virustotal.com) · [URLScan.io API](https://urlscan.io/docs/api/) ## 📄 许可证 MIT — 详情请参阅 [LICENSE](LICENSE)。
标签:AI风险缓解, Flask, Python, 多智能体, 威胁情报, 安全, 开发者工具, 无后门, 超时处理, 逆向工具