基于 CS 4.12 的钴罢工MCP
概览
一个提供 Cobalt Strike API 操作访问的MCP(模式上下文协议)服务器. - : 使用 Cobalt Strike API 认证并管理无记名符号 - : 从 OpenAPI 规格自动创建 MCP 工具 - : 将所有 Cobalt Strike API 操作作为 MCP 工具进行曝光 2. 配置环境变量(.env.example to.env并编辑): 添加到您的 MCP 客户端配置中( 例如 Claude 桌面) : 1.:在启动时,服务器以/api/auth/login进行认证并取回了无记名符号 2.:在授权头3中创建带有无记名符号的HTTP客户端 3.:从/v3/api-docs 4.:动态为每次API操作5创建了MCP工具.
概述(AI 翻译)
一个提供 Cobalt Strike API 操作访问的MCP(模式上下文协议)服务器.
□ 特性
- ** 自动认证**: 用 Cobalt Strike API 认证并管理无记名符号
- ** 动态工具生成**: 从 OpenAPI 规格自动创建 MCP 工具
- ** API 覆盖**:将所有钴打击API操作作为MCP工具进行曝光
□ 设置
-
安装依赖性:
-
配置环境变量(副本
.env.example至[T1]并进行编辑): -
设定你的钴罢工证书:
□ 使用量
QQ 运行服务器
使用 MCP 客户端
添加到您的 MCP 客户端配置中( 例如 Claude 桌面) :
如何运作
- 认证:启动时,服务器以
/api/auth/login认证并取回无记名标志 - API 客户初始化: 在授权信头中创建带有无记号的 HTTP 客户端
- ** OpenAPI Spec 加载**:从 [[T3] 获取 OpenAPI 规格
- ** 生成工具**: 为每次API操作动态创建 MCP 工具
- ** 请求处理**: 路由工具调用适当的 API 端点并进行适当的认证
□ 环境变量
本页由 AI 翻译,技术细节请以原文为准。
README
Cobalt Strike MCP Server
An MCP (Model Context Protocol) server that provides access to Cobalt Strike API operations.
Features
- Automatic Authentication: Authenticates with Cobalt Strike API and manages bearer token
- Dynamic Tool Generation: Automatically creates MCP tools from the OpenAPI specification
- Full API Coverage: Exposes all Cobalt Strike API operations as MCP tools
Setup
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables (copy
.env.exampleto.envand edit):
cp .env.example .env
- Set your Cobalt Strike credentials:
export CS_BASE_URL="https://your-cs-server:50443"
export CS_USERNAME="your-username"
export CS_PASSWORD="your-password"
export CS_VERIFY_SSL="false" # Set to "true" if using valid SSL cert
Usage
Running the Server
python server.py
Using with MCP Client
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"cobalt-strike": {
"command": "python",
"args": ["/path/to/CS-MCP/server.py"],
"env": {
"CS_BASE_URL": "https://your-cs-server:50443",
"CS_USERNAME": "your-username",
"CS_PASSWORD": "your-password",
"CS_VERIFY_SSL": "false"
}
}
}
}
How It Works
- Authentication: On startup, the server authenticates with
/api/auth/loginand retrieves a bearer token - API Client Initialization: Creates an HTTP client with the bearer token in the Authorization header
- OpenAPI Spec Loading: Fetches the OpenAPI specification from
/v3/api-docs - Tool Generation: Dynamically creates MCP tools for each API operation
- Request Handling: Routes tool calls to the appropriate API endpoints with proper authentication
Environment Variables
CS_BASE_URL: Base URL of the Cobalt Strike serverCS_USERNAME: Username for authentication (required)CS_PASSWORD: Password for authentication (required)CS_VERIFY_SSL: Whether to verify SSL certificates (default:false)
Security Notes
- Store credentials securely (use environment variables, not hardcoded values)
- Consider using SSL certificate verification in production (
CS_VERIFY_SSL=true) - The bearer token is managed automatically and refreshed as needed
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"cobalt-strike": {
"command": "python",
"args": ["/path/to/CS-MCP/server.py"],
"env": {
"CS_BASE_URL": "https://your-cs-server:50443",
"CS_USERNAME": "your-username",
"CS_PASSWORD": "your-password",
"CS_VERIFY_SSL": "false"
}
}
}
}