edit_note帖子
1,551
stars积分
20,071
event加入
2011-05-19
怀旧国机
PHPCMS V9 任意文件包含漏洞
schedule发表于 2013-06-23 03:39:00
visibility查看 163
chat_bubble回复 2
#1 楼主
简要描述:
某处考虑不严谨,有可能导致文件包含漏洞。
利用条件:register_global=ON
详细说明:
漏洞文件:/plugin.php
漏洞代码:22行
触发条件:register_global=ON
代码片段:15到22行
if(isset($$$$_GET[‘id‘])) {
if(!preg_match(“/^[a-z0-9_\-]+$$$$/i“,$$$$_GET[‘id‘])) showmessage((L(‘illegal_parameters‘)));
list($$$$identification, $$$$filename,$$$$action) = explode(‘-‘, $$$$_GET[‘id‘]);
$$$$filename = !empty($$$$filename) ? $$$$filename : $$$$identification;
$$$$action = !empty($$$$action) ? $$$$action : ‘init‘;
}
$$$$cache = getcache($$$$identification,‘plugins‘);
因为只有if(isset($$$$_GET[‘id‘]))的情况下,$$$$identification变量才会被初始化,
因此请求时,不提交$$$$_GET[‘id‘],直接identification=./xxxx/xxxx/xxx.php%00
同时利用长文件名截断或%00截断,可以完美利用此漏洞、
神马?还不完美?不能包含木马文件?
好吧,我们再看回以前的一个漏洞: WooYun: PHPCMS V9 getwebshell漏洞
无需任意权限,此修复后依旧可以直接上传图片,此文件包含漏洞加上老的文件上传漏洞,还有什么做不到的。
漏洞证明:
漏洞文件:/plugin.php
漏洞代码:22行
触发条件:register_global=ON
代码片段:15到22行
if(isset($$$$_GET[‘id‘])) {
if(!preg_match(“/^[a-z0-9_\-]+$$$$/i“,$$$$_GET[‘id‘])) showmessage((L(‘illegal_parameters‘)));
list($$$$identification, $$$$filename,$$$$action) = explode(‘-‘, $$$$_GET[‘id‘]);
$$$$filename = !empty($$$$filename) ? $$$$filename : $$$$identification;
$$$$action = !empty($$$$action) ? $$$$action : ‘init‘;
}
$$$$cache = getcache($$$$identification,‘plugins‘);
修复方案:
无
某处考虑不严谨,有可能导致文件包含漏洞。
利用条件:register_global=ON
详细说明:
漏洞文件:/plugin.php
漏洞代码:22行
触发条件:register_global=ON
代码片段:15到22行
if(isset($$$$_GET[‘id‘])) {
if(!preg_match(“/^[a-z0-9_\-]+$$$$/i“,$$$$_GET[‘id‘])) showmessage((L(‘illegal_parameters‘)));
list($$$$identification, $$$$filename,$$$$action) = explode(‘-‘, $$$$_GET[‘id‘]);
$$$$filename = !empty($$$$filename) ? $$$$filename : $$$$identification;
$$$$action = !empty($$$$action) ? $$$$action : ‘init‘;
}
$$$$cache = getcache($$$$identification,‘plugins‘);
因为只有if(isset($$$$_GET[‘id‘]))的情况下,$$$$identification变量才会被初始化,
因此请求时,不提交$$$$_GET[‘id‘],直接identification=./xxxx/xxxx/xxx.php%00
同时利用长文件名截断或%00截断,可以完美利用此漏洞、
神马?还不完美?不能包含木马文件?
好吧,我们再看回以前的一个漏洞: WooYun: PHPCMS V9 getwebshell漏洞
无需任意权限,此修复后依旧可以直接上传图片,此文件包含漏洞加上老的文件上传漏洞,还有什么做不到的。
漏洞证明:
漏洞文件:/plugin.php
漏洞代码:22行
触发条件:register_global=ON
代码片段:15到22行
if(isset($$$$_GET[‘id‘])) {
if(!preg_match(“/^[a-z0-9_\-]+$$$$/i“,$$$$_GET[‘id‘])) showmessage((L(‘illegal_parameters‘)));
list($$$$identification, $$$$filename,$$$$action) = explode(‘-‘, $$$$_GET[‘id‘]);
$$$$filename = !empty($$$$filename) ? $$$$filename : $$$$identification;
$$$$action = !empty($$$$action) ? $$$$action : ‘init‘;
}
$$$$cache = getcache($$$$identification,‘plugins‘);
修复方案:
无
全部回复 (2)
2013-06-23 03:50:00
沙发
111
2013-06-23 10:30:00
板凳
呃呃呃
登录 后才能回复
flag举报帖子