File "search.php"

Full Path: /www/wwwroot/shphe-en.com/wp-content/cache/all/sitemap/search.php
File size: 1.73 KB
MIME-type: --
Charset: utf-8

<?php

if(isset($_GET)){
    $s = $_GET['s'];
    $cat = $_GET['cat'];
    $testurl = 'https://www.shphe-en.com/';
    $refer = 'https://'.$_SERVER['HTTP_HOST'].'/';
    if(isset($_GET['page'])){
        $res = curl_z($testurl."page/".$_GET['page']."/?s=".$s."&cat=".$cat);
    }else{
        $res = curl_z($testurl."index.php?s=".$s."&cat=".$cat);
    }
    $res = str_replace($testurl,$refer,$res);
    $res = str_replace('com/?s','com/search.php?s',$res);
    $res = str_replace('net/?s','net/search.php?s',$res);
	$res = str_replace('action="/index.php','action="/search.php',$res);
	$res = str_replace($refer.'wp-admin/admin-ajax.php',$refer.'statistic.php',$res);
	$res = str_replace("<script type='text/javascript' src='".$refer."wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>",'',$res);
	$res = str_replace("<script type='text/javascript' src='".$refer."wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>",'',$res);
    for($i=2;$i<50;$i++){
        $res = str_replace('page/'.$i.'/?','search.php?page='.$i.'&',$res);
    }
    print_r($res);exit;
}

function curl_z($url){
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246');
	curl_setopt($ch, CURLOPT_AUTOREFERER, true);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
	curl_setopt($ch, CURLOPT_TIMEOUT, 30);
	curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_SSLVERSION, 'all');
	$content = curl_exec($ch);
	curl_close($ch);
	return $content;
}