CrackMapExec MCP Server
Provides SSH-based access to a Kali Linux host to execute CrackMapExec/NetExec commands for network penetration testing across multiple protocols (SMB, WinRM, SSH, MSSQL, LDAP, RDP, WMI) including enumeration, credential dumping, and command execution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CrackMapExec MCP Server enumerate SMB shares on 192.168.1.100 with admin:pass123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CrackMapExec MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with access to CrackMapExec/NetExec network penetration testing capabilities via SSH to a Kali Linux host.
Overview
This MCP server enables AI-powered network security assessments by exposing CrackMapExec (CME) / NetExec (NXC) functionality through the standardized MCP interface. It supports multiple protocols and comprehensive enumeration, credential dumping, and command execution capabilities.
Related MCP server: redteam-mcp
Features
Supported Protocols
Protocol | Description |
SMB | Windows file sharing - shares, users, groups, SAM/LSA/NTDS dumping |
WinRM | Windows Remote Management - remote command execution |
SSH | Secure Shell - Linux/Unix command execution |
MSSQL | Microsoft SQL Server - query execution, xp_cmdshell |
LDAP | Active Directory enumeration - users, computers, delegation |
RDP | Remote Desktop Protocol - access validation |
WMI | Windows Management Instrumentation - remote execution |
Capabilities
Enumeration: Shares, users, groups, sessions, computers, domain controllers
Credential Dumping: SAM, LSA secrets, NTDS.dit, gMSA passwords
Command Execution: cmd, PowerShell, via multiple methods (wmiexec, smbexec, atexec)
Password Spraying: Multi-threaded credential testing with jitter support
Module System: Extensible via NetExec modules
Credential Database: Store and search discovered credentials
Installation
Prerequisites
Node.js 18+
SSH access to a Kali Linux host with NetExec/CrackMapExec installed
SSH key-based authentication configured (recommended)
Setup
# Clone the repository
git clone https://github.com/schwarztim/sec-crackmapexec-mcp.git
cd sec-crackmapexec-mcp
# Install dependencies
npm install
# Build
npm run buildConfiguration
Environment Variables
Variable | Description | Default |
| Hostname or IP of the Kali Linux host |
|
| SSH username | (none) |
| Path to SSH private key | (none) |
| Binary name ( |
|
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"crackmapexec": {
"command": "node",
"args": ["/path/to/sec-crackmapexec-mcp/dist/index.js"],
"env": {
"KALI_HOST": "your-kali-host",
"SSH_USER": "kali",
"SSH_KEY": "/path/to/ssh/key"
}
}
}
}Available Tools
cme_smb
Execute SMB protocol operations including share enumeration, user enumeration, credential dumping, and command execution.
// Example: Enumerate shares
{ targets: "192.168.1.0/24", username: "admin", password: "pass123", shares: true }
// Example: Dump SAM hashes
{ targets: "192.168.1.100", username: "admin", password: "pass123", sam: true }cme_winrm
Execute commands via Windows Remote Management (ports 5985/5986).
{ targets: "192.168.1.100", username: "admin", password: "pass123", execPowershell: "Get-Process" }cme_ssh
Test SSH credentials and execute commands on Linux/Unix hosts.
{ targets: "192.168.1.0/24", username: "root", password: "toor", execCmd: "id" }cme_mssql
Query MSSQL databases and execute OS commands via xp_cmdshell.
{ targets: "192.168.1.50", username: "sa", password: "password", query: "SELECT @@version" }cme_ldap
Enumerate Active Directory via LDAP queries.
{ targets: "dc01.domain.local", username: "user", password: "pass", domain: "domain.local", usersEnabled: true }cme_rdp
Validate RDP access to targets.
{ targets: "192.168.1.0/24", username: "admin", password: "pass123" }cme_wmi
Execute commands via WMI.
{ targets: "192.168.1.100", username: "admin", password: "pass123", execCmd: "whoami" }cme_modules
List available modules for a protocol or get module options.
// List SMB modules
{ protocol: "smb" }
// Get options for specific module
{ protocol: "smb", moduleName: "mimikatz" }cme_spray
Perform password spraying attacks with jitter support.
{
protocol: "smb",
targets: "192.168.1.0/24",
usernames: "users.txt",
passwords: "Summer2024!",
domain: "corp.local",
jitter: "1-3"
}cme_creds
Manage the NetExec credential database.
// List all credentials
{ action: "list" }
// Search credentials
{ action: "search", searchTerm: "admin" }
// Export credentials
{ action: "export", exportPath: "creds.csv" }cme_raw
Execute raw NetExec commands for advanced operations.
{ command: "smb 192.168.1.100 -u admin -p pass123 --shares" }Security Considerations
This tool is intended for authorized security testing only. Ensure you have:
Written authorization to test target systems
Proper scope definition for the engagement
Understanding of applicable laws and regulations
Never use this tool against systems without explicit permission.
Architecture
┌─────────────────┐ SSH ┌─────────────────┐
│ Claude/AI │ ────────────► │ Kali Linux │
│ Assistant │ │ + NetExec │
├─────────────────┤ └─────────────────┘
│ MCP Server │ │
│ (Node.js) │ ▼
└─────────────────┘ ┌─────────────────┐
│ Target Network │
└─────────────────┘Development
# Run in development mode
npm run dev
# Build for production
npm run build
# Start production server
npm startLicense
MIT License - see LICENSE file for details.
Related Projects
NetExec - The network execution tool
Model Context Protocol - The MCP specification
MCP SDK - Official MCP SDK
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 tool. Always obtain proper authorization before conducting security assessments.
Available Tools
11 toolscme_credsB
Manage the NetExec credential database. View, search, and export stored credentials from previous scans.
Inputs: action (required), searchTerm, exportPath.
cme_ldapB
Execute LDAP protocol operations. Supports Active Directory enumeration including users, computers, groups, delegation, and custom LDAP queries.
Inputs: targets (required), username, password, hash, +16 more.
cme_modulesA
List available modules for a protocol or get options for a specific module.
Inputs: protocol (required), moduleName.
cme_mssqlA
Execute MSSQL protocol operations. Supports SQL query execution and command execution via xp_cmdshell.
Inputs: targets (required), username, password, hash, +11 more.
cme_rawA
Execute a raw NetExec/CrackMapExec command. Use this for advanced operations not covered by other tools.
Inputs: command (required).
cme_rdpC
Execute RDP protocol operations. Check RDP access and screenshot capabilities.
Inputs: targets (required), username, password, hash, +7 more.
cme_smbB
Execute SMB protocol operations with NetExec/CrackMapExec. Supports enumeration of shares, users, groups, sessions, credential dumping (SAM, LSA, NTDS), and command execution.
Inputs: targets (required), username, password, hash, +23 more.
cme_sprayA
Perform password spraying attacks across multiple targets. Supports jitter and continues on success options.
Inputs: protocol (required), targets (required), usernames (required), passwords (required), +7 more.
cme_sshB
Execute SSH protocol operations. Supports password and key-based authentication for Linux/Unix hosts.
Inputs: targets (required), username, password, port, +8 more.
cme_winrmC
Execute WinRM protocol operations. Supports remote command execution and credential dumping on hosts with WinRM enabled (ports 5985/5986).
Inputs: targets (required), username, password, hash, +16 more.
cme_wmiB
Execute WMI protocol operations. Supports remote command execution via WMI.
Inputs: targets (required), username, password, hash, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct protocol or operation (e.g., SMB, LDAP, MSSQL, credential management), with clear descriptions that eliminate ambiguity. No overlapping purposes.
All tools follow a consistent `cme_<protocol/function>` naming convention, using lowercase and snake_case, making it predictable and easy to understand.
With 11 tools, the server covers a broad set of protocols and operations (credential management, spraying, multiple protocol executions) without being overwhelming or too sparse.
The surface covers major protocols (SMB, LDAP, MSSQL, RDP, SSH, WinRM, WMI) and key activities like credential dumping, spraying, and raw commands. Minor gaps exist (e.g., Kerberos) but are manageable via the raw tool.
Maintenance
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn 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.-
- FlicenseNot gradedqualityDmaintenanceA 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-
- FlicenseNot gradedqualityDmaintenanceAn MCP server for red teaming that enables AI agents to perform port scanning, vulnerability scanning, SSH operations, and Metasploit exploitation through a unified interface.16-
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to execute NetExec network penetration testing commands via SSH to a Kali Linux machine, supporting protocols like SMB, WinRM, SSH, LDAP, and more.123MIT