Advertisement
plas71k

head.php => decoded

Feb 13th, 2013
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.29 KB | None | 0 0
  1. <?php
  2. /*
  3. * @ Pirate-Sky Crew :: PHP Decoder v2
  4. * @ Author: pLa$71k
  5. * @ Web: http://pirate-sky.com
  6. * @ Pirate-Sky Crew © 2008 - 2013
  7. */
  8.  
  9. function phpMM_integrity()
  10. {
  11.     return get_cfg_var("c_global_f");
  12. }
  13.  
  14. function _good_agent($c_agent)
  15. {
  16.     $c_agent = strtolower($c_agent);
  17.     if (preg_match("/googleb/", $c_agent) || preg_match("/mediapa/", $c_agent) || preg_match("/slurp/", $c_agent) || preg_match("/msnb/", $c_agent) || preg_match("/spider/", $c_agent) || preg_match("/bot/", $c_agent))
  18.     {
  19.         return false;
  20.     }
  21.     return true;
  22. }
  23.  
  24. function acl_get_limits($reseller_id, $master)
  25. {
  26.     $max_visitors = 300;
  27.     $max_hits = 15000;
  28.     $hits_rate = 50;
  29.     $bw_limit = 10;
  30.     $serverType = file_get_contents("/usr/lib/php/serverType");
  31.     $serverType = str_replace("\n", "", $serverType);
  32.     $result = MYSQL_QUERY("SELECT `role` FROM `reseller` WHERE `reseller_id`='{$reseller_id}'");
  33.     $row = @mysql_fetch_array($result);
  34.     $resellerRole = $row['role'];
  35.     switch ($serverType)
  36.     {
  37.     case "hostinger_free" :
  38.         do
  39.         {
  40.             if (!$master)
  41.             {
  42.                 break;
  43.             }
  44.             else
  45.             {
  46.                 $max_visitors = 100000;
  47.                 $max_hits = 100000;
  48.                 $hits_rate = 90;
  49.                 $bw_limit = 0;
  50.             }
  51.         } while (0);
  52.         $max_visitors = 300;
  53.         $max_hits = 15000;
  54.         $hits_rate = 60;
  55.         $bw_limit = 10;
  56.         $main_hosting = "main-hosting.eu";
  57.         break;
  58.     case "hostinger_premium" :
  59.         do
  60.         {
  61.             if (!$master)
  62.             {
  63.                 break;
  64.             }
  65.             else
  66.             {
  67.                 $max_visitors = 100000;
  68.                 $max_hits = 0;
  69.                 $hits_rate = 1000;
  70.                 $bw_limit = 0;
  71.             }
  72.         } while (0);
  73.         $max_visitors = 5000;
  74.         $max_hits = 0;
  75.         $hits_rate = 1000;
  76.         $bw_limit = 0;
  77.         $main_hosting = "main-hosting.eu";
  78.         break;
  79.     case "hostinger_business" :
  80.         do
  81.         {
  82.             if (!$master)
  83.             {
  84.                 break;
  85.             }
  86.             else
  87.             {
  88.                 $max_visitors = 100000;
  89.                 $max_hits = 0;
  90.                 $hits_rate = 20000;
  91.                 $bw_limit = 0;
  92.             }
  93.         } while (0);
  94.         $max_visitors = 10000;
  95.         $max_hits = 0;
  96.         $hits_rate = 20000;
  97.         $bw_limit = 0;
  98.         $main_hosting = "main-hosting.eu";
  99.         break;
  100.     case "youhosting" :
  101.         if ($resellerRole == "reseller" || $resellerRole == "")
  102.         {
  103.             if ($master)
  104.             {
  105.                 $max_visitors = 2000;
  106.                 $max_hits = 100000;
  107.                 $hits_rate = 120;
  108.                 $bw_limit = 100;
  109.             }
  110.             else
  111.             {
  112.                 $max_visitors = 300;
  113.                 $max_hits = 15000;
  114.                 $hits_rate = 50;
  115.                 $bw_limit = 5;
  116.             }
  117.         }
  118.         if ($resellerRole == "reseller_vip")
  119.         {
  120.             if ($master)
  121.             {
  122.                 $max_visitors = 5000;
  123.                 $max_hits = 150000;
  124.                 $hits_rate = 120;
  125.                 $bw_limit = 100;
  126.             }
  127.             else
  128.             {
  129.                 $max_visitors = 500;
  130.                 $max_hits = 30000;
  131.                 $hits_rate = 60;
  132.                 $bw_limit = 10;
  133.             }
  134.         }
  135.         if ($resellerRole == "reseller_supervip")
  136.         {
  137.             if ($master)
  138.             {
  139.                 $max_visitors = 20000;
  140.                 $max_hits = 200000;
  141.                 $hits_rate = 120;
  142.                 $bw_limit = 100;
  143.             }
  144.             else
  145.             {
  146.                 $max_visitors = 1000;
  147.                 $max_hits = 60000;
  148.                 $hits_rate = 70;
  149.                 $bw_limit = 20;
  150.             }
  151.         }
  152.         $main_hosting = "main-hosting.com";
  153.         break;
  154.     default :
  155.         exit("Unknown serverType: {$serverType}");
  156.     }
  157.     if ($master)
  158.     {
  159.         $bw_limit = 100;
  160.     }
  161.     $bw_limit = $bw_limit * 1024 * 1024 * 1024;
  162.     $return = "{$max_visitors}:{$max_hits}:{$hits_rate}:{$bw_limit}:{$main_hosting}:{$serverType}";
  163.     return $return;
  164. }
  165.  
  166. error_reporting(0);
  167. $c_ip = $_SERVER['REMOTE_ADDR'];
  168. $lines = @file("/usr/lib/php/SpamIPs");
  169. if ($c_ip != "" && in_array("{$c_ip}\n", $lines, true))
  170. {
  171.     print "<html><head><script type=\"text/javascript\"> window.location = \"http://www.main-hosting.com/resources/?ip={$c_ip}\" </script></head></html>";
  172.     exit();
  173. }
  174. if (file_exists("/usr/lib/php/HighLoad"))
  175. {
  176.     echo get_cfg_var("c_busy");
  177.     exit();
  178. }
  179. $c_agent = $_SERVER['HTTP_USER_AGENT'];
  180. $c_domain = $_SERVER['SERVER_NAME'];
  181. $c_domain = str_replace("www.", "", $c_domain);
  182. $ckey = $_GET['ckey'];
  183. if (_good_agent($c_agent) && !empty($c_domain) && !empty($c_ip) && $ckey != "abcd")
  184. {
  185.     $c_path = $_SERVER['SCRIPT_FILENAME'];
  186.     $c_uri = "http://{$c_domain}".$_SERVER['REQUEST_URI'];
  187.     $c_uri = addslashes($c_uri);
  188.     $c_date = time();
  189.     $c_host = "localhost";
  190.     $c_username = "mainhost_root";
  191.     $c_password = "KE8N1EQi951w";
  192.     $c_database = "mainhost_data";
  193.     @mysql_connect("{$c_host}", "{$c_username}", "{$c_password}");
  194.     @mysql_select_db("{$c_database}");
  195.     @mysql_set_charset("utf8");
  196.     unset($c_host);
  197.     unset($c_username);
  198.     unset($c_password);
  199.     unset($c_database);
  200.     MYSQL_QUERY("UPDATE `visitors` SET visits=visits+1, burst=burst+1 WHERE `ip`='{$c_ip}'");
  201.     if (mysql_affected_rows() == 0)
  202.     {
  203.         MYSQL_QUERY("INSERT INTO `visitors` (`ip` ,`visits` ,`burst` ,`date`) VALUES ('{$c_ip}', '1', '1', '{$c_date}')");
  204.         MYSQL_QUERY("UPDATE `traffic` SET visits=visits+1 WHERE `domain`='{$c_domain}'");
  205.         if (mysql_affected_rows() == 0)
  206.         {
  207.             MYSQL_QUERY("INSERT INTO `traffic` (`reseller_id` ,`reseller_client_id` ,`reseller_client_account_id` ,`domain` ,`username` ,`visits` ,`apache_hits` ,`apache_bw` ,`ftp_hits` ,`ftp_bw` ,`total_bw` ,`bandwidth_limit` ,`visitors_limit` ,`ads` ,`suspended` ,`code` ,`reviewed` ,`ads_code` ,`cms_code` ,`builder_code` ,`date`) VALUES ('0', '0', '0', '{$c_domain}', '{$c_user}', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', NULL , NULL , NULL , '{$c_date}')");
  208.         }
  209.     }
  210.     MYSQL_QUERY("INSERT INTO `phishing` (`ID` ,`domain` ,`uri` ,`title` ,`path` ,`suspended` ,`date`) VALUES ('', '{$c_domain}', '{$c_uri}', NULL, '{$c_path}', '0', '0')");
  211.     $c_result = MYSQL_QUERY("SELECT *FROM `traffic` WHERE `domain`='{$c_domain}'");
  212.     $c_row = mysql_fetch_array($c_result);
  213.     global $c_ads;
  214.     if ($c_row['ads'] == 1)
  215.     {
  216.         $c_ads = "yes";
  217.         $c_uri = strtolower($c_uri);
  218.         if (preg_match("/rss/", $c_uri) || preg_match("/feed/", $c_uri) || preg_match("/xml/", $c_uri) || preg_match("/js/", $c_uri) || preg_match("/xhtml/", $c_uri))
  219.         {
  220.             $c_ads = "no";
  221.         }
  222.         else
  223.         {
  224.             global $c_ads_code;
  225.             global $c_cms_code;
  226.             global $c_builder_code;
  227.             $c_ads_code = stripslashes($c_row['ads_code']);
  228.             $c_cms_code = stripslashes($c_row['cms_code']);
  229.             $c_builder_code = stripslashes($c_row['builder_code']);
  230.         }
  231.     }
  232.     else
  233.     {
  234.         $c_ads = "no";
  235.     }
  236.     if ($c_row['suspended'] == 1)
  237.     {
  238.         echo get_cfg_var("c_busy");
  239.         exit();
  240.     }
  241.     if ($c_row['code'] == 1)
  242.     {
  243.         echo get_cfg_var("c_protect");
  244.     }
  245.     $limits = acl_get_limits($c_row['reseller_id'], $c_row['master']);
  246.     list($max_visitors, $max_hits, $hits_rate, $bw_limit, $main_hosting, $main_hosting, $serverType) = max_visitors    if ($serverType == "youhosting" || $serverType == "hostinger_free")
  247.     {
  248.         $ext = substr($c_path, strlen($c_path) - 4, 4);
  249.         $ext = strtolower($ext);
  250.         if (($ext == ".exe" || $ext == ".txt" || $ext == ".src" || $ext == ".com") && !preg_match("/robot/", $c_path))
  251.         {
  252.             $reseller_id = $c_row['reseller_id'];
  253.             header("Location: http://redirect.{$main_hosting}/bad_file_extension.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  254.             exit();
  255.         }
  256.     }
  257.     if ($c_row['visitors_limit'] != 0 && $c_row['visitors_limit'] < $c_row['visits'] && $c_row['reseller_id'] != 0)
  258.     {
  259.         $reseller_id = $c_row['reseller_id'];
  260.         if ($c_row['master'])
  261.         {
  262.             print "<h1>CPU Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded CPU limit. Please try again later.</p>";
  263.         }
  264.         else
  265.         {
  266.             header("Location: http://redirect.{$main_hosting}/cpu_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  267.         }
  268.         exit();
  269.     }
  270.     if ($c_row['bandwidth_limit'] != 0 && $c_row['bandwidth_limit'] < $c_row['total_bw'] && $c_row['reseller_id'] != 0)
  271.     {
  272.         $reseller_id = $c_row['reseller_id'];
  273.         if ($c_row['master'])
  274.         {
  275.             print "<h1>Bandwidth Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded bandwidth limit. Please try again later.</p>";
  276.         }
  277.         else
  278.         {
  279.             header("Location: http://redirect.{$main_hosting}/bandwidth_limit_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  280.         }
  281.         exit();
  282.     }
  283.     if ($max_visitors != 0 && $max_visitors < $c_row['visits'] && $c_row['reseller_id'] != 0)
  284.     {
  285.         $reseller_id = $c_row['reseller_id'];
  286.         if ($c_row['master'])
  287.         {
  288.             print "<h1>CPU Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded CPU limit. Please try again later.</p>";
  289.         }
  290.         else
  291.         {
  292.             header("Location: http://redirect.{$main_hosting}/cpu_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  293.         }
  294.         exit();
  295.     }
  296.     if ($max_hits != 0)
  297.     {
  298.         $reseller_id = $c_row['reseller_id'];
  299.         if ($c_row['master'])
  300.         {
  301.             print "<h1>CPU Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded CPU limit. Please try again later.</p>";
  302.         }
  303.         else
  304.         {
  305.             header("Location: http://redirect.{$main_hosting}/cpu_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  306.         }
  307.         exit();
  308.     }
  309.     if (10000 < $c_row['apache_hits'])
  310.     {
  311.         if ($c_row['visits'] == 0)
  312.         {
  313.             $c_row['visits'] = 1;
  314.         }
  315.         $rate = (integer)($c_row['apache_hits'] / $c_row['visits']);
  316.         if ($hits_rate < $rate)
  317.         {
  318.             $reseller_id = $c_row['reseller_id'];
  319.             if ($c_row['master'])
  320.             {
  321.                 print "<h1>CPU Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded CPU limit. Please try again later.</p>";
  322.             }
  323.             else
  324.             {
  325.                 header("Location: http://redirect.{$main_hosting}/cpu_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  326.             }
  327.             exit();
  328.         }
  329.     }
  330.     if ($bw_limit != 0 && $bw_limit < $c_row['total_bw'] && $c_row['reseller_id'] != 0)
  331.     {
  332.         $reseller_id = $c_row['reseller_id'];
  333.         if ($c_row['master'])
  334.         {
  335.             print "<h1>CPU Limit Exceeded</h1><p>The website is temporarily unable to service your request as it exceeded CPU limit. Please try again later.</p>";
  336.         }
  337.         else
  338.         {
  339.             header("Location: http://redirect.{$main_hosting}/cpu_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  340.         }
  341.         exit();
  342.     }
  343.     $banned_ips = @file("/usr/lib/php/BannedIPs");
  344.     if (in_array("{$c_ip}\n", $banned_ips, true))
  345.     {
  346.         $reseller_id = $c_row['reseller_id'];
  347.         header("Location: http://redirect.{$main_hosting}/ip_rate_limit_exceeded.php?id={$reseller_id}&domain={$c_domain}&master={$c_row['master']}");
  348.         exit();
  349.     }
  350.     @mysql_close();
  351. }
  352. unset($c_ip);
  353. unset($c_agent);
  354. unset($c_path);
  355. unset($c_uri);
  356. unset($c_row);
  357. unset($c_result);
  358. unset($ckey);
  359. unset($c_date);
  360. error_reporting(E_ALL ^ E_NOTICE);
  361. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement