search.php
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
if(isset($_GET)){
$s = $_GET['s'];
$s = strtolower($s);
$s = str_replace(" ","%20",$s);
$cat = $_GET['cat'];
$testurl = 'https://devmark.globalso.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<1000;$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);
if(empty($content)){
$content = file_get_contents($url);
}
return $content;
}