PowerShell帝国MCP服务器
一种用于交互的模型上下文协议(MCP)服务器 PowerShell帝国,不列颠哥伦比亚省安全局维护的漏洞利用后框架。
备注:此工具仅用于授权的安全测试、红队行动和教育目的。在对任何系统使用此工具之前,请确保您有适当的授权。
特性
此MCP服务器提供对Empire的REST API(v5+)的全面访问,使人工智能助手能够:
- 听众管理:创建、列出、启用/禁用和删除侦听器
- 分段器生成:使用各种模板(PowerShell、Python、C#等)生成有效载荷
- 代理控制:列出代理、执行命令、上传/下载文件
- 模块执行:搜索并运行漏洞利用后模块
- 凭证管理:查看和存储收集的凭据
- 插件系统:执行Empire插件
- C2配置文件:访问HTTP/S侦听器的可扩展C2配置文件
安装
# Clone the repository
git clone https://github.com/schwarztim/sec-powershell-empire-mcp.git
cd sec-powershell-empire-mcp
# Install dependencies
npm install
# Build
npm run build配置
设置以下环境变量:
| 变量 | 描述 | 默认值 |
|---|---|---|
EMPIRE_URL | 帝国REST API URL | http://localhost:1337 |
EMPIRE_USERNAME | 帝国用户名 | empireadmin |
EMPIRE_PASSWORD | 帝国密码 | password123 |
Claude桌面配置
添加到您的Claude Desktop配置(~/.claude/user-mcps.json 或克劳德桌面设置):
{
"mcpServers": {
"powershell-empire": {
"command": "node",
"args": ["/path/to/sec-powershell-empire-mcp/dist/index.js"],
"env": {
"EMPIRE_URL": "https://your-empire-server:1337",
"EMPIRE_USERNAME": "your-username",
"EMPIRE_PASSWORD": "your-password"
}
}
}
}可用工具
empire_listeners
管理Empire侦听器-列出、创建、启用、禁用或删除侦听器。
Actions: list, get, templates, create, delete, enable, disableempire_stagers
为帝国特工生成和管理舞台/有效载荷。
Actions: list, templates, create, get, delete员工_绅士
列出并管理活跃的帝国特工。
Actions: list, get, kill, rename, checkins, files, tasksempire_模块
搜索并查看Empire漏洞利用后模块。
Actions: list, search, get, execute帝国外壳
在Empire代理上执行shell命令。
帝国地图
将文件上传到Empire代理。
empire_下载
从帝国特工处下载文件。
雇主证书
在Empire中管理已获取的凭据。
Actions: list, createempire_hosts
列出代理正在运行的主机。
empire_下载
列出从代理下载的文件。
Actions: list, getempire_plugins
管理Empire插件。
Actions: list, executeempire_bypasses
列出可用的AMSI/AV旁路。
员工档案
列出HTTP侦听器的可扩展C2配置文件。
empire_task_result
获取特定任务的结果。
使用示例
列出活动代理
Use empire_agents with action "list" to see all active agents.执行Shell命令
Use empire_shell with agent_id "ABC123" and command "whoami" to run a command on an agent.生成PowerShell Stager
Use empire_stagers with action "create", template "multi_launcher", name "test_stager",
and options including the Listener name.搜索模块
Use empire_modules with action "search" and search term "mimikatz" to find credential dumping modules.需求
- Node.js 18+
- PowerShell Empire v5+(不列颠哥伦比亚省安全分支)
- 帝国REST API已启用
安全注意事项
- 安全地存储凭据;避免在配置中硬编码
- 在生产中对Empire API连接使用HTTPS
- 仅限制API对授权网络的访问
- 遵循贵组织的红队工具安全策略
许可证
MIT许可证-请参阅 许可证 文件。
免责声明
此软件仅用于授权的安全测试和教育目的。用户有责任确保遵守适用的法律法规。作者对滥用此软件不承担任何责任。
