Get the FREE Ultimate OpenClaw Setup Guide →

sec-netexec

MCP server for NetExec - Network execution tool for penetration testing

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio schwarztim-sec-netexec-mcp node /path/to/sec-netexec-mcp/dist/index.js \
  --env SSH_KEY="/path/to/ssh/key" \
  --env SSH_USER="kali" \
  --env KALI_HOST="your-kali-host" \
  --env SSH_TIMEOUT="300"

How to use

This MCP server exposes NetExec capabilities to AI assistants via the MCP interface. It enables remote control of a Kali Linux host running NetExec over SSH, allowing you to perform a wide range of security testing operations through structured tool calls. Available tools map to NetExec capabilities across multiple protocols, including SMB, WinRM, SSH, LDAP, MSSQL, RDP, and WMI. Typical usage involves instructing the MCP layer to execute a specific NetExec operation (for example, enumerating SMB shares, performing Kerberoasting via LDAP, or running remote commands over SSH) on a target host reachable from the Kali machine. You can also leverage helpers like password spraying, module management, and credential database queries through the provided NetExec tooling family.

To use it, ensure your MCP client connects to the netexec server configured in claude_desktop_config.json or your MCP client configuration. Then call the available tools (e.g., nxc_smb, nxc_ssh, nxc_ldap, nxc_mssql, nxc_rdp, nxc_wmi) with the appropriate arguments. Each tool exposes a set of arguments tailored to its protocol, such as target hosts, credentials, domains, actions (like shares, ntds, bloodhound), and additional options (e.g., continueOnSuccess for password spraying). The tools are designed to compose JSON payloads that specify the tool name and argument map, enabling clear, repeatable operations within your automation pipelines.

How to install

Prerequisites:

  • Node.js 18+ installed on the machine running the MCP server
  • Access to a Kali Linux host with NetExec installed and SSH access enabled
  • SSH key-based authentication preferred (passwords supported if configured)

Installation steps:

  1. Clone the repository git clone https://github.com/schwarztim/sec-netexec-mcp.git cd sec-netexec-mcp

  2. Install dependencies npm install

  3. Build the project npm run build

  4. Start the server (examples) npm start

  5. Optional: configure your MCP client (e.g., Claude Desktop) to point at the built index.js using the following environment settings: KALI_HOST=your-kali-host SSH_USER=kali SSH_KEY=/path/to/ssh/key SSH_TIMEOUT=300

Notes:

  • The server expects an SSH-enabled Kali host with NetExec installed and accessible by the configured SSH credentials.
  • Adjust environment variables as needed for your environment and security policies.

Additional notes

Tips and considerations:

  • Ensure SSH access from the MCP host to the Kali machine is reliable and that the NetExec toolset on Kali is up to date.
  • Use SSH key-based authentication where possible for automation reliability.
  • The CLAUDE Desktop integration example shows how to pass environment variables into the MCP server; keep sensitive values secure and consider using secrets management where appropriate.
  • If you encounter SSH timeouts, increase SSH_TIMEOUT or check network connectivity and Kali host load.
  • Review NetExec tool documentation for protocol-specific usage (e.g., nxc_smb for SMB operations, nxc_ldap for LDAP/AD operations, nxc_spray for password spraying).
  • Monitor for command length or argument constraints in your MCP client and adjust payloads accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers