Windows Remote Management (WinRM)
MITRE ATT&CK, Lateral Movement, Sub-technique T1021.006
Enabling PowerShell Remoting
In a PowerShell console running as administrator enable PowerShell Remoting:
Enable-PSRemoting –forceSet WinRM start mode to automatic:
Set-Service WinRM -StartMode AutomaticVerify start mode and state:
Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"}Set Remote Hosts to Trusted
Configure all hosts to be trusted:
Set-Item WSMan:localhost\client\trustedhosts -value *Validate trusted hosts configuration:
Get-Item WSMan:\localhost\Client\TrustedHostsEstablishing a Session
Interactive session using the current user:
Enter-PsSession –ComputerName $hostInteractive session with explicit credentials:
Create a background session using the current user::
Create a background session with explicit credentials:
List background sessions:
Interacting with a background session:
Exiting out of a session:
Remove all background sessions:
References
Last updated