run_script
Execute custom Python or Bash scripts to automate security tasks, returning stdout/stderr with configurable timeout and working directory.
Instructions
Write and execute a Python or Bash script, returning its output.
Writes the code to a temporary file, executes it via python3/bash, and returns stdout/stderr. The temp file is deleted after execution. Requires CYBERSEC_MCP_ALLOW_SCRIPTS=1. This is an explicit full-code execution opt-in: scripts are not OS-sandboxed and are not constrained by CYBERSEC_MCP_ALLOW_EXTERNAL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The script source code to execute. | |
| venv | No | Optional Python venv name from ~/.ctf-venvs/ (e.g. "pwntools"). Allows using a different Python with specific packages installed. Ignored for language="bash". If not set, uses the MCP server's Python. | |
| timeout | No | Maximum execution time in seconds (default 120, max 300). | |
| language | No | "python" (default) or "bash". | python |
| working_dir | No | Working directory for the script (default: system temp dir). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||