# Course #157: Introduction to Evil-WinRM$

## Overview

In this section, we will dive deep into Evil-WinRM$, a powerful tool designed for Windows Remote Management (WinRM) pentesting. With the increasing prevalence of WinRM in enterprise environments, mastering Evil-WinRM$ can significantly enhance your penetration testing toolkit.

## 1. Installation and Configuration on Kali Linux

### Prerequisites

Before you can use Evil-WinRM$, ensure that you have the following prerequisites installed on your Kali Linux system:

– **Kali Linux (latest version)**: Always ensure you're using an up-to-date version of Kali.
– **Ruby**: Evil-WinRM$ is a Ruby-based tool, so Ruby must be installed.
– **WinRM Enabled on Target**: Ensure the target Windows machine has WinRM configured and accessible.

### Installation Steps

1. **Update Your System**

Open a terminal and update your system packages:

2. **Install Ruby**

If Ruby is not installed, you can install it using:

3. **Install Evil-WinRM$**

You can install Evil-WinRM$ by cloning it from the GitHub repository or using RubyGems for installation. Here’s how to do both:

– **Using GitHub Repository**:


git clone https://github.com/hackerhousey/Evil-WinRM.git
cd Evil-WinRM
sudo gem install bundler
bundle install

– **Using RubyGems**:

4. **Verifying Installation**

To ensure that Evil-WinRM$ is installed correctly, run the following command:

If installed correctly, you should see the help message displaying usage options.

## 2. Step-by-Step Usage and Real-World Use Cases

### Connecting to a Target System

Now that we have Evil-WinRM$ installed, let’s use it to connect to a target Windows system.

#### Basic Usage Syntax

The syntax for connecting to a target machine is as follows:

"`bash
evil-winrm -i -u -p
"`

#### Example Connection

1. **Using a Username and Password**:

Suppose you want to connect to a target with an IP address of `192.168.1.10`, username `Administrator`, and password `P@ssw0rd`. The command would be:


evil-winrm -i 192.168.1.10 -u Administrator -p 'P@ssw0rd'

2. **Using NTLM Authentication**:

If you have a valid NTLM hash, you can authenticate using it. The command would look like this:


evil-winrm -i 192.168.1.10 -u Administrator -H 'NTLM_HASH'

3. **Using Kerberos Authentication**:

For Kerberos authentication, ensure you have the `kinit` command set up correctly. Use the following command:

### Real-World Use Cases

Evil-WinRM$ can be used in various real-world scenarios, including:

– **Post-Exploitation**: After an initial exploit, you can leverage Evil-WinRM$ to maintain access or perform lateral movement within a network.
– **Penetration Testing**: Use Evil-WinRM$ during pen tests to exploit WinRM vulnerabilities and gain remote shell access.
– **Incident Response**: Security professionals can use Evil-WinRM$ to investigate and respond to incidents involving compromised Windows systems.

### Advanced Features

Evil-WinRM$ also offers advanced features like:

– **Interactive Shell**: Provides an interactive command shell once connected to the target.


evil-winrm -i 192.168.1.10 -u Administrator -p 'P@ssw0rd'

– **Uploading and Downloading Files**: You can upload files to the target and download files from the target.

– **Upload a File**:


upload /path/to/local/file C:pathtoremotedestination

– **Download a File**:


download C:pathtoremotefile /path/to/local/destination

– **Running PowerShell Commands**: You can execute PowerShell commands directly from Evil-WinRM$.

### Technical Explanations

#### Understanding WinRM

WinRM (Windows Remote Management) is a Windows feature that allows for remote management of Windows machines. It uses WS-Management protocol and is based on SOAP (Simple Object Access Protocol). Knowing how WinRM works is crucial for understanding the capabilities and limitations of Evil-WinRM$.

#### Authentication Mechanisms

WinRM supports several authentication methods, including:

– **Basic Authentication**: Uses a username and password sent in clear text (not recommended).
– **NTLM Authentication**: More secure, uses a hashed token.
– **Kerberos Authentication**: The most secure method, allowing for single sign-on capabilities.

Understanding these authentication methods is critical for using Evil-WinRM$ effectively.

### References for Further Reading

– [WinRM Overview](https://docs.microsoft.com/en-us/windows/win32/winrm/about-winrm)
– [Evil-WinRM GitHub Repository](https://github.com/hackerhousey/Evil-WinRM)
– [Pentesting Windows with WinRM](https://www.pentesterlab.com/exercises/winrm)

## Conclusion

In this section, we covered the installation and configuration of Evil-WinRM$, along with step-by-step usage and real-world applications. By mastering Evil-WinRM$, you enhance your pentesting skills and prepare yourself to operate effectively within Windows environments.

Made by pablo rotem / פבלו רותם

Pablo Guides