solomonneas/mitre-mcp

GitHub: solomonneas/mitre-mcp

为 LLM 提供完整的 MITRE ATT&CK 知识库访问能力,支持告警映射、威胁组织画像、检测覆盖分析等安全运营场景的智能查询与研判。

Stars: 0 | Forks: 0

# MITRE ATT&CK MCP 服务器 [![TypeScript 5.7](https://img.shields.io/badge/TypeScript-5.7-blue)](https://www.typescriptlang.org/) [![Node.js 20+](https://img.shields.io/badge/Node.js-20%2B-green)](https://nodejs.org/) [![MCP 1.x](https://img.shields.io/badge/MCP-1.x-purple)](https://modelcontextprotocol.io/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](LICENSE) 一个提供对 MITRE ATT&CK 知识库全面访问的 MCP server。支持 LLM 查询技术(techniques)、将警报映射到 ATT&CK、分析检测覆盖范围、剖析攻击活动(campaigns)以及生成威胁情报上下文。 ## 功能 - **19 个工具**:用于技术查询、战术(tactic)导航、组织情报、软件分析、缓解措施映射、检测覆盖、警报映射、攻击活动剖析及数据管理 - **3 个资源**:用于矩阵概览、版本信息和战术列表 - **4 个提示词**:用于事件映射、威胁狩猎、差距分析和归因分析 - **支持离线**:具备本地 STIX 2.1 数据缓存功能 - **自动更新**:支持可配置的刷新间隔 - **矩阵支持**:支持 Enterprise、Mobile 和 ICS 矩阵 ## 前置条件 - Node.js 20 或更高版本 - 需要互联网访问以下载初始 ATT&CK 数据(首次运行后将在本地缓存) ## 安装 ``` git clone https://github.com/solomonneas/mitre-mcp.git cd mitre-mcp npm install npm run build ``` ## 配置 | Variable | Default | Description | |----------|---------|-------------| | `MITRE_DATA_DIR` | `~/.mitre-mcp/data` | STIX Bundle 的本地缓存目录 | | `MITRE_MATRICES` | `enterprise` | 逗号分隔的矩阵列表:`enterprise`、`mobile`、`ics` | | `MITRE_UPDATE_INTERVAL` | `86400` | 自动更新检查间隔(秒)(默认为 24 小时) | ## 使用 ### Claude 桌面版 添加到您的 Claude Desktop 配置 (`claude_desktop_config.json`) 中: ``` { "mcpServers": { "mitre-attack": { "command": "node", "args": ["/path/to/mitre-mcp/dist/index.js"], "env": { "MITRE_MATRICES": "enterprise" } } } } ``` ### OpenClaw 添加到您的 `openclaw.json` 中: ``` { "mcp": { "servers": { "mitre-attack": { "type": "stdio", "command": "node", "args": ["/path/to/mitre-mcp/dist/index.js"] } } } } ``` ### 独立运行 ``` npm run start ``` ### 开发 ``` npm run dev ``` ## 工具参考 ### 技术查询 | Tool | Description | |------|-------------| | `mitre_get_technique` | 通过 ID 获取技术的完整详情(例如 T1059, T1059.001) | | `mitre_search_techniques` | 通过关键词、战术、平台或数据源搜索技术 | ### 战术导航 | Tool | Description | |------|-------------| | `mitre_list_tactics` | 按 Kill Chain 顺序列出所有战术 | | `mitre_get_tactic` | 获取战术详情及其关联的所有技术 | ### 威胁组织情报 | Tool | Description | |------|-------------| | `mitre_get_group` | 获取组织详情,包括其使用的技术和软件 | | `mitre_search_groups` | 通过关键词或使用的技术搜索组织 | | `mitre_list_groups` | 列出所有已知的威胁组织 | ### 软件与恶意软件 | Tool | Description | |------|-------------| | `mitre_get_software` | 获取软件详情,包括相关技术和关联组织 | | `mitre_search_software` | 通过名称、技术或类型(malware/tool)搜索软件 | ### 缓解措施映射 | Tool | Description | |------|-------------| | `mitre_get_mitigation` | 获取缓解措施详情及其涉及的技术 | | `mitre_mitigations_for_technique` | 获取针对特定技术的所有缓解措施 | | `mitre_search_mitigations` | 通过关键词搜索缓解措施 | ### 检测与数据源 | Tool | Description | |------|-------------| | `mitre_get_datasource` | 获取数据源详情,包括组件和可检测的技术 | | `mitre_detection_coverage` | 基于可用的数据源分析检测覆盖范围 | ### 映射与关联 | Tool | Description | |------|-------------| | `mitre_map_alert_to_technique` | 将安全警报映射到可能的 ATT&CK 技术并评分 | | `mitre_technique_overlap` | 查找组织间的技术重叠以进行归因分析 | | `mitre_attack_path` | 生成贯穿 Kill Chain 的可能攻击路径 | ### 攻击活动分析 | Tool | Description | |------|-------------| | `mitre_campaign_profile` | 根据观察到的技术构建技术画像 | ### 数据管理 | Tool | Description | |------|-------------| | `mitre_update_data` | 强制更新本地 ATT&CK 数据缓存 | | `mitre_data_version` | 获取当前数据版本和对象计数 | ## 资源参考 | URI | Description | |-----|-------------| | `mitre://matrix/enterprise` | 完整的 Enterprise ATT&CK 矩阵(战术 × 技术) | | `mitre://version` | 当前数据版本和统计信息 | | `mitre://tactics` | 按 Kill Chain 顺序排列的所有战术 | ## 提示词参考 | Prompt | Description | |--------|-------------| | `map-incident-to-attack` | 将事件观测数据映射到 ATT&CK 技术 | | `threat-hunt-plan` | 生成威胁狩猎计划 | | `gap-analysis` | 执行检测差距分析 | | `attribution-analysis` | 辅助威胁归因分析 | ## 示例 ### 查询一项技术 ``` Use mitre_get_technique with techniqueId "T1059.001" to get PowerShell technique details. ``` ### 查找某战术下的技术 ``` Use mitre_search_techniques with tactic "initial-access" to list all initial access techniques. ``` ### 分析检测覆盖范围 ``` Use mitre_detection_coverage with availableDataSources ["Process", "Network Traffic", "File"] to see what percentage of techniques your environment can detect. ``` ### 剖析攻击活动 ``` Use mitre_campaign_profile with techniques ["T1059.001", "T1566.001", "T1078"] to identify likely threat actors and recommended mitigations. ``` ### 映射警报 ``` Use mitre_map_alert_to_technique with alertType "PowerShell encoded command execution detected" and platform "Windows" to find matching ATT&CK techniques. ``` ## 测试 ``` npm test # Run all tests npm run test:watch # Watch mode npm run lint # Type check ``` ## 项目结构 ``` mitre-mcp/ src/ index.ts # MCP server entry point config.ts # Environment config types.ts # STIX/ATT&CK type definitions resources.ts # MCP resources prompts.ts # MCP prompts data/ loader.ts # STIX bundle downloader and cache manager parser.ts # STIX 2.1 JSON parser index.ts # Indexed, queryable ATT&CK data store tools/ techniques.ts # Technique lookup and search tactics.ts # Tactic navigation groups.ts # Threat group intelligence software.ts # Software/malware lookup mitigations.ts # Mitigation mapping datasources.ts # Data source and detection coverage mapping.ts # Alert-to-technique mapping and correlation campaigns.ts # Campaign analysis management.ts # Data update management tests/ parser.test.ts # STIX parser tests tools.test.ts # Data store query tests mapping.test.ts # Mapping and correlation tests package.json tsconfig.json tsup.config.ts vitest.config.ts README.md ``` ## 数据来源 ATT&CK 数据源自官方 MITRE STIX 2.1 Bundles: - **Enterprise ATT&CK** - 涵盖 Windows、Linux、macOS、Cloud、Network、Containers - **Mobile ATT&CK** - 涵盖 Android 和 iOS - **ICS ATT&CK** - 涵盖工业控制系统 数据在首次运行时下载并在本地缓存。设置 `MITRE_UPDATE_INTERVAL` 以控制服务器检查更新的频率。 ## 许可证 MIT
标签:AI安全, Chat Copilot, Claude Desktop, Cloudflare, DLL 劫持, GNU通用公共许可证, MCP Server, MITM代理, MITRE ATT&CK, Node.js, Ruby, STIX 2.1, TypeScript, 大语言模型, 威胁情报, 安全插件, 开发者工具, 攻击溯源, 模型上下文协议, 知识库, 网络安全, 自动化攻击, 隐私保护