# execute_command

Execute a shell command inside the Kali Linux container. Use this to run security tools like nmap, sqlmap, hydra, nikto, gobuster, john, hashcat, dirb, enum4linux, and any other installed tool.

Agent View of the PolicyLayer registry record for `execute_command`. HTML page: https://policylayer.com/tools/hannes221-kali-mcp/execute-command

## Facts

- Tool: `execute_command`
- Server: Kali (`hannes221/kali-mcp`) — https://policylayer.com/tools/hannes221-kali-mcp.md
- Homepage: https://github.com/Hannes221/kali-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "execute_command",
    "arguments": {}
  }
}
```

## Why execute_command is rated High

This tool enables unrestricted execution of arbitrary shell commands within a containerized penetration testing environment. An AI agent misusing this could run destructive commands (rm -rf), exfiltrate data, pivot to other systems, establish persistence, or launch attacks. While the server is intended for authorized security testing, the blast radius of command execution abuse is critical.

From the tool's own definition: "Tool directly executes arbitrary shell commands in a full Kali Linux environment, explicitly mentioning security tools like nmap, sqlmap, hydra, metasploit, and others."

## Use case

AI agents invoke execute_command to trigger actions in Kali. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Kali:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "execute_command": {
      "limits": [
        {
          "counter": "execute_command_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Kali (6)

- `container_stop` — Destructive — https://policylayer.com/tools/hannes221-kali-mcp/container-stop.md
- `container_start` — Execute — https://policylayer.com/tools/hannes221-kali-mcp/container-start.md
- `container_status` — Read — https://policylayer.com/tools/hannes221-kali-mcp/container-status.md
- `download_file` — Read — https://policylayer.com/tools/hannes221-kali-mcp/download-file.md
- `list_files` — Read — https://policylayer.com/tools/hannes221-kali-mcp/list-files.md
- `upload_file` — Write — https://policylayer.com/tools/hannes221-kali-mcp/upload-file.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=hannes221-kali-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/hannes221-kali-mcp
