乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2014-11-07: 积极联系厂商并且等待厂商认领中,细节不对外公开 2015-02-05: 厂商已经主动忽略漏洞,细节向公众公开
飞飞影视最新版前台无限制getshell v2.9
任意文件包含:demo站测试:
代码分析:myaction.class.php
<?phpclass MyAction extends HomeAction{ public function show(){ $id = !empty($_GET['id'])?$_GET['id']:'new'; echo $id; echo '1111111111111111111111111111'; $this->display('my_'.trim($id)); echo $id; echo '11111111111111111111111'; } }?>
$id变量来自于get,之后传到了display函数。display第一个参数是模板名称。跟踪display函数,流程比较多。最后传递到fetch函数如下:view.class.php
public function fetch($templateFile='',$charset='',$contentType='',$display=false) { //die('errorcode'); echo 'fetch'; G('_viewStartTime'); // 使用null参数作为模版名直接返回不做任何输出 if(null===$templateFile) return; // 网页字符编码 if(empty($charset)) $charset = C('DEFAULT_CHARSET'); if(empty($contentType)) $contentType = C('TMPL_CONTENT_TYPE'); header("Content-Type:".$contentType."; charset=".$charset); header("Cache-control: private"); //支持页面回跳 header("X-Powered-By:ThinkPHP".THINK_VERSION); //页面缓存 ob_start(); ob_implicit_flush(0); // 自动定位模板文件 echo $templateFile;//edit by test //die(); echo file_exists_case($templateFile); if(!file_exists_case($templateFile)) echo '1111111111111'; //echo $templateFile.'code';//edit by test $templateFile = $this->parseTemplateFile($templateFile); $engine = strtolower(C('TMPL_ENGINE_TYPE')); echo $engine; if('php'==$engine) { // 模板阵列变量分解成为独立变量 extract($this->tVar, EXTR_OVERWRITE); // 直接载入PHP模板 include $templateFile; }elseif('think'==$engine && $this->checkCache($templateFile)) { // 如果是Think模板引擎并且缓存有效 分解变量并载入模板缓存 extract($this->tVar, EXTR_OVERWRITE); //载入模版缓存文件 //include C('CACHE_PATH').md5($templateFile).C('TMPL_CACHFILE_SUFFIX'); }else{ // 模板文件需要重新编译 支持第三方模板引擎 // 调用模板引擎解析和输出 $className = 'Template'.ucwords($engine); require_cache(THINK_PATH.'/Lib/Think/Util/Template/'.$className.'.class.php'); $tpl = new $className; $tpl->fetch($templateFile,$this->tVar,$charset); } $this->templateFile = $templateFile; // 获取并清空缓存 $content = ob_get_clean(); // 模板内容替换 $content = $this->templateContentReplace($content); // 布局模板解析 $content = $this->layout($content,$charset,$contentType); // 输出模板文件 return $this->output($content,$display); } /**
需要继续跟到这里模板类的fetch函数
// 模板文件需要重新编译 支持第三方模板引擎 // 调用模板引擎解析和输出 $className = 'Template'.ucwords($engine); require_cache(THINK_PATH.'/Lib/Think/Util/Template/'.$className.'.class.php'); $tpl = new $className; $tpl->fetch($templateFile,$this->tVar,$charset);
模板类的fetch函数最后调用了load函数,其中包含了最开始找到的$id变量。load函数,直接include。
public function load($templateFile,$templateVar,$charset) { $this->tVar = $templateVar; $templateCacheFile = $this->loadTemplate($templateFile); // 模板阵列变量分解成为独立变量 extract($templateVar, EXTR_OVERWRITE); //载入模版缓存文件 include $templateCacheFile; }
看之前的漏洞,说是这个站是官方demo,拿来测试一下。先利用日志记录,写入payload。之后包含日志文件。
未能联系到厂商或者厂商积极拒绝