Post-Exploitation tmux MCP Server

Post-Exploitation tmux MCP Server

Exposes tmux features to AI agents for managing sessions, windows, and panes with built-in command execution. It includes comprehensive guardrails to prevent destructive system operations, file deletions, and unauthorized network changes.

Category
访问服务器

README

🖥️ Post-Exploitation tmux MCP Server

A MCP server that exposes essential tmux features as MCP tools — giving AI agents a terminal multiplexer for post-exploitation operations, with built-in guardrails that block destructive commands.


✨ Tools (14)

Category Tools Description
Sessions 3 Create, list, kill
Windows 3 Create, list, kill
Panes 3 Split, list, kill
Command Execution 3 execute_command, send_keys, capture_pane — all guarded
Utility 2 validate_command_safety, kill_server

🛡️ Guardrails

Every command sent through execute_command or send_keys is validated before execution. The guardrails block:

  • File destructionrm -rf /, shred, wipefs
  • Disk operationsmkfs, dd if=, fdisk, parted
  • Fork bombs:(){ :|:& };:
  • System shutdownshutdown, reboot, halt, init 0/6
  • Critical process killingkill -9 1, killall -9
  • Permission bombschmod -R 777 /
  • Dangerous redirects> /etc/passwd, > /etc/shadow
  • Network destructioniptables -F
  • Log tampering> /var/log/, history -c
  • Obfuscated executioncurl ... | sh, base64 -d | sh

📦 Installation

cd Post-Exploitation
pip install -r requirements.txt

Prerequisite: tmux must be installed on the target machine.


🚀 Usage

Run the MCP server

python server.py

Test with the interactive client

python client.py

The client connects to server.py via stdio, lists available tools, and gives you an interactive REPL to call them.

Connect from an MCP client (e.g. AI agent)

{
  "mcpServers": {
    "post-exploitation-tmux": {
      "command": "python3",
      "args": ["path/to/Post-Exploitation/server.py"]
    }
  }
}

🔧 Tool Reference

Sessions

Tool Description
create_session(name, window_name?) Create a new detached session
list_sessions() List all sessions
kill_session(name) Destroy a session

Windows

Tool Description
create_window(session, name?) Create a new window
list_windows(session) List windows
kill_window(session, index) Kill a window

Panes

Tool Description
split_pane(session, window, direction?) Split pane vertically/horizontally
list_panes(session, window) List panes with command & PID
kill_pane(session, window, pane) Kill a pane

Command Execution (Guarded)

Tool Description
execute_command(session, window, pane, command) Run a command (guardrail-checked)
send_keys(session, window, pane, keys, press_enter?) Send keystrokes (guarded if Enter)
capture_pane(session, window, pane, start?, end?) Read pane output (trailing blanks stripped)

Utility

Tool Description
validate_command_safety(command) Pre-check a command without executing
kill_server() Kill the tmux server (destroys all sessions)

📂 Project Structure

Post-Exploitation/
├── server.py            # FastMCP server — 14 tools
├── tmux_wrapper.py      # Thin Python wrapper around tmux CLI
├── guardrails.py        # Command validation & safety checks
├── client.py            # Interactive MCP test client
├── test_guardrails.py   # Guardrails unit tests
├── requirements.txt     # Python dependencies
└── README.md            # This file

🧪 Testing

Run guardrail tests

python test_guardrails.py

Test MCP tools interactively

python client.py

⚠️ Disclaimer

This tool is intended for authorized penetration testing and security research only. Unauthorized use against systems you do not own or have explicit permission to test is illegal.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选