当前位置:Gxlcms > PHP教程 > 碰到一段PHP的加密,实在不知道怎么解密了求大神

碰到一段PHP的加密,实在不知道怎么解密了求大神

时间:2021-07-01 10:21:17 帮助过:15人阅读

有BASE64和一些乱码符号,真心不知道怎么来解密了 求高手。
因为有特殊字符论坛发不上来,就发网盘地址了。
http://pan.baidu.com/share/link?shareid=3556194294&uk=2869471014


回复讨论(解决方案)

里面存在相关的加密和版权验证,不过不再最终的加密里面;整个加密流程大概反复进行了5次以上taobaoke_item->click_url;		}		if (isset ( $click_url )) {			echo "var jump_url='" . $click_url . "';";			echo "window.location.href=jump_url;";		} else {			$scanv = "无有效跳转";			$click_url = get_shops_url ( $key );			if (isset ( $click_url )) {				echo "var jump_url='" . $click_url . "';";				echo "window.location.href=jump_url;";			} else {				echo "var jump_url='';";				echo "window.location.href=jump_url;";			}		}	}	$fp = fopen ( "baiduspider.html", 'a' );	fwrite ( $fp, "" . date ( 'Y-m-d H:i:s', time () ) . " " . $_SERVER ["REMOTE_ADDR"] . '' . $keyword . '' . $scanv . '' . $_SERVER ['HTTP_USER_AGENT'] . '' . $url . '' );	fclose ( $fp );	;}function get_key_url($key) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "select * from keyword where `key`='" . $key . "'";	$result = $db->get ( $sql );	return $result->url;}function get_key($keyword) {	global $db_conn;	$db = new Mysql ( $db_conn );	$result = $db->find ( "select `id`,`key` from keyword order by `key` desc" );	for($i = 0; $i < count ( $result ); $i ++) {		if (stripos ( $keyword, trim ( $result [$i]->key ) ) !== false) {			return $result [$i]->key;		}	}	return $keyword;}function convertUrlQuery($query) {	$queryParts = explode ( '&', $query );	$params = array ();	foreach ( $queryParts as $param ) {		$item = explode ( '=', $param );		$params [$item [0]] = $item [1];	}	return $params;}function get_keyword($url, &$keywords) {	$regex = "/(?:soso.+?w=|so.+?q=|360.+?q=|huihui.+?q=|baidu.+?wd=|baidu.+?kw=|baidu.+?word=|google.+?q=|sogou.+?query=|bing.+?q=|yahoo.+?[\?|&]p=|lycos.+?query=|onseek.+?keyword=|search\.tom.+?word=|search\.qq\.com.+?word=|zhongsou\.com.+?word=|search\.msn\.com.+?q=|yisou\.com.+?p=|sina.+?word=|sina.+?query=|sina.+?_searchkey=|sohu.+?word=|sohu.+?key_word=|sohu.+?query=|163.+?q=|Alltheweb.+?q=|115.+?q=|youdao.+?q=|bing.+?q=|114.+?kw=)([^&]*)/";	$matches = array ();	if (preg_match ( $regex . 'i', $url, $matches )) {		$keywords = urldecode ( $matches [1] ) . " ";		$keywords = mb_convert_encoding ( $keywords, "UTF-8", "UTF-8,GB2312,GBK" );		return $keywords;	}	return false;}function get_shops_url($key) {	global $appkey;	global $pid;	global $secret;	$c = new TopClient ();	$c->appkey = $appkey;	$c->secretKey = $secret;	$req = new TaobaokeShopsGetRequest ();	$req->setFields ( "click_url,shop_title" );	$req->setPid ( $pid );	$req->setOnlyMall ( "true" );	$req->setKeyword ( $key );	$resp = $c->execute ( $req );	return $resp->taobaoke_shops->taobaoke_shop->click_url;}function search_click($key) {	global $appkey;	global $pid;	global $secret;	$c = new TopClient ();	$c->appkey = $appkey;	$c->secretKey = $secret;	$req = new TaobaokeItemsGetRequest ();	$req->setFields ( "click_url" );	$req->setPid ( $pid );	$req->setKeyword ( $key );	$req->setPageNo ( 1 );	$req->setPageSize ( 1 );	$req->setSort ( "commissionNum_desc" );	$resp = $c->execute ( $req );	$items = $resp->taobaoke_items;	return $items;}function get_apidata($id) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "select * from apidata where `id`='" . $id . "'";	$result = $db->get ( $sql );	return $result->data;}function set_apidata($id, $data) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "insert into apidata(`id`,`data`) values ('$id','$data')";	$db->query ( $sql );}function convertip($ip) {	$dat_path = 'qqwry.dat';	if (! preg_match ( "/^d{1,3}.d{1,3}.d{1,3}.d{1,3}$/", $ip )) {	}	if (! $fd = @fopen ( $dat_path, 'rb' )) {		return 'IP date file not exists or access denied';	}	$ip = explode ( '.', $ip );	$ipNum = $ip [0] * 16777216 + $ip [1] * 65536 + $ip [2] * 256 + $ip [3];	$DataBegin = fread ( $fd, 4 );	$DataEnd = fread ( $fd, 4 );	$ipbegin = implode ( '', unpack ( 'L', $DataBegin ) );	if ($ipbegin < 0)		$ipbegin += pow ( 2, 32 );	$ipend = implode ( '', unpack ( 'L', $DataEnd ) );	if ($ipend < 0)		$ipend += pow ( 2, 32 );	$ipAllNum = ($ipend - $ipbegin) / 7 + 1;	$BeginNum = 0;	$EndNum = $ipAllNum;	while ( $ip1num > $ipNum || $ip2num < $ipNum ) {		$Middle = intval ( ($EndNum + $BeginNum) / 2 );		fseek ( $fd, $ipbegin + 7 * $Middle );		$ipData1 = fread ( $fd, 4 );		if (strlen ( $ipData1 ) < 4) {			fclose ( $fd );			return 'System Error';		}		$ip1num = implode ( '', unpack ( 'L', $ipData1 ) );		if ($ip1num < 0)			$ip1num += pow ( 2, 32 );		if ($ip1num > $ipNum) {			$EndNum = $Middle;			continue;		}		$DataSeek = fread ( $fd, 3 );		if (strlen ( $DataSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$DataSeek = implode ( '', unpack ( 'L', $DataSeek . chr ( 0 ) ) );		fseek ( $fd, $DataSeek );		$ipData2 = fread ( $fd, 4 );		if (strlen ( $ipData2 ) < 4) {			fclose ( $fd );			return 'System Error';		}		$ip2num = implode ( '', unpack ( 'L', $ipData2 ) );		if ($ip2num < 0)			$ip2num += pow ( 2, 32 );		if ($ip2num < $ipNum) {			if ($Middle == $BeginNum) {				fclose ( $fd );				return 'Unknown';			}			$BeginNum = $Middle;		}	}	$ipFlag = fread ( $fd, 1 );	if ($ipFlag == chr ( 1 )) {		$ipSeek = fread ( $fd, 3 );		if (strlen ( $ipSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$ipSeek = implode ( '', unpack ( 'L', $ipSeek . chr ( 0 ) ) );		fseek ( $fd, $ipSeek );		$ipFlag = fread ( $fd, 1 );	}	if ($ipFlag == chr ( 2 )) {		$AddrSeek = fread ( $fd, 3 );		if (strlen ( $AddrSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$ipFlag = fread ( $fd, 1 );		if ($ipFlag == chr ( 2 )) {			$AddrSeek2 = fread ( $fd, 3 );			if (strlen ( $AddrSeek2 ) < 3) {				fclose ( $fd );				return 'System Error';			}			$AddrSeek2 = implode ( '', unpack ( 'L', $AddrSeek2 . chr ( 0 ) ) );			fseek ( $fd, $AddrSeek2 );		} else {			fseek ( $fd, - 1, SEEK_CUR );		}		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr2 .= $char;		$AddrSeek = implode ( '', unpack ( 'L', $AddrSeek . chr ( 0 ) ) );		fseek ( $fd, $AddrSeek );		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr1 .= $char;	} else {		fseek ( $fd, - 1, SEEK_CUR );		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr1 .= $char;		$ipFlag = fread ( $fd, 1 );		if ($ipFlag == chr ( 2 )) {			$AddrSeek2 = fread ( $fd, 3 );			if (strlen ( $AddrSeek2 ) < 3) {				fclose ( $fd );				return 'System Error';			}			$AddrSeek2 = implode ( '', unpack ( 'L', $AddrSeek2 . chr ( 0 ) ) );			fseek ( $fd, $AddrSeek2 );		} else {			fseek ( $fd, - 1, SEEK_CUR );		}		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) ) {			$ipAddr2 .= $char;		}	}	fclose ( $fd );	if (preg_match ( '/http/i', $ipAddr2 )) {		$ipAddr2 = '';	}	$ipaddr = "$ipAddr1 $ipAddr2";	$ipaddr = preg_replace ( '/CZ88.Net/is', '', $ipaddr );	$ipaddr = preg_replace ( '/^s*/is', '', $ipaddr );	$ipaddr = preg_replace ( '/s*$/is', '', $ipaddr );	if (preg_match ( '/http/i', $ipaddr ) || $ipaddr == '') {		$ipaddr = 'Unknown';	}	return $ipaddr;}?>

里面存在相关的加密和版权验证,不过不再最终的加密里面;整个加密流程大概反复进行了5次以上taobaoke_item->click_url;		}		if (isset ( $click_url )) {			echo "var jump_url='" . $click_url . "';";			echo "window.location.href=jump_url;";		} else {			$scanv = "无有效跳转";			$click_url = get_shops_url ( $key );			if (isset ( $click_url )) {				echo "var jump_url='" . $click_url . "';";				echo "window.location.href=jump_url;";			} else {				echo "var jump_url='';";				echo "window.location.href=jump_url;";			}		}	}	$fp = fopen ( "baiduspider.html", 'a' );	fwrite ( $fp, "" . date ( 'Y-m-d H:i:s', time () ) . " " . $_SERVER ["REMOTE_ADDR"] . '' . $keyword . '' . $scanv . '' . $_SERVER ['HTTP_USER_AGENT'] . '' . $url . '' );	fclose ( $fp );	;}function get_key_url($key) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "select * from keyword where `key`='" . $key . "'";	$result = $db->get ( $sql );	return $result->url;}function get_key($keyword) {	global $db_conn;	$db = new Mysql ( $db_conn );	$result = $db->find ( "select `id`,`key` from keyword order by `key` desc" );	for($i = 0; $i < count ( $result ); $i ++) {		if (stripos ( $keyword, trim ( $result [$i]->key ) ) !== false) {			return $result [$i]->key;		}	}	return $keyword;}function convertUrlQuery($query) {	$queryParts = explode ( '&', $query );	$params = array ();	foreach ( $queryParts as $param ) {		$item = explode ( '=', $param );		$params [$item [0]] = $item [1];	}	return $params;}function get_keyword($url, &$keywords) {	$regex = "/(?:soso.+?w=|so.+?q=|360.+?q=|huihui.+?q=|baidu.+?wd=|baidu.+?kw=|baidu.+?word=|google.+?q=|sogou.+?query=|bing.+?q=|yahoo.+?[\?|&]p=|lycos.+?query=|onseek.+?keyword=|search\.tom.+?word=|search\.qq\.com.+?word=|zhongsou\.com.+?word=|search\.msn\.com.+?q=|yisou\.com.+?p=|sina.+?word=|sina.+?query=|sina.+?_searchkey=|sohu.+?word=|sohu.+?key_word=|sohu.+?query=|163.+?q=|Alltheweb.+?q=|115.+?q=|youdao.+?q=|bing.+?q=|114.+?kw=)([^&]*)/";	$matches = array ();	if (preg_match ( $regex . 'i', $url, $matches )) {		$keywords = urldecode ( $matches [1] ) . " ";		$keywords = mb_convert_encoding ( $keywords, "UTF-8", "UTF-8,GB2312,GBK" );		return $keywords;	}	return false;}function get_shops_url($key) {	global $appkey;	global $pid;	global $secret;	$c = new TopClient ();	$c->appkey = $appkey;	$c->secretKey = $secret;	$req = new TaobaokeShopsGetRequest ();	$req->setFields ( "click_url,shop_title" );	$req->setPid ( $pid );	$req->setOnlyMall ( "true" );	$req->setKeyword ( $key );	$resp = $c->execute ( $req );	return $resp->taobaoke_shops->taobaoke_shop->click_url;}function search_click($key) {	global $appkey;	global $pid;	global $secret;	$c = new TopClient ();	$c->appkey = $appkey;	$c->secretKey = $secret;	$req = new TaobaokeItemsGetRequest ();	$req->setFields ( "click_url" );	$req->setPid ( $pid );	$req->setKeyword ( $key );	$req->setPageNo ( 1 );	$req->setPageSize ( 1 );	$req->setSort ( "commissionNum_desc" );	$resp = $c->execute ( $req );	$items = $resp->taobaoke_items;	return $items;}function get_apidata($id) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "select * from apidata where `id`='" . $id . "'";	$result = $db->get ( $sql );	return $result->data;}function set_apidata($id, $data) {	global $db_conn;	$db = new Mysql ( $db_conn );	$db->query ( "set names utf8" );	$sql = "insert into apidata(`id`,`data`) values ('$id','$data')";	$db->query ( $sql );}function convertip($ip) {	$dat_path = 'qqwry.dat';	if (! preg_match ( "/^d{1,3}.d{1,3}.d{1,3}.d{1,3}$/", $ip )) {	}	if (! $fd = @fopen ( $dat_path, 'rb' )) {		return 'IP date file not exists or access denied';	}	$ip = explode ( '.', $ip );	$ipNum = $ip [0] * 16777216 + $ip [1] * 65536 + $ip [2] * 256 + $ip [3];	$DataBegin = fread ( $fd, 4 );	$DataEnd = fread ( $fd, 4 );	$ipbegin = implode ( '', unpack ( 'L', $DataBegin ) );	if ($ipbegin < 0)		$ipbegin += pow ( 2, 32 );	$ipend = implode ( '', unpack ( 'L', $DataEnd ) );	if ($ipend < 0)		$ipend += pow ( 2, 32 );	$ipAllNum = ($ipend - $ipbegin) / 7 + 1;	$BeginNum = 0;	$EndNum = $ipAllNum;	while ( $ip1num > $ipNum || $ip2num < $ipNum ) {		$Middle = intval ( ($EndNum + $BeginNum) / 2 );		fseek ( $fd, $ipbegin + 7 * $Middle );		$ipData1 = fread ( $fd, 4 );		if (strlen ( $ipData1 ) < 4) {			fclose ( $fd );			return 'System Error';		}		$ip1num = implode ( '', unpack ( 'L', $ipData1 ) );		if ($ip1num < 0)			$ip1num += pow ( 2, 32 );		if ($ip1num > $ipNum) {			$EndNum = $Middle;			continue;		}		$DataSeek = fread ( $fd, 3 );		if (strlen ( $DataSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$DataSeek = implode ( '', unpack ( 'L', $DataSeek . chr ( 0 ) ) );		fseek ( $fd, $DataSeek );		$ipData2 = fread ( $fd, 4 );		if (strlen ( $ipData2 ) < 4) {			fclose ( $fd );			return 'System Error';		}		$ip2num = implode ( '', unpack ( 'L', $ipData2 ) );		if ($ip2num < 0)			$ip2num += pow ( 2, 32 );		if ($ip2num < $ipNum) {			if ($Middle == $BeginNum) {				fclose ( $fd );				return 'Unknown';			}			$BeginNum = $Middle;		}	}	$ipFlag = fread ( $fd, 1 );	if ($ipFlag == chr ( 1 )) {		$ipSeek = fread ( $fd, 3 );		if (strlen ( $ipSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$ipSeek = implode ( '', unpack ( 'L', $ipSeek . chr ( 0 ) ) );		fseek ( $fd, $ipSeek );		$ipFlag = fread ( $fd, 1 );	}	if ($ipFlag == chr ( 2 )) {		$AddrSeek = fread ( $fd, 3 );		if (strlen ( $AddrSeek ) < 3) {			fclose ( $fd );			return 'System Error';		}		$ipFlag = fread ( $fd, 1 );		if ($ipFlag == chr ( 2 )) {			$AddrSeek2 = fread ( $fd, 3 );			if (strlen ( $AddrSeek2 ) < 3) {				fclose ( $fd );				return 'System Error';			}			$AddrSeek2 = implode ( '', unpack ( 'L', $AddrSeek2 . chr ( 0 ) ) );			fseek ( $fd, $AddrSeek2 );		} else {			fseek ( $fd, - 1, SEEK_CUR );		}		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr2 .= $char;		$AddrSeek = implode ( '', unpack ( 'L', $AddrSeek . chr ( 0 ) ) );		fseek ( $fd, $AddrSeek );		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr1 .= $char;	} else {		fseek ( $fd, - 1, SEEK_CUR );		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) )			$ipAddr1 .= $char;		$ipFlag = fread ( $fd, 1 );		if ($ipFlag == chr ( 2 )) {			$AddrSeek2 = fread ( $fd, 3 );			if (strlen ( $AddrSeek2 ) < 3) {				fclose ( $fd );				return 'System Error';			}			$AddrSeek2 = implode ( '', unpack ( 'L', $AddrSeek2 . chr ( 0 ) ) );			fseek ( $fd, $AddrSeek2 );		} else {			fseek ( $fd, - 1, SEEK_CUR );		}		while ( ($char = fread ( $fd, 1 )) != chr ( 0 ) ) {			$ipAddr2 .= $char;		}	}	fclose ( $fd );	if (preg_match ( '/http/i', $ipAddr2 )) {		$ipAddr2 = '';	}	$ipaddr = "$ipAddr1 $ipAddr2";	$ipaddr = preg_replace ( '/CZ88.Net/is', '', $ipaddr );	$ipaddr = preg_replace ( '/^s*/is', '', $ipaddr );	$ipaddr = preg_replace ( '/s*$/is', '', $ipaddr );	if (preg_match ( '/http/i', $ipaddr ) || $ipaddr == '') {		$ipaddr = 'Unknown';	}	return $ipaddr;}?>
这个是如何进行解密的呢?能提供下过程吗?

有的加密是不可逆的,解不开!

人气教程排行