### 简要描述: 我这么认真,你们还是给我点对应的rank吧 ### 详细说明: 算上关联的函数,本来还有很多的,我自己也没有找了, 我测试的是utf版本的,你们gbk版本由于这个问题已经炸了,希望好好审查 下面我拿 control\user\message_send.php文件举例,同样问题的我找的还有 message.php,yijia.php ``` <?php defined ( 'IN_KEKE' ) or exit('Access Denied'); $strUrl = 'index.php?do=user&view=message&op=send'; if (isset ( $formhash ) && kekezu::submitcheck ( $formhash )) { $title = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($title) ))) ; $content = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($content) ))) ; $objMsgM = new Keke_witkey_msg_class (); if (strtoupper ( CHARSET ) == 'GBK') { $to_username = kekezu::utftogbk($to_username ); } $arrSpaceInfo = kekezu::get_user_info ( $to_username, 1 ); if (! $arrSpaceInfo) { $tips['errors']['to_username'] = '用户不存在'; kekezu::show_msg($tips,NULL,NULL,NULL,'error'); } if ($arrSpaceInfo ['uid'] == $gUid) { $tips['errors']['to_username'] = '无法给自己发送'; kekezu::show_msg ( $tips, NULL, NULL, NULL, 'error' ); } if...
### 简要描述: 我这么认真,你们还是给我点对应的rank吧 ### 详细说明: 算上关联的函数,本来还有很多的,我自己也没有找了, 我测试的是utf版本的,你们gbk版本由于这个问题已经炸了,希望好好审查 下面我拿 control\user\message_send.php文件举例,同样问题的我找的还有 message.php,yijia.php ``` <?php defined ( 'IN_KEKE' ) or exit('Access Denied'); $strUrl = 'index.php?do=user&view=message&op=send'; if (isset ( $formhash ) && kekezu::submitcheck ( $formhash )) { $title = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($title) ))) ; $content = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($content) ))) ; $objMsgM = new Keke_witkey_msg_class (); if (strtoupper ( CHARSET ) == 'GBK') { $to_username = kekezu::utftogbk($to_username ); } $arrSpaceInfo = kekezu::get_user_info ( $to_username, 1 ); if (! $arrSpaceInfo) { $tips['errors']['to_username'] = '用户不存在'; kekezu::show_msg($tips,NULL,NULL,NULL,'error'); } if ($arrSpaceInfo ['uid'] == $gUid) { $tips['errors']['to_username'] = '无法给自己发送'; kekezu::show_msg ( $tips, NULL, NULL, NULL, 'error' ); } if (strtoupper ( CHARSET ) == 'GBK') { $title = kekezu::utftogbk($title ); $content = kekezu::utftogbk($content ); } $objMsgM->setUid ( $gUid ); $objMsgM->setUsername ( $username ); $objMsgM->setTo_uid ( $arrSpaceInfo ['uid'] ); $objMsgM->setTo_username ( $arrSpaceInfo ['username'] ); $objMsgM->setTitle ($title ); $objMsgM->setContent ($content); $objMsgM->setOn_time ( time () ); $objMsgM->create_keke_witkey_msg (); unset ( $objMsgM ); kekezu::show_msg ( '已保存', 'index.php?do=user&view=message&op=outbox', NULL, NULL, 'ok' ); }else{ $objUid and $intObjUid = intval($objUid); $arrObjInfo = kekezu::get_user_info ( $intObjUid); } ``` 我们跟进 utftogbk() /lib/inc/keke_base_class.php ``` static function utftogbk($string) { $string = self::charset_encode ( "utf-8", "gbk", $string ); return $string; } ``` 继续 ``` static function charset_encode($_input_charset, $_output_charset, $input) { $output = ""; $string = $input; if (is_array ( $input )) { $key = array_keys ( $string ); $size = sizeof ( $key ); for($i = 0; $i < $size; $i ++) { $string [$key [$i]] = self::charset_encode ( $_input_charset, $_output_charset, $string [$key [$i]] ); } return $string; } else { if (! isset ( $_output_charset )) $_output_charset = $_input_charset; if ($_input_charset == $_output_charset || $input == null) { $output = $input; } elseif (function_exists ( "mb_convert_encoding" )) { $output = mb_convert_encoding ( $input, $_output_charset, $_input_charset ); } elseif (function_exists ( "iconv" )) { $output = iconv ( $_input_charset, $_output_charset, $input ); } else die ( "sorry, you have no libs support for charset change." ); return $output; } } ``` iconv()函数,哈哈 我们随便注册个账号登陆 进入发消息界面 这里我们需要把发消息的对象填正确 下面的标题,内容随便你选哪个,我这里方便闭合,选择内容 对象 admin(默认存在) 标题 111111 内容 123錦'and sleep(1),123)# 这里必须用#注释,%23是无效的 [<img src="https://images.seebug.org/upload/201510/1720360312fdd180217d5d38aebae98fa16c051d.png" alt="QQ截图20151017183604.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201510/1720360312fdd180217d5d38aebae98fa16c051d.png) [<img src="https://images.seebug.org/upload/201510/172036204066fe88c01519883a58bafd4bc816fd.png" alt="QQ截图20151017183434.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201510/172036204066fe88c01519883a58bafd4bc816fd.png) 成功 sleep() 本来很多的没有刷了,希望上个首页,么么哒 ### 漏洞证明: 算上关联的函数,本来还有很多的,我自己也没有找了, 我测试的是utf版本的,你们gbk版本由于这个问题已经炸了,希望好好审查 下面我拿 control\user\message_send.php文件举例,同样问题的我找的还有 message.php,yijia.php ``` <?php defined ( 'IN_KEKE' ) or exit('Access Denied'); $strUrl = 'index.php?do=user&view=message&op=send'; if (isset ( $formhash ) && kekezu::submitcheck ( $formhash )) { $title = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($title) ))) ; $content = kekezu::str_filter ( kekezu::escape (strip_tags(htmlspecialchars_decode($content) ))) ; $objMsgM = new Keke_witkey_msg_class (); if (strtoupper ( CHARSET ) == 'GBK') { $to_username = kekezu::utftogbk($to_username ); } $arrSpaceInfo = kekezu::get_user_info ( $to_username, 1 ); if (! $arrSpaceInfo) { $tips['errors']['to_username'] = '用户不存在'; kekezu::show_msg($tips,NULL,NULL,NULL,'error'); } if ($arrSpaceInfo ['uid'] == $gUid) { $tips['errors']['to_username'] = '无法给自己发送'; kekezu::show_msg ( $tips, NULL, NULL, NULL, 'error' ); } if (strtoupper ( CHARSET ) == 'GBK') { $title = kekezu::utftogbk($title ); $content = kekezu::utftogbk($content ); } $objMsgM->setUid ( $gUid ); $objMsgM->setUsername ( $username ); $objMsgM->setTo_uid ( $arrSpaceInfo ['uid'] ); $objMsgM->setTo_username ( $arrSpaceInfo ['username'] ); $objMsgM->setTitle ($title ); $objMsgM->setContent ($content); $objMsgM->setOn_time ( time () ); $objMsgM->create_keke_witkey_msg (); unset ( $objMsgM ); kekezu::show_msg ( '已保存', 'index.php?do=user&view=message&op=outbox', NULL, NULL, 'ok' ); }else{ $objUid and $intObjUid = intval($objUid); $arrObjInfo = kekezu::get_user_info ( $intObjUid); } ``` 我们跟进 utftogbk() /lib/inc/keke_base_class.php ``` static function utftogbk($string) { $string = self::charset_encode ( "utf-8", "gbk", $string ); return $string; } ``` 继续 ``` static function charset_encode($_input_charset, $_output_charset, $input) { $output = ""; $string = $input; if (is_array ( $input )) { $key = array_keys ( $string ); $size = sizeof ( $key ); for($i = 0; $i < $size; $i ++) { $string [$key [$i]] = self::charset_encode ( $_input_charset, $_output_charset, $string [$key [$i]] ); } return $string; } else { if (! isset ( $_output_charset )) $_output_charset = $_input_charset; if ($_input_charset == $_output_charset || $input == null) { $output = $input; } elseif (function_exists ( "mb_convert_encoding" )) { $output = mb_convert_encoding ( $input, $_output_charset, $_input_charset ); } elseif (function_exists ( "iconv" )) { $output = iconv ( $_input_charset, $_output_charset, $input ); } else die ( "sorry, you have no libs support for charset change." ); return $output; } } ``` iconv()函数,哈哈 我们随便注册个账号登陆 进入发消息界面 这里我们需要把发消息的对象填正确 下面的标题,内容随便你选哪个,我这里方便闭合,选择内容 对象 admin(默认存在) 标题 111111 内容 123錦'and sleep(1),123)# 这里必须用#注释,%23是无效的 [<img src="https://images.seebug.org/upload/201510/1720360312fdd180217d5d38aebae98fa16c051d.png" alt="QQ截图20151017183604.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201510/1720360312fdd180217d5d38aebae98fa16c051d.png) [<img src="https://images.seebug.org/upload/201510/172036204066fe88c01519883a58bafd4bc816fd.png" alt="QQ截图20151017183434.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201510/172036204066fe88c01519883a58bafd4bc816fd.png) 成功 sleep()