Файл: dobavka/antihack.php
Строк: 33
<?php
//АНТИХАК
error_reporting(0);
ini_set('display_errors',0);
function true_protect($str)
{
if (!is_array($str))
{
$str = str_replace(" ",'',$str);
$str = str_replace("'",'"',$str);
$str = str_replace("`",'"',$str);
$str = str_replace("<",'*',$str);
$str = str_replace(">",'*',$str);
$str = str_ireplace("union",'uniоn',$str);
$str = str_ireplace("select",'sеlect',$str);
$str = str_ireplace("benchmark",'bеnchmark',$str);
$str = str_ireplace("database",'dаtаbаsе',$str);
$str = str_ireplace("table",'tаble',$str);
$str = str_ireplace("update",'updаte',$str);
$str = str_ireplace("insert",'insеrt',$str);
$str = str_ireplace("script",'sсriрt',$str);
$str = str_ireplace("level",'lеvеl',$str);
$str = str_replace("../",'***',$str);
}
else
{
$str = array_map('true_protect',$str);
}
return $str;
}
if ($_GET) {
$_GET = array_map('true_protect',$_GET); }
if ($_POST) {
$_POST = array_map('true_protect',$_POST); }
$_COOKIE = array_map('true_protect',$_COOKIE);
$_SERVER['HTTP_REFERER'] = true_protect($_SERVER['HTTP_REFERER']);
$_SERVER['HTTP_USER_AGENT'] = true_protect($_SERVER['HTTP_USER_AGENT']);
if ($_FILES) {
foreach ($_FILES as $file_name=>$file_array) {
if (strpos($_FILES[$file_name]['name']," ")!==false or strpos($_FILES[$file_name]['name'],'/')!==false or stripos($_FILES[$file_name]['name'],'.php')!==false or stripos($_FILES[$file_name]['name'],'.phtml')!==false) {
header('Location: http://derzh.ru'); exit; }
$filetmpdata=file_get_contents($_FILES[$file_name]['tmp_name']);
if (strpos($filetmpdata,'<?php')!==false) {
header('Location: http://derzh.ru'); exit; }
unset($filetmpdata); }
unset($file_name);
unset($file_array); }
?>