### 简要描述:
更新日期: 2014-05-19 12:17:29
。。可以修改管理密码 但是修改的密码是不可控的。
还是老老实实注入把。
### 详细说明:
在api/uc.php中
```
if(!defined('IN_UC')) {
require_once '../app_comm.php';
require_once S_ROOT.'/config/config_ucenter.php';
$get = $post = array();
$code = @$_GET['code'];
parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
if(DEBUGUC==TRUE){
$get['realtime'] = date('Y-m-d H:i:s', $get['time']);
file_put_contents(S_ROOT.'/data/log/uc_client_log.txt', var_export ( $get, 1), FILE_APPEND);
}
if(time() - $get['time'] > 3600) {
exit('Authracation has expiried');
}
if(empty($get)) {
exit('Invalid Request');
}
include_once S_ROOT.'/uc_client/lib/xml.class.php';
$post = xml_unserialize(file_get_contents('php://input'));
```
默认的uckey为123456.
在直接用uckey getshell发现
```
if($post['UC_API']) {
$UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
unset($post['UC_API']);
}
```
还是来注入把
```
function updatepw($get, $post) {
global $_G;
if(!API_UPDATEPW) {
return API_RETURN_FORBIDDEN;
}
$newpw = md5(time().rand(100000, 999999));
db_factory::updatetable(TABLEPRE.'witkey_space', array('password'=>$newpw), array('username'=>$get['username']));
db_factory::updatetable(TABLEPRE.'witkey_member', array('password'=>$newpw), array('username'=>$get['username']));
return API_RETURN_SUCCEED;
}
```
调用这函数。 但是$newpw 是不可控的。。
也即使时间戳+随机的。 要修改的用户的名字是可控的。
所以可以修改任意用户的密码。。。 但是密码不可控
这样比较麻烦啊。 还是来注入把。
调用authcode生成一下语句。
```
function updatepw($get, $post) {
global $_G;
if(!API_UPDATEPW) {
return API_RETURN_FORBIDDEN;
}
$newpw = md5(time().rand(100000, 999999));
db_factory::updatetable(TABLEPRE.'witkey_space', array('password'=>$newpw), array('username'=>$get['username']));
db_factory::updatetable(TABLEPRE.'witkey_member', array('password'=>$newpw), array('username'=>$get['username']));
return API_RETURN_SUCCEED;
}
```
调用这个函数
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201405/232241038674aaa1a835065debd208d111bc99ab.jpg" alt="k1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/232241038674aaa1a835065debd208d111bc99ab.jpg)
[<img src="https://images.seebug.org/upload/201405/23224122611a79a76ac3faad48b381d37560bfbe.jpg" alt="k2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/23224122611a79a76ac3faad48b381d37560bfbe.jpg)
暂无评论