• Страница 1 из 1
  • 1
Форум вебмастеров-Моды и хаки для трекера » Моды и Хаки » Готовые моды и хаки » Защита от шеллов (Защита от шеллов)
Защита от шеллов
Slash3977Дата: Воскресенье, 27.06.2010, 20:42 | Сообщение # 1
Админ!и что?
Группа: Администраторы
Сообщений: 74
Репутация: 3
Статус: Offline
открыть include/functions.php
После любой функции вставить это:

Code
function check_images($file){  
     $h1count = preg_match_all('/(<img.*?)\s (src="([a-zA-Z0-9\.;:\/\?&=_|\r|\n]{1,})")/isxmU',$file,$patterns);  
     $imagesarray = array();  
     array_push($imagesarray,$patterns[3]);  
     array_push($imagesarray,$patterns[0]);  
       
   $images = $imagesarray[0];  
   $imagecodes = $imagesarray[1];  
   if ($images)  
     foreach ($images as $key => $image) {  
       if (!@getimagesize($image)) {$bb[] = $imagecodes[$key]; $html[] = $image; }  
     }  
if ($bb)  
$code = str_replace($bb,$html,$code);  
return $file;  
}  

function shell_check($file_path) {  
     global $shell_check;  
     if (! @getimagesize ( $file_path )) {  
         stderr ( "Произошла ошибка", "Неправильный файл!" );  
     }  
     if ($shell_check) {  
         $file_contents = file_get_contents ( $file_path );  
         $functions = array ();  
         $functions_to_shell = array ("include", "file", "fwrite", "fopen", "fread", "require", "exec", "system", "passthru", "eval", "copy" );  
         foreach ( $functions_to_shell as $funct )  
             $functions [] = 'preg_match("/' . $funct . '+(\\s||)+[(]/", $file_contents)';  
         $eval = 'if (' . implode ( " || ", $functions ) . ') {stderr("Произошла ошибка", "Неправильный файл!");};';  
         eval ( $eval );  
     }  
}
 
Форум вебмастеров-Моды и хаки для трекера » Моды и Хаки » Готовые моды и хаки » Защита от шеллов (Защита от шеллов)
  • Страница 1 из 1
  • 1
Поиск: