Lateral movement

Remote powershell session

Stateless

PS C:\Users\Administrator> Enter-PSSession -ComputerName WIN10RAMO.acero.local
[WIN10RAMO.acero.local]: PS C:\Users\Administrator\Documents> exit

Stateful

PS C:\Users\Administrator> $sess = New-PSSession -ComputerName WIN10RAMO.acero.local
PS C:\Users\Administrator> $sess

 Id Name            ComputerName    ComputerType    State         ConfigurationName     Availability
 -- ----            ------------    ------------    -----         -----------------     ------------
  5 Session5        WIN10RAMO.ac... RemoteMachine   Opened        Microsoft.PowerShell     Available

(Bulk) Remote Command Execution

PS C:\Users\Administrator> Invoke-Command -ComputerName WIN10RAMO.acero.local -ScriptBlock{whoami}
acero\administrator
PS C:\Users\Administrator> Invoke-Command -ComputerName WIN10RAMO.acero.local -ScriptBlock{whoami;hostname}
acero\administrator
win10ramo

Get-Content is cmdlet for passing a list of server to the command:

Execute PowerShell Script:

Execute PowerShell Script in a specific Session:

Disable Windows Defender (Windows Server 2016)

Last updated

Was this helpful?