Getting Access

Lateral Movement

PowerShell Remoting

#Enable Powershell Remoting on current Machine (Needs Admin Access)
Enable-PSRemoting

#Entering or Starting a new PSSession (Needs Admin Access)
$sess = New-PSSession -ComputerName $ComputerName>
Enter-PSSession -ComputerName $ComputerName 
#-OR-
Enter-PSSession -Sessions $SessionName

Remote Code Execution with PS Credentials

$SecPassword = ConvertTo-SecureString '$Password' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('$DomainName\$User', $SecPassword)
Invoke-Command -ComputerName $ComputerName -Credential $Cred -ScriptBlock {whoami /all}

Import a PowerShell module and execute its functions remotely

Executing Remote Stateful commands

Useful Tools

  • Powercat netcat written in powershell, and provides tunneling, relay and portforward capabilities.

  • SCShell fileless lateral movement tool that relies on ChangeServiceConfigA to run command

  • Evil-Winrm the ultimate WinRM shell for hacking/pentesting

  • RunasCs Csharp and open version of windows builtin runas.exe

Last updated