Skip to main content
Glama

NetExec MCP Server

MCP License: MIT TypeScript NetExec

A Model Context Protocol (MCP) server that provides AI assistants with access to NetExec (nxc), the powerful network execution and penetration testing tool formerly known as CrackMapExec.

Features

This MCP server enables AI assistants to execute NetExec commands via SSH to a Kali Linux machine, supporting:

Protocol

Capabilities

SMB

Windows enumeration, credential dumping (SAM/LSA/NTDS), command execution, pass-the-hash

WinRM

Remote Windows management, PowerShell execution, credential dumping

SSH

Linux/Unix authentication, key-based auth, remote command execution

LDAP

Active Directory enumeration, Kerberoasting, ASREPRoast, BloodHound collection

MSSQL

SQL Server queries, xp_cmdshell execution, login enumeration

RDP

Credential validation, screenshot capture

WMI

Windows Management Instrumentation command execution

Additional features:

  • Password spraying across all protocols

  • Module management and execution

  • SMB share enumeration and file operations

  • NetExec credential database queries

Related MCP server: redteam-mcp

Prerequisites

  • Node.js 18+

  • SSH access to a Kali Linux machine with NetExec installed

  • SSH key-based authentication (recommended) or password

Installation

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

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Environment Variables

Variable

Description

Default

KALI_HOST

SSH hostname or IP for Kali machine

kali

SSH_USER

SSH username

(none)

SSH_KEY

Path to SSH private key file

(none)

SSH_TIMEOUT

Command timeout in seconds

300

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "netexec": {
      "command": "node",
      "args": ["/path/to/sec-netexec-mcp/dist/index.js"],
      "env": {
        "KALI_HOST": "your-kali-host",
        "SSH_USER": "kali",
        "SSH_KEY": "/path/to/ssh/key"
      }
    }
  }
}

Available Tools

nxc_smb

SMB protocol operations including enumeration, share listing, user/group/session enumeration, credential dumping (SAM, LSA, NTDS), and command execution.

nxc_winrm

WinRM remote management for authentication testing, cmd/PowerShell execution, and credential dumping.

nxc_ssh

SSH protocol for authentication testing, key-based auth, and remote command execution.

nxc_ldap

LDAP/Active Directory operations including user/group/computer enumeration, Kerberoasting, ASREPRoast, BloodHound collection, and trust enumeration.

nxc_mssql

SQL Server operations including queries, xp_cmdshell execution, and login enumeration.

nxc_rdp

RDP credential validation and screenshot capture.

nxc_wmi

WMI-based command execution on Windows targets.

nxc_modules

List and query available NetExec modules for each protocol.

nxc_spray

Password spraying with configurable options including user/password lists, jitter, and continue-on-success.

nxc_shares

SMB share enumeration and file operations (spider, get, put).

nxc_raw

Execute raw NetExec commands for advanced scenarios not covered by other tools.

nxc_database

Query the NetExec credential database for stored hosts and credentials.

Usage Examples

Enumerate SMB Hosts

{
  "tool": "nxc_smb",
  "arguments": {
    "target": "192.168.1.0/24"
  }
}

List Shares with Credentials

{
  "tool": "nxc_smb",
  "arguments": {
    "target": "192.168.1.10",
    "username": "admin",
    "password": "P@ssw0rd",
    "domain": "CORP",
    "action": "shares"
  }
}

Pass-the-Hash Attack

{
  "tool": "nxc_smb",
  "arguments": {
    "target": "192.168.1.10",
    "username": "admin",
    "hash": "aad3b435b51404eeaad3b435b51404ee:5fbc3d5fec8206a30f4b6c473d68ae76",
    "domain": "CORP",
    "action": "shares"
  }
}

Password Spray

{
  "tool": "nxc_spray",
  "arguments": {
    "protocol": "smb",
    "target": "192.168.1.0/24",
    "userList": "/tmp/users.txt",
    "password": "Summer2024!",
    "domain": "CORP",
    "continueOnSuccess": true
  }
}

BloodHound Collection

{
  "tool": "nxc_ldap",
  "arguments": {
    "target": "dc01.corp.local",
    "username": "user",
    "password": "password",
    "domain": "CORP",
    "action": "bloodhound",
    "bloodhoundCollection": "All"
  }
}

Dump NTDS from Domain Controller

{
  "tool": "nxc_smb",
  "arguments": {
    "target": "dc01.corp.local",
    "username": "admin",
    "password": "P@ssw0rd",
    "domain": "CORP",
    "action": "ntds"
  }
}

Security Considerations

This tool is intended for authorized security testing only. Always ensure you have:

  • Written authorization to test target systems

  • Proper scope definition for penetration testing engagements

  • Compliance with applicable laws and regulations

Never use this tool against systems you do not have explicit permission to test.

Development

# Watch mode for development
npm run dev

# Build for production
npm run build

# Start the server
npm start

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌────────────────┐
│   AI Assistant  │────▶│  NetExec MCP     │────▶│  Kali Linux    │
│  (Claude, etc.) │     │  Server (Node.js)│ SSH │  (nxc)         │
└─────────────────┘     └──────────────────┘     └────────────────┘
                              │
                              │ stdio
                              ▼
                        ┌──────────────┐
                        │ MCP Protocol │
                        └──────────────┘

References

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This software is provided for educational and authorized security testing purposes only. The authors are not responsible for any misuse or damage caused by this program. Users are responsible for ensuring compliance with all applicable laws and regulations.

Available Tools

12 tools
nxc_databaseC

Query the NetExec database for stored credentials and hosts.

Inputs: protocol (required), action (required), exportFormat.

nxc_ldapB

Execute NetExec LDAP protocol commands for Active Directory enumeration, including users, groups, Kerberoasting, and BloodHound collection.

Inputs: target (required), username, password, hash, +6 more.

nxc_modulesB

List or get information about available NetExec modules for a protocol.

Inputs: protocol (required), moduleName.

nxc_mssqlB

Execute NetExec MSSQL protocol commands for SQL Server enumeration and command execution.

Inputs: target (required), username, password, domain, +5 more.

nxc_rawA

Execute a raw NetExec command with full control over all arguments. Use for advanced scenarios not covered by other tools.

Inputs: command (required).

nxc_rdpB

Execute NetExec RDP protocol commands for credential validation and screenshot capture.

Inputs: target (required), username, password, hash, +3 more.

nxc_sharesC

Enumerate and interact with SMB shares on target systems.

Inputs: target (required), username, password, hash, +8 more.

nxc_smbB

Execute NetExec SMB protocol commands for Windows enumeration, credential validation, command execution, and credential dumping. Supports pass-the-hash attacks.

Inputs: target (required), username, password, hash, +8 more.

nxc_sprayC

Perform password spraying attacks across multiple targets with configurable options.

Inputs: protocol (required), target (required), userList, username, +7 more.

nxc_sshA

Execute NetExec SSH protocol commands for Linux/Unix enumeration and command execution.

Inputs: target (required), username, password, keyFile, +3 more.

nxc_winrmB

Execute NetExec WinRM protocol commands for remote Windows management and command execution.

Inputs: target (required), username, password, hash, +4 more.

nxc_wmiB

Execute NetExec WMI protocol commands for Windows management and command execution.

Inputs: target (required), username, password, hash, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct protocol or feature (e.g., LDAP, MSSQL, SMB, spraying) with clear scope. The only potential overlap is between nxc_smb and nxc_shares, but the descriptions differentiate them well (general SMB vs. share enumeration).

    Naming Consistency5/5

    All tools follow the consistent 'nxc_<protocol/feature>' pattern, using lowercase with underscores. This uniform naming convention makes the tool set predictable and easy to navigate.

    Tool Count5/5

    With 12 tools covering major protocols (LDAP, MSSQL, RDP, SMB, SSH, WinRM, WMI) plus auxiliary features (database, modules, shares, spray, raw), the count is well-scoped for a security enumeration/execution server.

    Completeness4/5

    The tool set covers core NetExec protocols and common attack vectors (password spraying, credential dumping, command execution). Minor gaps exist (e.g., no explicit Kerberos or FTP tool), but the raw tool provides a fallback for advanced scenarios.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects AI clients to a Linux terminal for real-time automated penetration testing and CTF challenge solving. It enables AI models to execute terminal commands and interact with offensive security tools like Nmap, SQLMap, and Gobuster.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A penetration testing MCP server that runs 20 hacking tools inside a Kali Linux Docker container, enabling AI assistants to execute security scans and attacks via natural language.
      2
      -
    • A
      license
      A
      quality
      F
      maintenance
      An MCP server that provides AI assistants with access to CrackMapExec/NetExec network penetration testing capabilities via SSH to a Kali Linux host, supporting multiple protocols for enumeration, credential dumping, and command execution.
      11
      MIT