### 简要描述:
听了一晚上7师傅 根本停不下来
### 详细说明:
KPPW最新版
漏洞出现在一个函数
/lib/inc/keke_table_class.php
第75-87行:
```
function del($pk, $val, $url = null) {
if (! $val) {
return false;
}
if (is_array ( $val ) && ! empty ( $val )) {
$ids = implode ( ',', $val );
$this->_table_obj->setWhere ( " $pk in ($ids)" );
} elseif ($val) {
$this->_table_obj->setWhere ( "$pk = " . $val );
}
$del_query = "del_" . $this->_pre . $this->_table_name;
return $this->_table_obj->$del_query ();
}
```
可看到$val 传进来只要不是数组且存在就会走elseif分支
之后直接 未做'保护进入sql语句
找找 调用点
/control/user/message_detail.php
/control/user/message_notice.php
存在调用且有问题
2个类似 以第一个为例
/control/user/message_detail.php
第9-16行:
```
if (isset ( $action )&&$action=='delSingle') {
if ($msgId) {
$objMsgT->del ( 'msg_id', $msgId );
kekezu::show_msg ( '删除成功', 'index.php?do=user&view=message&op='.$type.'&intPage='.$intPage, NULL, NULL, 'ok' );
} else {
kekezu::show_msg ( '删除失败', NULL, NULL, NULL, 'error' );
}
}
```
$msg_id直接进入函数 而$msg_id是post进来且未做任何过滤的
### 漏洞证明:
创建一个用户 给其他用户发一个消息
[<img src="https://images.seebug.org/upload/201411/24052310aa46ddba43daa38878d6336ad213792e.jpg" alt="11.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/24052310aa46ddba43daa38878d6336ad213792e.jpg)
[<img src="https://images.seebug.org/upload/201411/240524145378a6083e93e53aa5f9ba8216de7362.jpg" alt="22.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/240524145378a6083e93e53aa5f9ba8216de7362.jpg)
[<img src="https://images.seebug.org/upload/201411/24052458b67584ed02c873acc38b70966524385b.jpg" alt="33.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/24052458b67584ed02c873acc38b70966524385b.jpg)
传上点击查看进去 删除抓包 改包成如下 特别要把空格替换成/**/ 否则不成
[<img src="https://images.seebug.org/upload/201411/2405251402a7d0e9c8a8f12cf68076ce839d4afd.jpg" alt="44.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/2405251402a7d0e9c8a8f12cf68076ce839d4afd.jpg)
发包之后会显示 服务器繁忙 无视之 在查看我的发件箱 直接在当前界面删除(第一次和第二次 是在2个不同地方删除) 便可删除
[<img src="https://images.seebug.org/upload/201411/24052630a3276f497c631279d5ce7b148c7121e6.jpg" alt="55.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/24052630a3276f497c631279d5ce7b148c7121e6.jpg)
查看mysql日志
[<img src="https://images.seebug.org/upload/201411/24052809a4fdf4918f6d7cd7307458406dfa8be3.jpg" alt="66.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/24052809a4fdf4918f6d7cd7307458406dfa8be3.jpg)
执行sql语句了
[<img src="https://images.seebug.org/upload/201411/24052840e7df6700f0d7a277fe7e86450c818fa0.jpg" alt="77.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/24052840e7df6700f0d7a277fe7e86450c818fa0.jpg)
亲测可删除 网站所有 信息
暂无评论