Mishraji69/Vigilant_AI

GitHub: Mishraji69/Vigilant_AI

基于LLM多智能体协作的网络安全分析平台,支持MITRE ATT&CK技术提取、EDR盲区检测和威胁报告自动生成。

Stars: 0 | Forks: 0

# Vigilant AI - 网络安全仿真平台 一个全栈应用程序,结合了基于 Python 的多智能体网络安全后端和现代化的 React 仪表板,用于可视化展示和控制。 ## 🌟 功能特性 - **多智能体系统**: 协调多个 AI 智能体进行网络安全操作 - **场景执行**: 预定义和自定义安全场景 - **实时监控**: 实时智能体状态和日志流 - **Artifact 管理**: 集中存储和检索操作输出 - **交互式仪表板**: 具有实时更新功能的现代 React UI - **报告生成**: 自动化分析和报告 ## 🏗️ 架构 ``` ┌─────────────────────────────────────────────────────────────┐ │ React Dashboard │ │ (Port 5173 - Development) │ └─────────────────┬───────────────────────────────────────────┘ │ REST API ↓ ┌─────────────────────────────────────────────────────────────┐ │ Flask API Server (Port 5000) │ └─────────────────┬───────────────────────────────────────────┘ │ Direct Access ↓ ┌─────────────────────────────────────────────────────────────┐ │ Vigilant AI Backend (Python) │ │ • Agent Orchestration • SQLite Logging │ │ • Caldera Integration • Artifact Storage │ └─────────────────────────────────────────────────────────────┘ ``` ## 🚀 快速开始 ### 前置条件 - **Python 3.8+** 和 pip - **Node.js 18+** 和 npm - **Git** ### 安装说明 1. **克隆仓库** ``` git clone cd baap ``` 2. **安装后端依赖** ``` cd vigilant_AI/cyber-security-llm-agents pip install -r requirements.txt cd ../.. ``` 3. **安装前端依赖** ``` cd frontend npm install cd .. ``` 4. **配置环境** 复制并更新环境文件: ``` # 后端 cp vigilant_AI/cyber-security-llm-agents/.env.example vigilant_AI/cyber-security-llm-agents/.env # 前端 cp frontend/.env.example frontend/.env ``` 更新 `vigilant_AI/cyber-security-llm-agents/.env`: - 设置你的 `OPENAI_API_KEY`(或 Groq API key) - 如果使用 Caldera,请配置 `CALDERA_SERVER` 和 `CALDERA_API_KEY` ### 运行应用程序 #### 选项 1:使用启动脚本 **Windows:** ``` start.bat ``` **Linux/Mac:** ``` chmod +x start.sh ./start.sh ``` #### 选项 2:手动启动 **终端 1 - 后端 API:** ``` cd vigilant_AI/cyber-security-llm-agents python api_server.py ``` **终端 2 - 前端:** ``` cd frontend npm run dev ``` ### 访问仪表板 在浏览器中打开:**http://localhost:5173** ## 📁 项目结构 ``` baap/ ├── frontend/ # React dashboard │ ├── src/ │ │ ├── components/ # UI components │ │ ├── pages/ # Page components │ │ ├── services/ # API integration layer │ │ ├── hooks/ # React hooks │ │ └── layout/ # Layout components │ ├── package.json │ └── vite.config.js │ ├── vigilant_AI/ # Python backend │ └── cyber-security-llm-agents/ │ ├── api_server.py # Flask API wrapper (NEW) │ ├── run_agents.py # Agent orchestration │ ├── agents/ # Agent implementations │ ├── tools/ # Tool definitions │ ├── utils/ # Utilities │ ├── actions/ # Scenario definitions │ ├── logs.db # SQLite logs (created on first run) │ └── llm_working_folder/ # Artifact storage │ ├── INTEGRATION.md # Detailed integration guide ├── start.sh # Linux/Mac startup script ├── start.bat # Windows startup script └── README.md # This file ``` ## 🎮 使用说明 ### 运行场景 1. 打开仪表板 http://localhost:5173 2. 导航到 **仪表板** 或 **智能体** 页面 3. 选择一个场景(例如 "DETECT_EDR", "HELLO_AGENTS") 4. 点击 **运行场景** 5. 实时监控进度 ### 查看日志 1. 导航到 **日志** 页面 2. 日志每 2 秒自动流式更新 3. 筛选条件: - **级别**: INFO, WARN, ERROR - **智能体**: Coordinator, Recon Agent 等 4. 如需要可将日志导出为 JSON ### 浏览 Artifacts 1. 导航到 **Artifacts** 页面 2. 浏览文件夹结构: - `caldera/` - Caldera 相关输出 - `code/` - 代码执行结果 - `pdf/` - 生成的报告 - `http_server/` - Web 服务器文件 3. 下载或预览文件 ### 生成报告 1. 导航到 **报告** 页面 2. 查看自动生成的摘要 3. 将报告导出为 JSON/CSV ## 🔧 配置 ### 后端配置 文件:`vigilant_AI/cyber-security-llm-agents/.env` ``` # API Server API_PORT=5000 # LLM 配置 OPENAI_MODEL_NAME="llama-3.1-8b-instant" OPENAI_API_KEY="your-api-key-here" # Caldera (可选) CALDERA_SERVER="http://localhost:8888" CALDERA_API_KEY="your-caldera-key" # 工作目录 LLM_WORKING_FOLDER="llm_working_folder" ``` ### 前端配置 文件:`frontend/.env` ``` # Backend API URL VITE_API_BASE_URL=http://localhost:5000 # 轮询间隔 (可选) VITE_AGENT_POLL_INTERVAL=3000 VITE_LOG_POLL_INTERVAL=2000 ``` ## 📚 可用场景 | 场景 ID | 描述 | |-------------|-------------| | `HELLO_AGENTS` | 简单测试场景 | | `DETECT_EDR` | 检测终端安全产品 | | `DETECT_AGENT_PRIVILEGES` | 检查智能体权限 | | `COLLECT_CALDERA_INFO` | 收集 Caldera 操作信息 | | `IDENTIFY_EDR_BYPASS_TECHNIQUES` | 查找 EDR 遥测盲区 | | `SUMMARIZE_RECENT_CISA_VULNS` | 分析近期的 CISA 漏洞 | 通过 CLI 运行: ``` cd vigilant_AI/cyber-security-llm-agents python run_agents.py DETECT_EDR ``` ## 🔍 API Endpoints Flask API 服务器提供以下端点: ### 智能体 - `GET /api/agents` - 列出所有智能体 - `GET /api/agents/` - 获取智能体详情 ### 日志 - `GET /api/logs` - 检索日志(查询参数:level, agent, limit) - `GET /api/logs/stats` - 获取日志统计信息 ### 场景 - `GET /api/scenarios` - 列出场景 - `POST /api/scenarios//run` - 执行场景 - `GET /api/scenarios//status` - 检查场景状态 ### Artifacts - `GET /api/artifacts` - 列出所有 artifacts - `GET /api/artifacts/` - 下载 artifact ### 协调器 - `GET /api/coordinator/status` - 获取系统状态 ### 健康检查 - `GET /api/health` - 健康检查 ## 🧪 开发 ### 运行测试 **后端:** ``` cd vigilant_AI/cyber-security-llm-agents python -m pytest ``` **前端:** ``` cd frontend npm test ``` ### 生产环境构建 **前端:** ``` cd frontend npm run build # 输出: frontend/dist/ ``` **后端:** ``` pip install gunicorn gunicorn -w 4 -b 0.0.0.0:5000 api_server:app ``` ### 代码风格 - **后端**: PEP 8, 运行 `flake8` - **前端**: ESLint, 运行 `npm run lint` ## 🐛 故障排除 ### 问题:后端无法启动 **检查:** 1. Python 依赖已安装:`pip install -r requirements.txt` 2. `.env` 文件存在且包含有效的 API keys 3. 端口 5000 未被占用 ### 问题:前端无法连接 **检查:** 1. 后端是否正在运行:`curl http://localhost:5000/api/health` 2. `frontend/.env` 中的 `VITE_API_BASE_URL` 是否正确 3. CORS 已启用(已配置) ### 问题:没有日志显示 **解决方案:** 先运行一个场景以创建日志数据库: ``` python run_agents.py HELLO_AGENTS ``` ### 问题:场景执行失败 **检查:** 1. 后端 `.env` 中有有效的 `OPENAI_API_KEY` 2. 后端终端显示详细的错误日志 3. API 调用的网络连接正常 如需更多故障排除信息,请参阅 [INTEGRATION.md](INTEGRATION.md#troubleshooting)。 ## 📖 文档 - **[INTEGRATION.md](INTEGRATION.md)** - 详细集成指南 - **[frontend/README.md](frontend/README.md)** - 前端文档 - **后端文档** - 参见 `vigilant_AI/cyber-security-llm-agents/documentation/` ## 🤝 贡献 1. Fork 本仓库 2. 创建一个功能分支 (`git checkout -b feature/amazing-feature`) 3. 提交你的更改 (`git commit -m 'Add amazing feature'`) 4. 推送到分支 (`git push origin feature/amazing-feature`) 5. 打开一个 Pull Request ## 📄 许可证 [指定许可证] ## 🙏 致谢 - 基于 **Vigilant AI** 网络安全平台构建 - 使用 **AutoGen** 进行多智能体编排 - 由 **OpenAI**/**Groq** LLMs 提供支持 - 集成 **MITRE Caldera** ## 📞 支持 如有问题、疑问或功能请求: - 在 GitHub 上开启一个 issue - 联系开发团队 - 查看 [INTEGRATION.md](INTEGRATION.md) 指南 **为网络安全研究和教育而生 ❤️**
标签:Cloudflare, DLL 劫持, EDR, EDR缺口检测, Flask, FTP漏洞扫描, HTTP/HTTPS抓包, LLM, MITRE ATT&CK, PyRIT, Python, React, SOAR, Syscalls, Unmanaged PE, WSL, 人工智能, 仪表盘, 多智能体系统, 大语言模型, 威胁分析, 安全编排, 密码管理, 对手画像, 对抗模拟, 态势感知, 插件系统, 无后门, 用户模式Hook绕过, 端点安全, 结构化查询, 网络安全, 网络安全审计, 脆弱性评估, 自动化侦查工具, 自动化安全, 自定义脚本, 补丁管理, 逆向工具, 隐私保护