schwarztim/sec-powershell-empire-mcp

GitHub: schwarztim/sec-powershell-empire-mcp

一个基于 MCP 协议的服务器,用于通过 AI 助手与 PowerShell Empire 后渗透框架的 REST API 交互,简化监听器、Agent、模块和凭据的管理。

Stars: 1 | Forks: 0

# PowerShell Empire MCP 服务器 一个用于与 [PowerShell Empire](https://github.com/BC-SECURITY/Empire)(BC-Security 维护的后渗透框架)交互的模型上下文协议(MCP)服务器。 ## 功能 此 MCP 服务器提供对 Empire REST API(v5+)的全面访问,使 AI 助手能够: - **监听器管理**:创建、列出、启用/禁用和删除监听器 - **Stager 生成**:使用多种模板(PowerShell、Python、C# 等)生成 Payload - **Agent 控制**:列出 Agent、执行命令、上传/下载文件 - **模块执行**:搜索和运行后渗透模块 - **凭据管理**:查看和存储收集到的凭据 - **插件系统**:执行 Empire 插件 - **C2 配置文件**:访问用于 HTTP/S 监听器的 malleable C2 配置文件 ## 安装说明 ``` # 克隆仓库 git clone https://github.com/schwarztim/sec-powershell-empire-mcp.git cd sec-powershell-empire-mcp # 安装依赖 npm install # 构建 npm run build ``` ## 配置 设置以下环境变量: | 变量 | 描述 | 默认值 | |------|------|--------| | `EMPIRE_URL` | Empire REST API URL | `http://localhost:1337` | | `EMPIRE_USERNAME` | Empire 用户名 | `empireadmin` | | `EMPIRE_PASSWORD` | Empire 密码 | `password123` | ### Claude Desktop 配置 添加到你的 Claude Desktop 配置(`~/.claude/user-mcps.json` 或 Claude Desktop 设置)中: ``` { "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, disable ``` ### empire_stagers 生成和管理用于 Empire Agent 的 Stager/Payload。 ``` Actions: list, templates, create, get, delete ``` ### empire_agents 列出和管理活跃的 Empire Agent。 ``` Actions: list, get, kill, rename, checkins, files, tasks ``` ### empire_modules 搜索和查看 Empire 后渗透模块。 ``` Actions: list, search, get, execute ``` ### empire_shell 在 Empire Agent 上执行 shell 命令。 ### empire_upload 将文件上传到 Empire Agent。 ### empire_download 从 Empire Agent 下载文件。 ### empire_credentials 管理 Empire 中收集到的凭据。 ``` Actions: list, create ``` ### empire_hosts 列出 Agent 正在运行的主机。 ### empire_downloads 列出从 Agent 下载的文件。 ``` Actions: list, get ``` ### empire_plugins 管理 Empire 插件。 ``` Actions: list, execute ``` ### empire_bypasses 列出可用的 AMSI/AV 绕过方法。 ### empire_profiles 列出用于 HTTP 监听器的 malleable C2 配置文件。 ### empire_task_result 获取特定任务的执行结果。 ## 使用示例 ### 列出活跃 Agent ``` 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+(BC-Security 分支) - 启用 Empire REST API ## 安全注意事项 - 安全存储凭据,避免硬编码在配置中 - 在生产环境中为 Empire API 连接使用 HTTPS - 将 API 访问限制在授权的网络范围内 - 遵守组织关于红队工具的安全策略 ## 许可证 MIT 许可证 — 请参阅 [LICENSE](LICENSE) 文件。 ## 免责声明 本软件仅供授权安全测试和教育目的使用。用户有责任确保遵守适用法律法规。作者不对因滥用本软件而导致的任何责任承担义务。 ## 参考 - [PowerShell Empire](https://github.com/BC-SECURITY/Empire) - [Empire REST API 文档](https://bc-security.gitbook.io/empire-wiki/restful-api) - [模型上下文协议](https://modelcontextprotocol.io/)
标签:C2配置, CMS安全, Empire, GNU通用公共许可证, IPv6, JavaScript, MCP协议, MITM代理, Node.js, PE 加载器, PowerShell, REST API, 代码分析, 傀儡机管理, 傀儡程序生成, 凭证管理, 后渗透框架, 命令与控制, 安全测试, 攻击性安全, 模块执行, 横向移动, 编程规范, 网络信息收集, 自定义脚本