mcpField
C
crowdsentinel-mcp-server

crowdsentinel-mcp-server

本地服务
github.com/thomasxm安全20414 周前更新

关于 crowdsentinel-mcp-server

CrowdSentinel MCP Server 是一个用于 Elasticsearch 与 OpenSearch 的威胁狩猎与事件响应框架,可将 LLM 连接到安全数据。项目目前仅用于安全测试与研究,尚未达到生产就绪。

主要功能

  1. 01通过自然语言进行威胁狩猎
  2. 02内置 IR 方法论的调查提示词
  3. 03跨工具 IoC 关联
  4. 04EVTX、PCAP 与端点取证的多数据源分析
  5. 05独立命令行界面

适用场景

  1. 01在 Elasticsearch 数据上以自然语言开展威胁狩猎
  2. 02使用 Velociraptor 进行实时端点取证
  3. 03分析 PCAP 文件中的信标与横向移动行为

MCP 相关

该项目是一个 MCP 服务,向连接的 AI 代理暴露安全调查工具、提示词与 DFIR 知识资源。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"thomasxm-crowdsentinel": {
"command": "uvx",
"args": [
"crowdsentinel-mcp-server"
],
"env": {
"ELASTICSEARCH_HOSTS": "<ELASTICSEARCH_HOSTS>",
"ELASTICSEARCH_CLOUD_ID": "<ELASTICSEARCH_CLOUD_ID>",
"ELASTICSEARCH_API_KEY": "<ELASTICSEARCH_API_KEY>",
"ELASTICSEARCH_USERNAME": "<ELASTICSEARCH_USERNAME>",
"ELASTICSEARCH_PASSWORD": "<ELASTICSEARCH_PASSWORD>",
"ELASTICSEARCH_BEARER_TOKEN": "<ELASTICSEARCH_BEARER_TOKEN>",
"VERIFY_CERTS": "<VERIFY_CERTS>",
"REQUEST_TIMEOUT": "<REQUEST_TIMEOUT>"
}
}
}
}
启动命令uvx crowdsentinel-mcp-server
需要配置的环境变量
ELASTICSEARCH_HOSTSComma-separated Elasticsearch hosts. Supports HTTP/HTTPS, local/remote/cloud (e.g., http://localhost:9200, https://es.prod.example.com:9200)
ELASTICSEARCH_CLOUD_IDElastic Cloud deployment ID (alternative to ELASTICSEARCH_HOSTS for cloud deployments)
ELASTICSEARCH_API_KEY密钥API key for authentication (recommended for production and Elastic Cloud)
ELASTICSEARCH_USERNAMEUsername for basic authentication (alternative to API key)
ELASTICSEARCH_PASSWORD密钥Password for basic authentication (used with ELASTICSEARCH_USERNAME)
ELASTICSEARCH_BEARER_TOKEN密钥Bearer/service token for authentication (alternative to API key)
VERIFY_CERTSTLS certificate verification: true (verify CA — production), false (skip — dev/test), or /path/to/ca.crt (custom CA)
REQUEST_TIMEOUTRequest timeout in seconds (e.g., 60 or 10.5)

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
pypicrowdsentinel-mcp-server0.6.0

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

CrowdSentinel 标志

CrowdSentinel MCP 服务

AI 驱动的威胁狩猎与事件响应框架

PyPI PyPI Downloads Python License MCP Tools Rules

从 PyPI 安装

MCP 官方注册表 · PyPI 软件包

开源威胁狩猎编排器,通过模型上下文协议(MCP)将大模型连接到企业安全数据

快速开始 · 安装 · CLI 用法 · 功能 · 架构 · 文档 · 示例

警告 本项目正在积极开发中,仅用于安全测试、研究和教育目的。它尚未达到生产就绪状态。请勿部署在生产环境中。API、工具接口和数据格式可能会在不另行通知的情况下发生变化。使用风险自负。


演示

https://github.com/user-attachments/assets/0d0381f0-5b68-43b2-8630-19ec130885b2


什么是 CrowdSentinel?

CrowdSentinel 将传统 SIEM 查询转变为由框架驱动的智能调查流程,支持使用自然语言操作。它作为统一的安全情报层,将大模型连接到企业安全数据源,从而实现:

  • 自然语言威胁狩猎 — 使用通俗英语查询 Elasticsearch
  • AI 引导的调查工作流 — 内置提示词可引导 Agent 遵循正确的事件响应方法
  • 持久化调查状态 — 通过内存管理 IoC 跟踪、取证时间线和跨查询关联,并可跨会话保留(8GB FIFO 存储)
  • 跨工具 IoC 关联 — 在一个工具中发现的 IoC 会自动提供给所有其他工具
  • 多源分析 — Elasticsearch、EVTX 日志(Chainsaw)、PCAP 文件(Wireshark)、实时端点取证(Velociraptor)、本地主机取证(osquery)
  • Velociraptor 端点取证 — 提供 25 个 MCP 工具,用于实时收集工件(进程、网络、持久化、执行证据、NTFS MFT、SRUM、远程 EVTX),并自动提取 IoC
  • 编码命令反混淆 — 自动剥离编码命令中的 base64/UTF-16LE/gzip/hex 层(例如 PowerShell -EncodedCommand),让其中隐藏的 C2 地址作为 IoC 显现
  • 自适应架构智能 — 数据驱动的架构注册表(ECS、Sysmon、Windows Security、auditd、Zeek、Packetbeat、AWS CloudTrail)可根据各索引的字段约定调整威胁狩猎
  • DFIR 知识资源 — 提供 9 个 MCP 资源,直接向已连接的 AI Agent 提供调查手册、痛苦金字塔参考资料和跨关联指南
  • 独立 CLI — 无需 MCP 客户端,即可在终端中进行完整的威胁狩猎

安装

从 PyPI 安装(推荐)
# Install with pip
pip install crowdsentinel-mcp-server

# Or install with uv
uv pip install crowdsentinel-mcp-server

# Download detection rules, Chainsaw, and Sigma rules (one-time)
crowdsentinel setup

# Validate connector configuration and readiness (offline, no external calls)
crowdsentinel doctor

可选额外组件:

# Velociraptor live endpoint forensics (adds 25 MCP tools)
pip install 'crowdsentinel-mcp-server[velociraptor]'

# Long-tail deobfuscation coverage via chepy (XOR, exotic encodings).
# The stdlib decoder core works without this — chepy only extends it.
pip install 'crowdsentinel-mcp-server[deobf]'

检测规则(6,060 条 Lucene + EQL + ES|QL)已随软件包附带——无需下载。setup 命令会下载其他工具:

  • 用于 EVTX 分析的 Chainsaw 二进制文件
  • 3,000 多条供 Chainsaw 使用的 Sigma 规则

下载的工具存储在 ~/.crowdsentinel/ 中,并且在软件包升级后仍会保留。

PCAP 分析的系统依赖项:

# Required for network traffic analysis and cross-tool IoC correlation
sudo apt install tshark    # Debian/Ubuntu/Kali
sudo dnf install wireshark-cli  # Fedora/RHEL
brew install wireshark     # macOS
使用 uvx 直接运行(无需安装)
# Elasticsearch 8.x (default)
uvx crowdsentinel-mcp-server

# Other backends
uvx crowdsentinel-mcp-server-es7   # Elasticsearch 7.x
uvx crowdsentinel-mcp-server-es9   # Elasticsearch 9.x
uvx opensearch-mcp-server          # OpenSearch 1.x/2.x/3.x
从源代码安装
git clone https://github.com/thomasxm/CrowdSentinels-AI-MCP.git
cd CrowdSentinels-AI-MCP
chmod +x setup.sh && ./setup.sh

# Or install everything, including all optional extras (deobf/chepy, velociraptor)
./setup.sh --full

设置脚本将:

  • 安装依赖项(pipx、uv,以及需要时安装 Claude Code CLI)
  • 随包提供 6,060 条检测规则并下载 Chainsaw 二进制文件
  • 提示输入 Elasticsearch 凭据(绝不硬编码)
  • 使用 Claude Code 配置 MCP 服务
  • 验证连接

使用 --full 时,还会安装所有可选额外组件,使全部 139 个 MCP 工具都能使用其依赖项——这是部署可用于生产环境的服务的推荐模式。

安装大小

CrowdSentinel 随包提供 6,060 条检测规则,并集成外部分析工具。以下是完整的磁盘空间明细,便于你做好规划。

核心软件包(通过 pip 或 uvx 安装):

组件大小备注
CrowdSentinel 软件包49 MB服务本身
— 随包附带的 Sigma 规则(src/rules/)30 MB6,060 条预转换的检测规则
— Elastic TOML 规则(src/detection-rules/)17 MB原始 TOML 格式规则和威胁狩猎查询
— Python 代码(客户端、工具等)2 MB实际的应用程序代码
依赖项64 MB所有传递依赖项
— cryptography14 MB最大的依赖项(TLS)
— elasticsearch8.3 MBES Python 客户端
— pygments5.2 MB语法高亮
— pydantic_core5 MB验证引擎
— opensearchpy3.6 MBOpenSearch 客户端
— 其他(27 个软件包)~28 MBmcp、fastmcp、httpx、anthropic 等
核心总计113 MBpip install crowdsentinel-mcp-server

其他工具(通过 crowdsentinel setup 安装):

组件下载大小安装后大小备注
Chainsaw 二进制文件(v2.13.1)~3 MB~15 MBEVTX 日志分析引擎
Sigma 规则(SigmaHQ)~3 MB~30 MB3,000 多条供 Chainsaw 使用的 Sigma 规则
Chainsaw 映射—<1 MB事件日志源映射
设置总计~6 MB~46 MB存储在 ~/.crowdsentinel/ 中

系统依赖项(通过软件包管理器安装):

组件安装后大小安装命令备注
tshark + Wireshark 库~132 MBsudo apt install tsharkPCAP 网络分析——跨工具 IoC 关联分析所必需

完整安装汇总:

场景磁盘空间总计
仅核心组件(pip install)~113 MB
核心组件 + 设置(crowdsentinel setup)~159 MB
完整平台(+ tshark)~291 MB

**注意:**得益于随包附带的检测规则采用压缩格式,PyPI 下载大小仅为 8.9 MB(wheel)。


快速开始

1. 设置环境变量
export ELASTICSEARCH_HOSTS="https://localhost:9200"
export ELASTICSEARCH_API_KEY="your_api_key"
# Or use username/password:
# export ELASTICSEARCH_USERNAME="elastic"
# export ELASTICSEARCH_PASSWORD="your_password"
export VERIFY_CERTS="false"
2. 连接到 MCP 客户端

CrowdSentinel 兼容所有支持 MCP 的 AI Agent。请在下方选择你的客户端:

Claude Code (CLI)
claude mcp add crowdsentinel \
  -e ELASTICSEARCH_HOSTS="https://localhost:9200" \
  -e ELASTICSEARCH_API_KEY="your_api_key" \
  -e VERIFY_CERTS="false" \
  -- uvx crowdsentinel-mcp-server
Claude Desktop

编辑 ~/.config/Claude/claude_desktop_config.json(Linux)或 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS):

{
  "mcpServers": {
    "crowdsentinel": {
      "command": "uvx",
      "args": ["crowdsentinel-mcp-server"],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_API_KEY": "your_api_key",
        "VERIFY_CERTS": "false"
      }
    }
  }
}
VS Code Copilot

在工作区中创建 .vscode/mcp.json:

{
  "servers": {
    "crowdsentinel": {
      "command": "uvx",
      "args": ["crowdsentinel-mcp-server"],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_API_KEY": "your_api_key",
        "VERIFY_CERTS": "false"
      }
    }
  }
}

然后在 VS Code 设置中启用 MCP:"chat.mcp.enabled": true

Cursor

创建或编辑 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "crowdsentinel": {
      "command": "uvx",
      "args": ["crowdsentinel-mcp-server"],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_API_KEY": "your_api_key",
        "VERIFY_CERTS": "false"
      }
    }
  }
}
Roo Code (VS Code Extension)

在工作区中创建 .roo/mcp.json:

{
  "mcpServers": {
    "crowdsentinel": {
      "command": "uvx",
      "args": ["crowdsentinel-mcp-server"],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_API_KEY": "your_api_key",
        "VERIFY_CERTS": "false"
      }
    }
  }
}

或者通过 Roo Code 设置面板进行配置:Settings > MCP Servers > Add Server。

5ire

在 5ire 设置中(v0.15.0+),添加一个 MCP 服务并填写:

  • 命令:uvx
  • 参数:crowdsentinel-mcp-server
  • 环境变量:
    • ELASTICSEARCH_HOSTS = https://localhost:9200
    • ELASTICSEARCH_API_KEY = your_api_key
    • VERIFY_CERTS = false

注意: 5ire v0.14.0 存在已知的 MCP 兼容性问题。请使用 v0.15.0+ 以确保可靠运行。

任何 MCP 客户端(通用)

stdio 传输(默认设置——适用于大多数客户端):

{
  "mcpServers": {
    "crowdsentinel": {
      "command": "uvx",
      "args": ["crowdsentinel-mcp-server"],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_API_KEY": "your_api_key",
        "VERIFY_CERTS": "false"
      }
    }
  }
}

SSE 传输(适用于基于 Web 的客户端):

crowdsentinel-mcp-server --transport sse --port 8001
# Connect to: http://localhost:8001/sse/

HTTP 传输(适用于 REST API 客户端):

crowdsentinel-mcp-server --transport streamable-http --port 8001
# Connect to: http://localhost:8001/mcp/
3. 或直接使用 CLI
# Download rules and tools (one-time)
crowdsentinel setup

# Check cluster health
crowdsentinel health

# Hunt for threats
crowdsentinel hunt "powershell encoded" -i winlogbeat-*

# Run detection rules
crowdsentinel rules -p windows --tactic credential_access
crowdsentinel detect windows_builtin_win_alert_mimikatz_keywords_lucene -i winlogbeat-*

# Analyse PCAP files
crowdsentinel pcap overview capture.pcap
crowdsentinel pcap beaconing capture.pcap

# Hunt EVTX logs with Chainsaw
crowdsentinel chainsaw hunt /path/to/evtx/ --sigma-rules /path/to/sigma/

CLI 用法

CrowdSentinel 提供完整的 CLI,可在终端中进行威胁狩猎:

pip install crowdsentinel-mcp-server
crowdsentinel setup    # Download rules, Chainsaw, Sigma (one-time)
crowdsentinel --help
可用命令
命令描述示例
setup下载检测规则、Chainsaw 和 Sigma 规则crowdsentinel setup
health显示集群运行状况crowdsentinel health
indices列出所有索引crowdsentinel indices
hunt面向 IR 的威胁狩猎并提取 IoCcrowdsentinel hunt "powershell" -i winlogbeat-*
eql执行 EQL 查询crowdsentinel eql "process where process.name == 'cmd.exe'" -i winlogbeat-*
esql执行 ES|QL 查询crowdsentinel esql "FROM logs-* | LIMIT 10"
detect按 ID 执行检测规则crowdsentinel detect win_susp_logon -i winlogbeat-*
rules列出可用的检测规则crowdsentinel rules -p windows --tactic credential_access --type eql
schema检测索引模式对应的架构crowdsentinel schema -i winlogbeat-*
ioc搜寻特定的入侵指标crowdsentinel ioc 203.0.113.42 --type ip -i winlogbeat-*
analyse分析来自标准输入的搜索结果(JSON)cat results.json | crowdsentinel analyse -c "context"
analyse --mcp使用全部 139 个 MCP 工具进行 AI Agent 分析crowdsentinel hunt "query" | crowdsentinel analyse --mcp -c "context"
auth管理 Agent 模式的 LLM 身份验证crowdsentinel auth login
pcap分析 PCAP 文件(概览、信标活动、横向移动)crowdsentinel pcap beaconing capture.pcap
chainsaw使用 Chainsaw 和 Sigma 规则搜寻 EVTX 日志crowdsentinel chainsaw hunt /path/to/evtx/
doctor验证连接器配置和就绪状态(离线——不进行外部调用)crowdsentinel doctor
输出格式

所有命令均支持通过 --output/-o 指定以下三种格式:

crowdsentinel hunt "failed login" -i winlogbeat-* -o json     # Structured JSON (default)
crowdsentinel hunt "failed login" -i winlogbeat-* -o table    # Human-readable table
crowdsentinel hunt "failed login" -i winlogbeat-* -o summary  # Condensed summary
Agent 模式(--mcp)

analyse --mcp 标志会使用可自主调用全部 139 个 MCP 工具进行调查的 AI Agent,取代确定性分析。该 Agent 遵循 4 阶段 IR 方法:搜寻、分析、关联、报告。

身份验证:

# Option 1: Browser sign-in (ChatGPT subscription — no API billing)
crowdsentinel auth login

# Option 2: Anthropic (setup-token or API key)
crowdsentinel auth login --provider anthropic

# Option 3: Environment variable
export ANTHROPIC_API_KEY="sk-ant-..."   # or OPENAI_API_KEY

# Option 4: Local models (Ollama, vLLM — free)
crowdsentinel analyse --mcp --model-url http://localhost:11434/v1 --model llama3.1

# Check auth status
crowdsentinel auth status

Agent 标志:

标志默认值说明
--mcp关闭启用带 MCP 工具的 AI Agent
--mcp-server NAME:CMD无添加外部 MCP 服务(例如 VirusTotal)
--model自动检测要使用的大模型
--model-url无OpenAI 兼容的 API 端点
--max-steps30工具调用次数上限
--timeout300最大秒数
流水线示例

确定性分析(无需 API 密钥):

# Hunt then analyse
crowdsentinel hunt "powershell encoded" -i winlogbeat-* -o json | \
  crowdsentinel analyse -c "Encoded PowerShell commands" -o summary

# Investigate failed authentication attempts
crowdsentinel hunt "event.code:4625" -i winlogbeat-* -o json | \
  crowdsentinel analyse -c "Failed login brute force investigation" -o summary

# Triage process execution and privilege escalation
crowdsentinel hunt "event.code:4688 OR event.code:4672 OR event.code:1" -i winlogbeat-* -o json | \
  crowdsentinel analyse -c "Process execution and privilege escalation" -o summary

AI Agent 调查(需要身份验证):

# Credential dumping investigation — agent hunts, analyses kill chain, checks adjacent stages
crowdsentinel hunt "mimikatz OR lsass OR procdump" -i winlogbeat-* -o json | \
  crowdsentinel analyse --mcp -c "Credential dumping tools investigation" --max-steps 15 -o summary

# Encoded PowerShell — full IR workflow with kill chain and adjacent stage hunting
crowdsentinel hunt "powershell -enc OR FromBase64String" -i winlogbeat-* -o json | \
  crowdsentinel analyse --mcp -c "Full IR workflow: encoded PowerShell" --max-steps 30 -o table

# Process execution with detection rules
crowdsentinel hunt "event.code:4688" -i winlogbeat-* -o json | \
  crowdsentinel analyse --mcp -c "Execute detection rules against process creation" --max-steps 20 -o summary

# PCAP beaconing — agent generates IoCs and maps to kill chain
crowdsentinel pcap beaconing capture.pcap -o json | \
  crowdsentinel analyse --mcp -c "Investigate beaconing for C2 infrastructure" --max-steps 10 -o summary

# Anti-forensics investigation
crowdsentinel hunt "event.code:1102" -i winlogbeat-* -o json | \
  crowdsentinel analyse --mcp -c "Security log cleared - anti-forensics" --max-steps 10 -o summary

# With external MCP server (e.g., VirusTotal)
crowdsentinel hunt "powershell" -i winlogbeat-* -o json | \
  crowdsentinel analyse --mcp --mcp-server "vt:uvx virustotal-mcp-server" \
  -c "Check IoCs against VirusTotal" -o summary

主要功能

139 个 MCP 工具

威胁搜寻、检测规则、取证、端点收集、网络分析、交叉关联、命令反混淆和 IoC 丰富化——均可通过自然语言调用

6,060 条检测规则

预置 Lucene、EQL 和 ES|QL 规则,并自动映射到 MITRE ATT&CK

调查状态

跨工具和会话持久跟踪 IoC,支持跨来源关联和 FIFO 存储

4 个安全框架
  • 网络杀伤链(7 个阶段)
  • 痛苦金字塔(6 个级别)
  • 钻石模型(4 个顶点)
  • MITRE ATT&CK(自动映射)
5 种数据源 + 威胁情报
  • Elasticsearch / OpenSearch(SIEM)
  • Velociraptor(实时端点取证)
  • osquery(本地主机取证)
  • EVTX 日志(Chainsaw + Sigma)
  • PCAP 文件(Wireshark/TShark)
  • IoC 丰富化(Shodan、VirusTotal、AbuseIPDB、ThreatFox)
  • MISP(导出事件、搜索属性)

架构

┌─────────────────────────────────────────────────────────────────┐
│                 LLM Client / Claude Code CLI                    │
└─────────────────────────────┬───────────────────────────────────┘
                              │ MCP Protocol (stdio/SSE/HTTP)
                              │ HTTP: Origin validation (anti DNS-rebinding)
                              │       + transport-level audit logging
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    CrowdSentinel MCP Server                     │
│  ┌───────────────┐ ┌───────────────┐ ┌───────────────────────┐  │
│  │  139 Tools    │ │ 6,060 Rules   │ │ Security Frameworks   │  │
│  │ - Hunting     │ │ - Lucene      │ │ - Cyber Kill Chain    │  │
│  │ - Detection   │ │ - EQL         │ │ - Pyramid of Pain     │  │
│  │ - Forensics   │ │ - ES|QL       │ │ - Diamond Model       │  │
│  │ - Endpoint    │ │               │ │ - MITRE ATT&CK        │  │
│  │ - Network     │ ├───────────────┤ │                       │  │
│  │ - Enrichment  │ │ Schema        │ │ 9 MCP Resources       │  │
│  │ - Correlation │ │ Registry      │ │ (DFIR knowledge base) │  │
│  │ - Deobfuscate │ │ (data-driven) │ │                       │  │
│  └───────────────┘ └───────────────┘ └───────────────────────┘  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │              Investigation State (Persistent)               ││
│  │    Cross-source IoC sharing, auto-capture, STIX 2.1 export  ││
│  └─────────────────────────────────────────────────────────────┘│
└─────┬──────────┬──────────┬──────────────┬─────────────┬────────┘
      │          │          │              │             │
      ▼          ▼          ▼              ▼             ▼
┌───────────┐ ┌──────────┐ ┌────────┐ ┌───────────┐ ┌───────────┐
│Elastic-   │ │Velocirap-│ │osquery │ │ Chainsaw  │ │ Wireshark │
│search/    │ │tor       │ │(local  │ │(EVTX/     │ │  (PCAP)   │
│OpenSearch │ │(EDR/DFIR)│ │ host)  │ │ Sigma)    │ │ (Network) │
│  (SIEM)   │ │(Endpoint)│ │        │ │(Offline)  │ │           │
└───────────┘ └──────────┘ └────────┘ └───────────┘ └───────────┘
                          │
  ┌───────────────────────┼───────────────────────┐
  ▼                       ▼                       ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────────────────┐
│ Shodan        │ │  VirusTotal   │ │  AbuseIPDB + ThreatFox    │
│ InternetDB    │ │     (v3)      │ │  + MISP (export/search)   │
│  (free/no key)│ │  (free tier)  │ │  (free tier)              │
└───────────────┘ └───────────────┘ └───────────────────────────┘
                          │
                          ▼ (Roadmap)
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│    Splunk     │ │     Wazuh     │ │     Zeek      │
│               │ │  (EDR/XDR)    │ │   (NSM/IDS)   │
└───────────────┘ └───────────────┘ └───────────────┘

包含内容

工具类别(139 个工具)
类别工具数说明
Elasticsearch 核心19索引、文档、集群、别名、数据流、原始 API 操作
威胁搜寻8攻击模式检测、杀伤链阶段搜寻、时间范围搜寻、异常检测
EQL 和 ES|QL 搜寻11事件序列查询、ES|QL 管道、已保存的搜寻历史、功能检测
资产发现与架构智能12索引发现、数据驱动的架构检测(ECS、Sysmon、auditd、Zeek、CloudTrail……)、智能搜索
IoC 分析与反混淆6IoC 提取、编码命令解码、杀伤链映射、调查报告
检测规则96,060 条规则库——列出、执行、验证、建议、批量执行
调查提示词5快速分诊主线——10 个关键 IR 问题
Chainsaw(EVTX)5Sigma 规则搜寻、迭代式 IoC 发现
Wireshark(PCAP)11网络取证、信标检测、横向移动检测、流量解码
威胁情报5IoC 丰富化(Shodan、VirusTotal、AbuseIPDB、ThreatFox)+ MISP 导出/搜索
调查状态10持久化 IoC、跨工具共享、STIX 2.1 导出、报告
Velociraptor(端点)25实时取证制品收集——进程、网络、持久化、执行证据、MFT、SRUM
osquery(本地主机)4基于 SQL 的本地主机取证——进程、套接字、用户、临时查询
跨来源关联5SIEM ↔ 端点切换、基于 IoC 的端点搜寻、统一时间线、时间关联
工作流指引与状态4后续步骤指引、渐进式披露、系统状态、存储清理

设置 VELOCIRAPTOR_API_CONFIG 后会注册 Velociraptor 工具;检测到本地 osqueryi 二进制文件后会注册 osquery 工具;当 DISABLE_HIGH_RISK_OPERATIONS=true 时,会隐藏 10 个高风险写入工具。

安全框架
框架用途
Cyber Kill Chain按攻击阶段(7 个阶段)开展威胁狩猎,预测对手的下一步行动
Pyramid of Pain根据 IoC 对攻击者而言的更改难度进行优先级排序(6 个级别)
Diamond Model绘制对手、能力、基础设施和受害者之间的关系
MITRE ATT&CK为所有检测自动映射技术
检测规则(6,060 条规则)
类型数量来源说明
Lucene1,966Sigma 转换而来快速模式匹配查询
EQL3,963Sigma 转换而来 + Elastic事件序列和关联分析
ES|QL131Elastic TOML 规则基于管道的查询语言(ES 8.11+)

**平台:**Windows、Linux、macOS、云(AWS/Azure/GCP)、网络、身份

**日志来源:**PowerShell、Sysmon、安全事件、进程创建、审计日志

编码命令去混淆

真实入侵会将 C2 地址和 URL 藏在 SIEM 原样存储的编码内容中,最常见的是 PowerShell -EncodedCommand(UTF-16LE 的 base64 编码),但也包括 FromBase64String、base64→gzip、裸 base64 和十六进制数据块。CrowdSentinel 会在 IoC 提取期间以及通过专用的 decode_command 工具自动解码这些层,让内部指标显现出来,而不是继续深埋其中:

  • 无需额外依赖——解码器核心仅使用 Python 标准库(base64/zlib/codecs/binascii)
  • 可选的扩展支持——安装 deobf 扩展(pip install 'crowdsentinel-mcp-server[deobf]')即可添加 chepy,支持 XOR 和少见的编码方式;未安装时也会优雅降级
  • 来源记录——每次解码都会记录所用方法(例如 base64->utf-16le),用于 IR 报告
  • 安全设计——仅解码(不会执行任何内容),并限制解码深度和输出大小,避免解压炸弹导致服务挂起

配置

环境变量
# Connection (required — choose one)
ELASTICSEARCH_HOSTS="https://localhost:9200"       # Self-hosted
# OR
ELASTICSEARCH_CLOUD_ID="deployment:base64..."      # Elastic Cloud

# Authentication — choose one (in priority order):
ELASTICSEARCH_BEARER_TOKEN="service_token_here"    # Service/bearer token
ELASTICSEARCH_API_KEY="your_api_key"               # API key (recommended)
ELASTICSEARCH_USERNAME="elastic"                   # Basic auth
ELASTICSEARCH_PASSWORD="your_password"

# TLS / Certificate verification
VERIFY_CERTS="true"                                # Verify against system CA bundle
# VERIFY_CERTS="/path/to/ca.crt"                   # Verify against custom CA certificate
# ELASTICSEARCH_CA_CERT="/path/to/ca.crt"          # Explicit CA certificate path
# ELASTICSEARCH_CLIENT_CERT="/path/to/client.crt"  # Client certificate (mTLS)
# ELASTICSEARCH_CLIENT_KEY="/path/to/client.key"   # Client private key (mTLS)

# Options
REQUEST_TIMEOUT="30"                               # Request timeout in seconds
DISABLE_HIGH_RISK_OPERATIONS="true"                # Block all write operations

# HTTP/SSE transport security (stdio unaffected)
# MCP_ALLOWED_ORIGINS="https://app.example.com"    # Extra allowed Origins (comma-separated); loopback always allowed

# Velociraptor endpoint forensics (optional — enables 25 extra tools)
# VELOCIRAPTOR_API_CONFIG="/path/to/api_client.yaml"

# Threat Intelligence (optional — Shodan InternetDB works without any key)
VIRUSTOTAL_API_KEY="your_vt_key"                   # Free: 500 lookups/day
ABUSEIPDB_API_KEY="your_abuse_key"                 # Free: 1,000 lookups/day
THREATFOX_API_KEY="your_tf_key"                    # Free: unlimited

# MISP Integration (optional — offline JSON export works without a server)
MISP_URL="https://misp.example.org"                # MISP instance URL
MISP_API_KEY="your_misp_key"                       # MISP API key (40-char hex)
# MISP_SSL_VERIFY="true"                           # Set "false" for self-signed (dev only)

**安全警告:**生产环境中切勿使用 VERIFY_CERTS="false" 或明文密码。请使用 API 密钥或服务令牌,并启用 TLS 证书验证。对于自签名证书,请将 ELASTICSEARCH_CA_CERT 设置为 CA 证书路径。

生产环境配置示例
Elastic Cloud
ELASTICSEARCH_CLOUD_ID="my-deployment:dXMtY2VudHJhbC0x..."
ELASTICSEARCH_API_KEY="your_cloud_api_key"
VERIFY_CERTS="true"
使用自定义 CA 的自托管配置
ELASTICSEARCH_HOSTS="https://es-cluster.internal:9200"
ELASTICSEARCH_API_KEY="your_api_key"
ELASTICSEARCH_CA_CERT="/etc/elasticsearch/certs/ca.crt"
VERIFY_CERTS="true"
双向 TLS(mTLS)
ELASTICSEARCH_HOSTS="https://es-cluster.internal:9200"
ELASTICSEARCH_CA_CERT="/etc/elasticsearch/certs/ca.crt"
ELASTICSEARCH_CLIENT_CERT="/etc/elasticsearch/certs/client.crt"
ELASTICSEARCH_CLIENT_KEY="/etc/elasticsearch/certs/client.key"
VERIFY_CERTS="true"
开发 / 测试(不安全)
ELASTICSEARCH_HOSTS="http://localhost:9200"
ELASTICSEARCH_USERNAME="elastic"
ELASTICSEARCH_PASSWORD="test123"
VERIFY_CERTS="false"

此配置不适用于生产环境。生产环境中请使用启用 TLS 的 API 密钥。

传输模式
模式使用场景命令
stdio(默认)MCP 客户端(Claude Code 等)由 setup.sh 自动配置
SSEWeb / 流式客户端--transport sse --port 8000
HTTPREST API 访问--transport streamable-http

HTTP 传输在传输层进行了加固:

  • 来源验证(防 DNS 重绑定)——除非浏览器请求的 Origin 为回环地址或列在 MCP_ALLOWED_ORIGINS 中(以逗号分隔;单独使用 * 可禁用检查),否则会被拒绝。不含 Origin 标头的请求(即所有非浏览器 MCP 客户端)不受影响。
  • 审计日志——每次 HTTP 交互都会在传输边界记录日志(JSON-RPC 方法、工具名称、正文大小、路径),包括工具层无法看到的请求,例如未知工具或协议错误。日志仅包含元数据、内存占用有界,并经过处理以防日志伪造。
禁用写操作

对于只读访问(生产环境推荐):

DISABLE_HIGH_RISK_OPERATIONS="true"

这会隐藏具有破坏性的工具:create_index、delete_index、index_document、delete_document、delete_by_query、create_data_stream、delete_data_stream、put_alias、delete_alias、general_api_request


使用示例

示例 1:搜寻暴力破解攻击
You: Hunt for brute force attacks in the last hour

CrowdSentinel: Searching for failed authentication attempts...
[Calls hunt_by_timeframe with attack_types=["brute_force"]]

Found 47 failed login attempts from 3 source IPs targeting the "admin" account.
Top sources:
- 192.168.1.105: 28 attempts
- 10.0.0.42: 15 attempts
- 172.16.0.8: 4 attempts
示例 2:调查可疑主机
You: Show me all activity on host DESKTOP-ABC123 in the last 24 hours

CrowdSentinel: Generating a forensic timeline for that host...
[Calls get_host_activity_timeline]

Timeline shows:
- 09:15: User "jsmith" logged in (Event 4624)
- 09:17: PowerShell executed encoded command
- 09:18: New scheduled task created "WindowsUpdate"
- 09:22: Outbound connection to 203.0.113.42:443
- 09:25: LSASS memory access detected
示例 3:攻击链分析
You: We found C2 beaconing. What should we hunt for next?

CrowdSentinel: Hunting adjacent kill chain stages...
[Calls hunt_adjacent_stages with current_stage="COMMAND_AND_CONTROL"]

Looking backwards (Installation stage):
- Found scheduled task persistence on 3 hosts
- Registry Run key modifications detected

Looking forwards (Actions on Objectives):
- Lateral movement to 2 additional hosts via SMB
- Credential dumping attempts detected
示例 4:网络流量分析
You: Analyse this PCAP for C2 beaconing

CrowdSentinel: Checking for regular connection intervals...
[Calls detect_beaconing on the PCAP file]

Detected beaconing pattern:
- Host: 192.168.1.50 → 203.0.113.100:443
- Interval: 60 seconds (±2s jitter)
- Duration: 4 hours
- Confidence: HIGH

Recommend blocking 203.0.113.100 and investigating 192.168.1.50.
示例 5:通过 CLI 搜寻威胁
# Hunt for encoded PowerShell
crowdsentinel hunt "powershell -enc" -i winlogbeat-* --timeframe 1440 -o json

# Pipe results to analysis
crowdsentinel hunt "event.code:4625" -i winlogbeat-* -o json | \
  crowdsentinel analyse -c "Failed authentication investigation"

# Search detection rules for lateral movement
crowdsentinel rules --tactic lateral_movement -p windows

兼容性

软件包后端安装
crowdsentinel-mcp-serverElasticsearch 8.x(默认)pip install crowdsentinel-mcp-server
crowdsentinel-mcp-server-es7Elasticsearch 7.xpip install crowdsentinel-mcp-server-es7
crowdsentinel-mcp-server-es9Elasticsearch 9.xpip install crowdsentinel-mcp-server-es9
opensearch-mcp-serverOpenSearch 1.x、2.x、3.xpip install opensearch-mcp-server

面向开发者

项目结构
crowdsentinel-mcp-server/
├── src/
│   ├── server.py                 # MCP server entry point
│   ├── version.py                # Version constant
│   ├── risk_config.py            # Write operation controls
│   ├── transport_security.py     # Origin validation for HTTP transports (anti DNS-rebinding)
│   ├── transport_audit.py        # Transport-level audit logging (every HTTP exchange)
│   │
│   ├── cli/                      # Standalone CLI
│   │   └── main.py               # CLI entry point (argparse) — 15 commands incl. doctor
│   │
│   ├── agent/                    # `analyse --mcp` AI agent mode (multi-provider LLM auth)
│   ├── config/                   # Connector configuration
│   │
│   ├── clients/                  # Backend logic layer
│   │   ├── base.py               # Base client, authentication
│   │   ├── exceptions.py         # Exception handling decorators
│   │   └── common/
│   │       ├── client.py         # Unified SearchClient (multiple inheritance)
│   │       ├── threat_hunting.py # Threat hunting queries
│   │       ├── ioc_analysis.py   # IoC extraction & analysis
│   │       ├── deobfuscate.py    # Encoded-command decoding (stdlib core + optional chepy)
│   │       ├── cyber_kill_chain.py # Kill chain logic
│   │       ├── rule_loader.py    # Detection rule loading
│   │       ├── chainsaw_client.py # EVTX/Sigma integration
│   │       ├── osquery_client.py # Local osquery execution (sqlglot-validated SQL)
│   │       ├── misp_client.py    # MISP export/search
│   │       ├── threat_intel.py   # Shodan/VirusTotal/AbuseIPDB/ThreatFox enrichment
│   │       └── schemas/          # Data-driven schema registry
│   │           ├── ecs.py, sysmon.py, windows_security.py, auditd.py
│   │           └── defs/         # JSON schema defs (zeek, packetbeat, aws_cloudtrail, …)
│   │
│   ├── tools/                    # MCP tool interfaces (25 modules, 139 tools)
│   │   ├── register.py           # Dynamic tool registration
│   │   ├── threat_hunting.py     # Hunting tool definitions
│   │   ├── rule_management.py    # Rule management tools
│   │   ├── velociraptor_tools.py # Live endpoint forensics (25 tools)
│   │   ├── osquery_tools.py      # Local host forensics (4 tools)
│   │   ├── cross_correlation.py  # SIEM ↔ endpoint correlation (5 tools)
│   │   ├── chainsaw_hunting.py   # Chainsaw tools
│   │   ├── wireshark_tools.py    # Network analysis tools
│   │   ├── threat_intel.py       # Enrichment + MISP tools
│   │   └── investigation_state_tools.py # State management tools
│   │
│   ├── storage/                  # Persistent investigation state
│   │   ├── investigation_state.py # Core state management
│   │   ├── storage_manager.py    # File system storage (8GB FIFO)
│   │   └── models.py             # Pydantic models (IoC, Investigation)
│   │
│   ├── utils/                    # Shared utilities
│   │
│   └── wireshark/                # Network traffic analysis
│       ├── core/                 # TShark execution, PCAP parsing
│       ├── hunting/              # Beaconing, lateral movement, IoC hunting
│       ├── baseline/             # Traffic baseline creation
│       ├── extraction/           # File carving from traffic
│       └── reporting/            # NCSC-style reports, timelines
│
├── rules/                        # 6,060 detection rules (EQL + Lucene)
├── chainsaw/                     # Chainsaw binary + 3,000+ Sigma rules
├── skills/                       # Claude Code agent skills
├── Makefile                      # Test pyramid + release automation
└── tests/                        # Tiered test suite (unit / integration / api / e2e / system)
设计模式
模式用途
多重继承SearchClient 组合所有专用客户端
装饰器通过 @handle_exceptions 处理异常
工厂create_search_client() 创建合适的客户端
插件架构通过 ToolsRegister 动态注册工具
自动捕获自动分析工具结果以查找 IoC
添加新工具
  1. 创建客户端方法,位于 src/clients/common/your_module.py:
class YourClient(SearchClientBase):
    def your_method(self, param: str) -> dict:
        # Implementation
        return results
  1. 添加到 SearchClient,位于 src/clients/common/client.py:
class SearchClient(YourClient, OtherClients, ...):
    pass
  1. 创建工具封装,位于 src/tools/your_tools.py:
class YourTools:
    def __init__(self, client, mcp):
        self.client = client
        self.mcp = mcp

    def register_tools(self):
        @self.mcp.tool()
        def your_tool(param: str) -> str:
            """Tool description for LLM."""
            result = self.client.your_method(param)
            return json.dumps(result)
  1. 在服务中注册,位于 src/server.py:
from src.tools.your_tools import YourTools

def _register_tools(self):
    # ... existing tools ...
    YourTools(self.client, self.mcp).register_tools()
运行测试

测试套件采用自底向上的金字塔结构(参见 tests/README.md):先运行独立的单元测试,再运行实时测试层级;后者会启动真实的 Elasticsearch(通过 testcontainers)和真实的 MCP 服务。

make test-unit          # fast hermetic loop (default developer command)
make coverage           # unit tier + coverage policy gate
make check-tests        # policy: every new function vs origin/main has a test
make test-integration   # real ES via testcontainers (Docker required)
make test-api           # + real MCP server subprocess over streamable-http
make test-e2e           # + real MCP client journey over the wire
make test-suite         # the whole pyramid, bottom-up, with a summary table
层级验证内容支撑服务
单元函数级行为、快速失败验证无(独立运行)
集成应用与 Elasticsearch 之间的信任边界(身份验证、TLS、预置数据)通过 testcontainers 运行真实 ES
API基于 HTTP 的 MCP 合约(架构、错误、Origin 安全、审计日志)真实 ES + 真实服务子进程
E2E通过真实 MCP 客户端完成完整分析师工作流程真实 ES + 真实服务 + fastmcp.Client
系统针对你自己的范围集群运行完整流水线自备 Elasticsearch

实时测试层级需选择加入(--run-integration / --run-api / --run-e2e / --run-system),因此直接运行 pytest tests/ 仍然快速且独立。

本地测试环境
# Start Elasticsearch
docker-compose -f docker-compose-elasticsearch.yml up -d

# Start OpenSearch
docker-compose -f docker-compose-opensearch.yml up -d

默认凭据(仅用于测试):

  • Elasticsearch:elastic / test123
  • OpenSearch:admin / admin

路线图

功能状态描述
Velociraptor 集成已完成通过 Velociraptor API 提供 25 个实时端点取证工具和 5 个跨源关联工具
osquery 集成已完成基于 SQL 的本地主机取证(进程、套接字、用户、临时查询)
Encoded-Command 反混淆已完成恢复隐藏在 base64/UTF-16LE/gzip/hex 编码命令中的 IoC(可选使用 chepy 处理其他少见情况)
威胁情报丰富已完成通过 Shodan InternetDB、VirusTotal、AbuseIPDB、ThreatFox 丰富 IoC,并支持导出 STIX 2.1
MISP 集成已完成将调查 IoC 导出为 MISP 事件,搜索 MISP 属性(无需服务端的离线 JSON 导出)
Zeek 集成部分完成通过数据驱动的架构注册表对索引到 ES 的 Zeek 日志进行威胁搜寻;计划原生集成 NSM
Wazuh 集成计划中开源 EDR/XDR——其索引器基于 OpenSearch,因此 CrowdSentinel 现有的 OpenSearch 客户端可以搜寻 Wazuh 警报和 Agent 遥测数据
Splunk 集成计划中在 Elasticsearch 之外添加 Splunk 作为数据源
Sigma 规则转换器计划中将 Sigma 规则转换为原生 ES/Splunk 查询
案例管理计划中将调查导出到 TheHive、JIRA
自定义规则构建器计划中通过自然语言创建检测规则

详细版本历史请参阅 CHANGELOG.md。


Velociraptor 集成(实时端点取证)

CrowdSentinel 集成了 Velociraptor,用于实时收集端点取证 artefact。完成配置后,即可使用另外 25 个 MCP 工具和 5 个跨源关联工具。

设置
# Install optional dependencies
pip install crowdsentinel-mcp-server[velociraptor]

# Set the Velociraptor API config path
export VELOCIRAPTOR_API_CONFIG="/path/to/api_client.yaml"

API 客户端配置由 Velociraptor 服务端生成:

velociraptor config api_client --name crowdsentinel --role administrator,api \
  --config server.config.yaml /path/to/api_client.yaml
可用工具
类别工具用途
发现velociraptor_client_info、velociraptor_list_clients、velociraptor_list_artifacts解析主机名、枚举已注册的端点、发现可用 artefact
通用采集velociraptor_collect_artifact、velociraptor_get_collection_results采集任意 Velociraptor artefact 并获取其结果
实时状态velociraptor_pslist、velociraptor_netstat、velociraptor_users、velociraptor_groups、velociraptor_mounts正在运行的进程、活动网络连接、账户、组、已挂载卷
执行证据velociraptor_prefetch、velociraptor_amcache、velociraptor_shimcache、velociraptor_userassist、velociraptor_bam、velociraptor_srum程序执行和资源使用的取证证据
持久化velociraptor_services、velociraptor_scheduled_tasks、velociraptor_autoruns服务、计划任务和自动运行持久化机制
用户活动velociraptor_shellbags、velociraptor_recentdocs、velociraptor_lnk、velociraptor_evidence_of_download用户浏览活动、文档访问、快捷方式文件、文件下载
文件系统与日志velociraptor_ntfs_mft、velociraptor_evtx按名称/路径/时间戳搜索 MFT,远程查询 EVTX
跨源关联correlate_siem_with_endpoint、endpoint_to_siem_pivot、endpoint_hunt_from_ioc、correlate_by_time、build_unified_timeline在端点上验证 SIEM 发现,从端点 IoC 跳转到全网范围的 SIEM 搜索,构建统一时间线
跨源 IoC 共享

从 Velociraptor artefact 中提取的 IoC 会与 SIEM、Chainsaw 和 Wireshark 的发现一同自动纳入当前调查。使用 get_shared_iocs 获取合并后的指标集,以进行跨源关联。

SIEM (Elasticsearch)          Endpoint (Velociraptor)
       │                              │
  hunt_by_timeframe()         velociraptor_pslist()
       │                              │
  auto_capture ──────► Investigation State ◄────── auto_capture
                              │
                     get_shared_iocs()
DFIR 知识资源

9 个 MCP 资源可将结构化调查参考数据直接提供给已连接的 AI Agent:

资源内容
crowdsentinel://investigation-workflow强制执行的 4 阶段 IR 工作流
crowdsentinel://ioc-reference按痛苦金字塔排列的 IoC 类型
crowdsentinel://ioc-reference/data机器可读的 IoC 参考数据
crowdsentinel://cross-correlation-playbooks5 个调查手册(可疑进程、暴力破解、横向移动、持久化、数据外传)
crowdsentinel://velociraptor-guide工件参考表和“在 SIEM 中发现 X → 在端点上检查 Y”决策树
crowdsentinel://data-sources所有数据源的功能和调查决策矩阵
crowdsentinel://tool-recommendations调查各步骤应使用的工具
crowdsentinel://schemas支持的日志源架构(ECS、Sysmon、Windows Security、auditd、Zeek,……)
crowdsentinel://schemas/list机器可读的架构列表

文档

用户指南
文档描述
FIRST_TIME_SETUP.md首次设置的详细说明
HOW_TO_USE.md全面的使用指南
QUICK_START.md5 分钟快速入门
TRANSPORT_MODES.mdstdio、SSE、HTTP 配置
功能指南
文档描述
THREAT_HUNTING_GUIDE.md威胁狩猎工作流
DETECTION_RULES_GUIDE.md使用 6,060 条检测规则
CYBER_KILL_CHAIN_GUIDE.md杀伤链分析
CHAINSAW_GUIDE.md使用 Sigma 分析 EVTX 日志
INVESTIGATION_PROMPTS_GUIDE.md快速分诊主线
AI_AGENT_INTEGRATION.md面向 AI Agent 的工作流指南
开发者指南
文档描述
ARCHITECTURE.md详细的架构文档
CONTRIBUTING.md贡献指南

贡献

欢迎贡献!请参阅 CONTRIBUTING.md 了解相关指南。


许可证

GNU 通用公共许可证 v3.0 — 详情请参阅 LICENSE。


网络靶场

CrowdSentinel 随附配套项目 crowdsentinel-range —— 这是一个完全临时的 AWS 实验室,可生成带有真实情况标签的攻击遥测数据,让你调查真实检测结果,而非合成数据。

当前靶场(v1)—— 2 主机 AWS 实验室
┌──────────────────────────── AWS VPC (private subnet) ────────────────────────────────┐
│                                                                                        │
│  ┌──────────────────────────────┐      ┌──────────────────────────────────────────┐  │
│  │   Linux SIEM (Ubuntu 22.04)  │      │   Windows Range Box (Server 2022)        │  │
│  │   Elasticsearch 8.x (TLS)   │◄─────│   Sysmon (olafhartong) + Winlogbeat 9    │  │
│  │   Auditbeat + Filebeat       │      │   Atomic Red Team + PurpleSharp          │  │
│  └──────────────────────────────┘      └──────────────────────────────────────────┘  │
│                         SSM VPC endpoints — no inbound ports open                     │
└───────────────────────────────────────┬────────────────────────────────────────────--┘
                                         │ SSM port-forward :19200
                              ┌──────────▼──────────────────────┐
                              │  ./range-mcp.sh → CrowdSentinel │
                              │  MCP Server → Claude Code       │
                              └─────────────────────────────────┘

只需 3 条命令,即可从零开始进行威胁狩猎:

cd crowdsentinel-range && make up && make attack-windows
cd .. && ./range-mcp.sh
# then in Claude Code: /mcp → "investigate potential intrusions on the windows machine"

演示:约 40 秒内完成 73,328 个事件的分诊 —— 解码 2 个 shellcode 载荷,从原始字节中提取 C2 IP,并生成包含 19 种 MITRE 技术的完整 IR 报告。


未来范围(v2)——企业 AD 环境

下一代靶场旨在实现完整覆盖 Active Directory 攻击链:初始访问 → 横向移动 → 域失陷,并加入网络安全监控层、运行时安全检测、集中式漏洞管理和欺骗基础设施。设计灵感来自 DetectionLab、Ludus 和 SimuLand。

┌───────────────────────────────────── AWS / Multi-VPC ───────────────────────────────────────────────────┐
│                                                                                                           │
│  ┌──── Attacker Subnet ────┐   ┌───────────── Corporate Subnet ──────────────────────────────────────┐  │
│  │                          │   │                                                                       │  │
│  │  Kali Linux (C2 server)  │   │  ┌─────────────────┐  ┌──────────────────┐  ┌──────────────────┐  │  │
│  │  Caldera + Metasploit    │   │  │  Domain          │  │  Windows 11      │  │  Windows 11      │  │  │
│  │  Covenant C2             │──▶│  │  Controller      │  │  Workstation 1   │  │  Workstation 2   │  │  │
│  │                          │   │  │  (AD DS, DNS)    │  │  (domain-joined) │  │  (domain-joined) │  │  │
│  └──────────────────────────┘   │  └─────────────────┘  └──────────────────┘  └──────────────────┘  │  │
│                                  │  ┌──────────────────────────────────────────────────────────────┐  │  │
│  ┌──── DMZ Subnet ─────────┐    │  │   Linux File/Web Server (IIS / Apache, SMB share)            │  │  │
│  │                          │    │  └──────────────────────────────────────────────────────────────┘  │  │
│  │  Nginx reverse proxy     │    └───────────────────────────────────────────────────────────────────┘  │
│  │  Simulated internet SVC  │                                                                            │
│  └──────────────────────────┘   ┌───────────── Management / SIEM Subnet ──────────────────────────┐    │
│                                  │                                                                   │    │
│                                  │  ┌─────────────────────┐   ┌───────────────────────────────┐   │    │
│                                  │  │  Elasticsearch +     │   │  Zeek / Suricata              │   │    │
│                                  │  │  Kibana (SIEM)       │   │  (NSM — full packet + alerts) │   │    │
│                                  │  └─────────────────────┘   └───────────────────────────────┘   │    │
│                                  │  ┌─────────────────────┐   ┌───────────────────────────────┐   │    │
│                                  │  │  Velociraptor        │   │  Falco (runtime security)     │   │    │
│                                  │  │  (live EDR/forensics)│   │  eBPF probe (CO-RE, default)  │   │    │
│                                  │  └─────────────────────┘   │  + kernel module fallback     │   │    │
│                                  │  ┌─────────────────────┐   └───────────────────────────────┘   │    │
│                                  │  │  DefectDojo          │   ┌───────────────────────────────┐   │    │
│                                  │  │  (vuln management)   │   │  Honeypots + Canary tokens     │   │    │
│                                  │  │  Falco·Zeek·scanners │   │  (deception layer)             │   │    │
│                                  │  └─────────────────────┘   └───────────────────────────────┘   │    │
│                                  │  ┌─────────────────────────────────────────────────────────┐   │    │
│                                  │  │  Grafana — centralized dashboards + alerting             │   │    │
│                                  │  │  ES · Falco · Suricata · Velociraptor · DefectDojo       │   │    │
│                                  │  └─────────────────────────────────────────────────────────┘   │    │
│                                  └───────────────────────────────────────────────────────────────┘    │
│                                         VyOS router — inter-subnet ACLs + egress filter               │
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘
                                                  │ SSM / VPN
                                    CrowdSentinel MCP + Claude Code

v2 目标能力:

能力v1(当前)v2(计划中)
主机2 台(Linux SIEM + Windows)7–10 台(DC + 2× WS + Linux + NSM + 攻击者 + SIEM)
网络分段1 个(私有子网)4 个(攻击者 / 公司网络 / DMZ / 管理)
Active Directory—完整 AD DS 域 + GPO + Kerberos
横向移动覆盖范围有限Pass-the-Hash、Kerberoasting、DCSync
网络检测—Zeek(NSM)+ Suricata IDS
运行时安全—Falco;现代 eBPF 探针(CO-RE,内置,默认启用)+ 内核模块回退方案;系统调用级主机 + 容器检测
端点取证—Velociraptor 实时分诊
漏洞管理—DefectDojo;将 Falco 告警、Zeek/Suricata 发现结果及扫描器结果(OpenVAS、Trivy)汇总到统一的跟踪 + 修复工作流中
仪表板—Grafana;集中展示 ES、Falco、Suricata、Velociraptor 和 DefectDojo 的指标 + 告警
欺骗层—蜜罐 + 金丝雀令牌
C2 基础设施仅 ART 原子测试Caldera + Metasploit + Covenant
攻击场景Windows 原子测试 + EVTX 重放完整攻击链:初始访问 → 域失陷
CrowdSentinel 覆盖范围ES 威胁狩猎 + IRES + Zeek/Suricata + Falco + Velociraptor 跨来源关联;DefectDojo/Grafana 提供上游背景信息

设计参考:DetectionLab(Sysmon+WEF+Splunk 融合)、Ludus(模块化 Proxmox/Ansible、VLAN 分段)、SimuLand(多域 AD 林、云原生)、SANS FOR508(以工件为先的 DFIR 工作流)、Falco(CO-RE eBPF 探针架构、内核模块回退方案)。

致谢

CrowdSentinel 的构建离不开众多优秀开源项目的支持。感谢所有项目的维护者和贡献者。

协议与服务框架

  • Model Context Protocol — 由 Anthropic 提供,将大模型连接到工具的协议
  • FastMCP — 本项目基于此 Python MCP 服务框架构建

分析引擎与取证工具

  • Chainsaw — WithSecure Labs 提供的 EVTX 日志分析器
  • Velociraptor — Velocidex/Rapid7 提供的实时端点取证与 DFIR 平台
  • osquery — osquery Foundation 提供的 SQL 驱动主机检测工具
  • Wireshark / TShark — Wireshark Foundation 提供的网络协议分析工具
  • Chepy — 类似 CyberChef 的解码库,为可选的长尾反混淆功能提供支持
  • sqlglot — 用于安全验证 osquery 查询的 SQL 解析器

检测内容

数据平台与威胁情报

开发与测试

方法论框架

  • Cyber Kill Chain(Lockheed Martin)、Pyramid of Pain(David J. Bianco)、Diamond Model(Caltagirone、Pendergast 和 Betz)、MITRE ATT&CK

由 medjedtxm 为安全社区打造

GitHub PyPI

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。