PHPCMS V9 (plugin.php)本地文件包含漏洞hellxman

影响版本:
PHPCMS V9.1.8 (20111014)
漏洞描述:
由于文件/plugin.php对于用户提交的变量未过滤,导致本地文件包含漏洞的产生。相关代码如下:文件plugin.phpif(isset($_GET['id'])) {	list($identification, $filename,$action) = explode('-', $_GET['id']);	$filename = !empty($filename) ? $filename : $identification;	$action = !empty($action) ? $action : 'init';}$cache = getcache($identification,'plugins');变量$identification的值来源于$_GET['id'],并进入函数getcache中Getcache函数在文件/ phpcms/libs/functions/ global.func.php中function getcache($name, $filepath='', $type='file', $config='') {	pc_base::load_sys_class('cache_factory','',0);	if($config) {		$cacheconfig = pc_base::load_config('cache');		$cache = cache_factory::get_instance($cacheconfig)->get_cache($config);	} else {		$cache = cache_factory::get_instance()->get_cache($type);	}	return $cache->get($name, '', '', $filepath);}$cache->get()在文件/phpcms/libs/classes/cache_file.class.phppublic function get($name, $setting = '', $type = 'data', $module = ROUTE_M) {		$this->get_setting($setting);		if(empty($type)) $type = 'data';		if(empty($module)) $module = ROUTE_M;		$filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/';		$filename = $name.$this->_setting['suf'];		if (!file_exists($filepath.$filename)) {			return false;		} else {		    if($this->_setting['type'] == 'array') {		    	$data = @require($filepath.$filename);最终$_GET['id']变量变为$filename的一部分
测试方法:
本站提供程序(方法)可能带有***性,仅供安全研究与教学之用,风险自负!
 
   
  1.  
  2. http://hellxman.blog.51cto.com/phpcms/plugin.php?id=可控文件名-1-1:

转载于:https://blog.51cto.com/hellxman/741949

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值