90_ 发表于 2015-9-17 00:40:04

MACcms通杀型后台拿shell

90sec@Joseph

此漏洞的缘由是来自论坛的一哥们求助拿shell才无奈的去审计

看见这个模块编辑就总感觉有漏洞存在当然这里并没有想象的那么简单,咱们之前遇到的模版编辑漏洞已经在这个版本修复了
漏洞文件:
elseif($method=='save')
{
    $path = be('post','path'); $path = str_replace('\\','/',$path);
    $file =  be('post','file'); $file = str_replace('\\','/',$file);
    $filename = be('post','filename');
    $suffix = be('post','suffix');
    $filecontent =  stripslashes(be('post','filecontent'));
    if(isN($path)){
        if (substring($file,11)!='../template' || count( explode('../',$file) ) > 2) {
            showErr('System','非法目录请求');
            return;
        }
        if(!file_exists($file)){
            showErr('System','非法文件请求');
            return;
        }
        fwrite(fopen($file.$suffix,'wb'),$filecontent);
    }
    else{
        if (substring($path,11)!='../template' || count( explode('../',$path) ) > 2) {
            showErr('System','非法目录请求');
            return;
        }
        $extarr = array('.html','.htm','.js','.xml','.wml');
        if(!in_array($suffix,$extarr)){
            $suffix='.html';
        }
         
        fwrite(fopen($path.'/'.$filename.$suffix,'wb'),$filecontent);
    }
    showMsg('文件内容保存完毕','');
}
获取自定义的文件名和内容和路径然后一个if判断path是否为空,如果为空则进入漏洞,不为空则没有漏洞
所以这里burp抓包把path的值给清楚了,然后添加这个suffix参数为我们想要的文件名

yusiii 发表于 2015-9-17 06:00:26

还是不错的哦,顶了

蓝颜 发表于 2015-9-17 08:56:38

谢谢分享               

云游者 发表于 2015-9-17 18:59:57

支持中国红客联盟(ihonker.org)

wanmznh 发表于 2015-9-18 05:15:00

学习学习技术,加油!

perble 发表于 2015-9-18 17:13:02

学习学习技术,加油!
页: [1]
查看完整版本: MACcms通杀型后台拿shell