Lateral Move

Windows Management Instrumentation (WMI)

Spawning a process

wmic /node:<RHOST> /user:<USERNAME> /password:<PASSWORD> process call create "cmd"

Store Credentials

$username = '<USERNAME>';
$password = '<PASSWORD>';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;

Instanciate Distributed Component Object MOdel (DCOM)

$options = New-CimSessionOption -Protocol DCOM
$session = New-Cimsession -ComputerName <RHOST> -Credential $credential -SessionOption $Options 
$command = 'cmd';
Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};

Establish a Reverse shell

revshell_encoder.py

Payload Encoding

Execution

Windows Remote Shell (WinRS)

Prerequisites

User needs to be part of the Administrators or Remote Management Users group on the target host

Execution

PowerShell

MSSQL (Port 1397)

Find mssql access

Users with SQLAdmin (BloodHound)

Log in

Local User

ClearText Password

Interactive Shell

Pseudo-shell (file write and read)

Protocols

NTLM Hash

Pass the Hash (PTH)

Interactive Shell

Pseudo-shell (file write and read)

Protocols

Kerberos

Overpass the Hash

We load mimikatz to grab the ntlm hash of the user that we are going to craft a kerberos ticket

The essence of the overpass the hash lateral movement technique is to turn the NTLM hash into a Kerberos ticket and avoid the use of NTLM authentication. A simple way to do this is with the sekurlsa::pth command from Mimikatz.

Let's list the cached Kerberos tickets with klist.

No Kerberos tickets have been cached, but this is expected since jen has not yet performed an interactive login. Let's generate a TGT by authenticating to a network share on the server with net use.

Let's confirm that now we have the ticket

Let's try that now, running .\PsExec.exe to launch cmd remotely on the machine as the user.

Pass the Ticket (ccache / kirbi)

PreRequisites

Export an already existing ticket of a user

The above command parsed the LSASS process space in memory for any TGT/TGS, which is then saved to disk in the kirbi mimikatz format.

We can verify newly generated tickets with dir, filtering out on the kirbi extension

As many tickets have been generated, we can just pick any TGS ticket in the user@rhost.kirbi format and inject it through mimikatz via the kerberos::ptt command.

We should expect the ticket in our session when running klist.

Distributed Component Object Model (DCOM)

Prerequisites

Elevated PowerShell session

Creating and storing the Distributed Component Object Model

Last updated