百度反推算法PHP代碼

前段時(shí)間百度反推很火,我在某個(gè)算法交流群里呆了數(shù)天都沒看出個(gè)所以然來。沒想到幾天沒有上線百度反推都出來了。
在發(fā)布百度反推軟件之前,先把曹操之前搜集到的百度反推PHP發(fā)布出來看看。
代碼僅供參考思路,實(shí)際上經(jīng)過測試發(fā)現(xiàn)已經(jīng)無法通過解析出來的地址實(shí)現(xiàn)跳轉(zhuǎn)。
百度反推PHP轉(zhuǎn)換代碼一
使用方法:修改函數(shù)url的值為自己url,即可生成對應(yīng)的百度快照url。
<html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> </head> <body> <?php //$ascii碼表x,y位置 $ascii = array( 0=>array(' ','!','"','#','$','%','&',''','(',')','*','+',',','-','.','/'), 1=>array('0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?'), 2=>array('@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O'), 3=>array('P','Q','R','S','T','U','V','W','X','Y','Z','[','\',']','^','_'), 4=>array('`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'), 5=>array('p','q','r','s','t','u','v','w','x','y','z','{','|','}','~',' '),); //url第N個(gè)位置對應(yīng)的(x,y),目前只得到80位的url $data = array( array(13,10), array(10,1), array(16,15), array(7,6), array(5,13), array(18,9), array(13,11), array(7,12), array(10,5), array(15,9), array(15,9), array(13,5), array(16,11), array(0,1), array(8,2), array(8,5), array(0,0), array(17,15), array(14,8), array(2,1), array(10,5), array(17,14), array(16,5), array(3,8), array(14,9), array(5,8), array(15,1), array(3,15), array(13,10), array(10,12), array(5,7), array(0,2), array(18,14), array(0,15), array(1,6), array(13,5), array(2,1), array(15,14), array(18,8), array(18,9), array(1,10), array(14,14), array(13,2), array(5,3), array(5,8), array(0,4), array(1,5), array(16,1), array(8,1), array(2,5), array(10,7), array(10,15), array(14,14), array(17,3), array(15,0), array(14,5), array(7,7), array(3,4), array(14,8), array(12,0), array(13,12), array(12,3), array(6,5), array(3,1), array(1,14), array(5,4), array(0,12), array(7,0), array(10,7), array(15,12), array(8,2), array(18,15), array(3,12), array(1,12), array(0,15), array(17,4), array(17,2), array(11,1), array(3,12), array(11,5), array(0,13), array(1,1), array(2,12) ); //所有的y值 $y = array( 0=> '0123456789abcdef', '1032547698badcfe', '23016745ab89efcd', '32107654ba98fedc', '45670123cdef89ab', '54761032dcfe98ba', '67452301efcdab89', '76543210fedcba98', '89abcdef01234567', '98badcfe10325476', 'ab89efcd23016745', 'ba98fedc32107654', 'cdef89ab45670123', 'dcfe98ba54761032', 'efcdab8967452301', 'fedcba9876543210' ); //所有的x值 $x = array( 0=> '016745', '107654', '234567', '321076', '325476', '452301', '543210', '670123', '765432', '761032', '89abcd', '89efcd', '98fedc', 'abcdef', 'badcfe', 'cdab89', 'dcba98', 'ef89ab', 'fe98ba' ); //解密過程: $domain = "www.yetiskinlerchat.com"; $len = strlen($domain); for($i=0;$i<$len;$i++){ $domain_one = substr($domain,$i,1);//輸出el $arr_x = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'); $arr_y = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'); for($ax =0;$ax<sizeof($arr_x);$ax++){ for($ay =0;$ay<sizeof($arr_y);$ay++){ //讀取每一組密文的x 和 y $one = array($arr_x[$ax],$arr_y[$ay]);//str_split($v); $encode_x = $one[0]; //f $encode_y = $one[1]; //d //得到第$k位的data $this_data_x = str_split($x[$data[$i][0]]); // $data[$k]=13,10 [0] = $x[13] $this_data_y = str_split($y[$data[$i][1]]); // $data[$k]=13,10 [1] = $y[10] //得到在ascii碼表的x,y $real_x = array_search($encode_x,$this_data_x); //5 $real_y = array_search($encode_y,$this_data_y); //7 3 //結(jié)果 $result = $ascii[$real_x][$real_y]; if($result == $domain_one ){ $mi .= $arr_x[$ax].$arr_y[$ay]; $url .= $result; echo '密文對應(yīng):'.$arr_x[$ax].$arr_y[$ay].'----'.$result."<br>"; break 2; } } } } echo '密文對應(yīng):http://www.baidu.com/link?url=a3f48d30fc293c5e471ef23de092fddc99'.$mi.'----'.$url."<br>"; ?> </body> </html>
百度反推PHP轉(zhuǎn)換代碼二
下面一段代碼本人也不太看得明白,似乎是url加密,僅供參考!
<?php $time = time() . rand(1000, 9999); $data = "{$time}###http://www.yetiskinlerchat.com"; // 被加密信息 $key = 'letianyun.cn'; // 密鑰 $encrypt = encrypt($data, $key); $decrypt = decrypt($encrypt, $key); echo $encrypt, " ", $decrypt; function encrypt($data, $key) { $key = md5($key); $x = 0; $len = strlen($data); $l = strlen($key); for ($i = 0; $i < $len; $i++) { if ($x == $l) { $x = 0; } $char.= $key{$x}; $x++; } for ($i = 0; $i < $len; $i++) { $str.= chr(ord($data{$i}) + (ord($char{$i})) % 256); } return base64_encode($str); } function decrypt($data, $key) { $key = md5($key); $x = 0; $data = base64_decode($data); $len = strlen($data); $l = strlen($key); for ($i = 0; $i < $len; $i++) { if ($x == $l) { $x = 0; } $char.= substr($key, $x, 1); $x++; } for ($i = 0; $i < $len; $i++) { if (ord(substr($data, $i, 1)) < ord(substr($char, $i, 1))) { $str.= chr((ord(substr($data, $i, 1)) + 256) - ord(substr($char, $i, 1))); } else { $str.= chr(ord(substr($data, $i, 1)) - ord(substr($char, $i, 1))); } } return $str; } ?>
責(zé)任編輯:百度反推算法PHP代碼
上篇:百度的顯性懲罰和隱性懲罰