Evil-WinRM and PowerShell Remoting Attacks
You'll learn how to weaponize Windows Remote Management for remote shell access and lateral movement during penetration tests.
What Is Evil-WinRM?
Evil-WinRM is a Ruby-based tool that exploits Windows Remote Management (WinRM) — Microsoft's implementation of the WS-Management protocol for remote shell access. Think of it as SSH for Windows environments, but often misconfigured and ripe for exploitation.
WinRM typically runs on ports 5985 (HTTP) and 5986 (HTTPS) and allows authenticated users to execute PowerShell commands remotely. If you've obtained valid credentials during enumeration or credential harvesting, Evil-WinRM becomes your gateway to interactive PowerShell sessions on target machines.
Why Evil-WinRM Matters for Attackers
Unlike traditional RDP connections that create visible GUI sessions, WinRM operates stealthily in the background. Security teams may not monitor WinRM traffic as closely as Remote Desktop, making it ideal for lateral movement across Active Directory environments.
Evil-WinRM enhances standard PowerShell remoting with features like:
- Automatic loading of PowerShell scripts and executables
- File upload/download capabilities for post-exploitation
- In-memory execution to avoid disk-based detection
- Menu-driven interface for common post-exploitation tasks
Attack Workflow
Once you have valid credentials (domain user, local administrator, or compromised service account), connecting is straightforward. The tool establishes a persistent PowerShell session, allowing you to run reconnaissance commands, dump credentials, pivot to other systems, or execute privilege escalation exploits — all while maintaining operational security.
Key Takeaway: Evil-WinRM transforms legitimate Windows Remote Management into a powerful post-exploitation and lateral movement tool, leveraging valid credentials to gain stealthy remote PowerShell access across enterprise networks.