百度反推算法PHP代码
前段时间百度反推很火,我在某个算法交流群里呆了数天都没看出个所以然来。没想到几天没有上线百度反推都出来了。
在发布百度反推软件之前,先把曹操之前搜集到的百度反推PHP发布出来看看。
代码仅供参考思路,实际上经过测试发现已经无法通过解析出来的地址实现跳转。
百度反推PHP转换代码一
使用方法:修改函数url的值为自己url,即可生成对应的百度快照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个位置对应的(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.letianyun.cn"; $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 //结果 $result = $ascii[$real_x][$real_y]; if($result == $domain_one ){ $mi .= $arr_x[$ax].$arr_y[$ay]; $url .= $result; echo '密文对应:'.$arr_x[$ax].$arr_y[$ay].'----'.$result."<br>"; break 2; } } } } echo '密文对应:http://www.baidu.com/link?url=a3f48d30fc293c5e471ef23de092fddc99'.$mi.'----'.$url."<br>"; ?> </body> </html>
百度反推PHP转换代码二
下面一段代码本人也不太看得明白,似乎是url加密,仅供参考!
<?php $time = time() . rand(1000, 9999); $data = "{$time}###http://www.letianyun.cn"; // 被加密信息 $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; } ?>
责任编辑:百度反推算法PHP代码
上篇:百度的显性惩罚和隐性惩罚
下篇:百度秒收秒排名实操手法