乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2014-07-03: 细节已通知厂商并且等待厂商处理中 2014-07-04: 厂商已经确认,细节仅向厂商公开 2014-07-07: 细节向第三方安全合作伙伴开放 2014-08-28: 细节向核心白帽子及相关领域专家公开 2014-09-07: 细节向普通白帽子公开 2014-09-17: 细节向实习白帽子公开 2014-10-01: 细节向公众公开
这个小的cms刚问世,我就测了下。感觉还是不错。但是百密终有一疏。注入啊……
/app/model/moduleModel.php 文件中 search函数是前台做搜索用的。具体看代码public function search($arrays,$field="",$num="20"){ // var_dump($arrays); //var_dump($field); //die; if($arrays['project']){ $sql='select * from `'.DB_PREFIX.$arrays['project'].'` where title like "%'.$arrays['tags'].'%" or tags like "%'.$arrays['tags'].'%"'; // var_dump($sql); //die; return arraypage(D($this->d_name)->excsql($sql.' order by id desc'),$num); }else{ $arr=D($this->d_name)->field("project")->where("type=1&&search=1")->getall(); if(count($arr)>1)$union="union"; foreach($arr as $k => $v){ if($this->attrib($v['project'],'tags')){ $array[]='select '.$this->fieldhandle($field).'id,title,html,time from `'.DB_PREFIX.$v['project'].'` where title like "%'.$arrays['tags'].'%" or tags like "%'.$arrays['tags'].'%" and status=1'; }else{ $array[]='select '.$this->fieldhandle($field).'id,title,html,time from `'.DB_PREFIX.$v['project'].'` where title like "%'.$arrays['tags'].'%" and status=1'; } } return arraypage(D($this->d_name)->excsql("select * from (".implode(" union ",$array).") h order by time desc"),$num); } }这段代码中最终调用了D($this->d_name)->excsql()来执行sql语句。通过跟踪发现。excsql这个函数位于/system/core/model.php中。函数如下:public function excsql($sql){ return $this->db->fetch($this->db->query($sql)); }可以看到直接调用了数据库中的query查询。而此处的query位于/system/driver/db_mysqli.php中。函数如下:public function query($sql){ // 验证连接是否正确 if (!$this->is_links())return throwexce(sprintf('Supplied argument is not a valid MySQLI-Link resource.')); $this->query_id = mysqli_query($this->link_id,$sql);可以看到最后一句直接调用了mysqli_query()执行了sql语句。虽然此cms用了全局过滤的方法来防范sql注入。但是这个地方全局过滤是不起作用的。因为第一:整个查询没有用到单引号,而是用了双引号。即使此处用了单引号也还是不起作用。因为你们查询的时候是通过html模板传过来的。全局过滤没注意到这个地方。所以造成了注入。具体利用看漏洞证明。
mysql的监控日志中得到的。可以看到语句确实被带入了可以执行。
通过构造可以爆出管理员密码等信息
你们应该懂%…………
危害等级:中
漏洞Rank:10
确认时间:2014-07-04 10:45
感谢您对FENGCMS的支持……
暂无