使用说明
克劳德C2
人工智能驱动的指挥与控制框架
通过Claude AI和模型上下文协议对远程系统进行自然语言控制
概述
Claude C2是一个命令和控制框架,与Anthropic的模型上下文协议(MCP)集成,使操作员能够通过与Claude AI的自然语言对话来管理远程系统。
操作员用简单的英语传达意图,而不是在不同的操作系统中记忆命令语法。AI解释请求,选择适当的目标,执行必要的命令,并返回格式化的结果。
Operator: "Show me all connected systems"
Claude: [Queries client manager, returns formatted list with OS, hostname, IP, user context]
Operator: "Capture the screen on the Windows workstation"
Claude: [Identifies target, executes screenshot, saves to server, confirms completion]
Operator: "Search for configuration files containing credentials"
Claude: [Runs recursive search with appropriate OS commands, returns matching paths]
关键特性
| 特性 | 描述 |
|---|---|
| 自然语言接口 | 通过英语会话与目标沟通 |
| 交叉平台的 | 跨Windows、Linux、macOS和Android的统一控制 |
| 自适应执行 | AI自动将意图转换为特定于操作系统的命令 |
| 最小占地面积 | 代理使用本机脚本工具,无需额外的二进制文件 |
| 加密传输 | 使用OAuth 2.0身份验证的TLS安全WebSocket连接 |
| 自动恢复 | 代理在连接丢失时自动重新连接 |
建筑
┌────────────────────────────────────────────────────────────────────────────┐
│ │
│ CLAUDE C2 ARCHITECTURE │
│ │
├────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ │ │ │ │ │ │
│ │ OPERATOR │ MCP │ COMMAND │ WSS │ TARGET │ │
│ │ │◄───────►│ │◄───────►│ │ │
│ │ Claude.ai │ SSE │ SERVER │ JSON │ AGENTS │ │
│ │ │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ │ │ │ │
│ │ Natural language │ Command routing │ Shell │
│ │ requests/responses │ Client management │ execution │
│ │ via Claude AI │ OAuth + TLS │ Results │
│ │ │ │ │
│ │
└────────────────────────────────────────────────────────────────────────────┘
通信流程:
- 操作员通过Claude.AI界面与Claude AI交互
- Claude通过SSE上的MCP(模型上下文协议)连接到C2服务器
- 服务器维护与所有已部署代理的持久WebSocket连接
- 根据操作员意图将命令路由到适当的代理
- 代理使用本机操作系统工具执行命令并返回结果
- Claude格式化并向操作员显示结果
安装
先决条件
- Node.js 18或更高版本
- 有效的SSL证书(建议使用Let's Encrypt)
- 指向服务器的域名
- 端口443、3101、3102上的网络访问
服务器安装程序
# Clone repository
git clone https://github.com/0xyg3n/claude-c2.git
cd claude-c2
# Install dependencies
npm install
# Configure environment
cp .env.example .env
编辑 .env 根据您的配置:
DOMAIN=your-domain.com
MCP_PORT=3101
WS_PORT=3102
OAUTH_CLIENT_ID=your-client-id
OAUTH_CLIENT_SECRET=your-client-secret
SSL_CERT_PATH=/path/to/cert.pem
SSL_KEY_PATH=/path/to/key.pem
# Start server
npm start
Claude.ai集成
在Claude.ai设置中配置MCP连接器:
| 参数 | 值 |
|---|---|
| 服务器URL | https://your-domain.com/mcp/sse |
| 身份验证 | OAuth 2.0 |
| 客户端ID | 来自的值 .env |
| 客户端机密 | 来自的值 .env |
部署
使用特定于平台的单行程序将代理部署到目标系统:
| Platform | Deployment Command |
|---|---|
| Windows |
|
| Linux |
|
| macOS |
|
| Android |
|
默认情况下,代理在内存中运行,没有持久性。连接弹性内置于网络中断时的自动重新连接中。
使用示例
| 请求 | 行动 |
|---|---|
"List all connected clients" |
显示所有活动代理和系统信息 |
"Execute whoami on target" |
运行命令并返回输出 |
"Take a screenshot" |
捕获显示并保存到服务器 |
"Find all PDF documents" |
递归文件系统搜索 |
"Show network configuration" |
基于操作系统执行ipconfig/ifconfig |
"List running processes" |
显示包含详细信息的流程列表 |
"Open URL on Android device" |
使用指定的URL启动浏览器 |
当连接单个代理时,Claude会自动选择它。对于多个代理,请通过名称或标识符指定目标。
演示平台
| Windows 11 | 安卓系统(Termux) |
|---|---|
| 完整的代理功能 | 具有API访问权限的Termux环境 |
文档
| 文档 | 描述 |
|---|---|
| 集成指南 | Claude.ai配置和API设置 |
| Android操作 | 特定于Termux的功能和Termu:neneneba API |
法律声明
|
该软件严格用于授权的安全测试、教育研究和合法的渗透测试。 使用本软件即表示您承认并同意以下内容:
此工具专门用于:
|
克劳德C2 --基于Anthropic的模型上下文协议
# Claude C2 - Updated Mon Dec 8 13:44:11 EET 2025