Advertisement
johnburn

Decoded for: [email protected]

May 31st, 2011
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.10 KB | None | 0 0
  1. <?php
  2.  
  3. $filename = 'disable.cron';
  4. clearstatcache();
  5. if (file_exists($filename))
  6.    exit();
  7.  
  8. $time_limit = 60*60;
  9. ini_set('max_execution_time', $time_limit);
  10. set_time_limit($time_limit);
  11.  
  12. include_once 'config.php';
  13. include_once '../simple_html_dom.php';
  14.  
  15. $gacookie = getcwd()."/file.cookie";
  16. @chmod($gacookie, 0777);
  17.  
  18. $logged_in = FALSE;
  19.  
  20. $url = 'https://vistaclix.com/login.php';
  21. $referer = 'https://vistaclix.com/login.php';
  22.  
  23. $ch = curl_init();
  24.  
  25. curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
  26. curl_setopt ($ch, CURLOPT_COOKIESESSION, 0);
  27. curl_setopt ($ch, CURLOPT_FAILONERROR, 0);
  28. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
  29. curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1);
  30. //curl_setopt ($ch, CURLOPT_POST, 1);
  31. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  32. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  33. curl_setopt ($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
  34.  
  35. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
  36. curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
  37. if ($config['use_proxy'] !== FALSE)
  38. {
  39.    curl_setopt ($ch, CURLOPT_PROXY, $config['proxy']);
  40.    curl_setopt ($ch, CURLOPT_PROXYUSERPWD, $config['proxy_username'].':'.$config['proxy_password']);
  41. }
  42.  
  43. curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
  44. curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
  45. curl_setopt ($ch, CURLOPT_ENCODING, "");
  46. //curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  47. curl_setopt ($ch, CURLOPT_REFERER, $referer);
  48. curl_setopt ($ch, CURLOPT_URL, $url);
  49. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8");
  50.  
  51. $response = curl_exec($ch);
  52. $error = curl_error($ch);
  53. $info = curl_getinfo($ch);
  54. $err_no = curl_errno($ch);
  55.  
  56. curl_close($ch);
  57. unset($ch);
  58.  
  59. if ($err_no)
  60. {
  61.    echo $error;
  62.    echo '<br /><br />Back to the <a href="index.php">main page</a>.';
  63.    exit();
  64. }
  65.  
  66. $html = str_get_html($response);
  67.  
  68. $links = $html->find('li a');
  69. if (isset($links))
  70. {
  71.    foreach ($links as $link)
  72.    {
  73.       $link_my_account = $link->href;
  74.       $pos = stripos($link_my_account, '/acc.php');
  75.       if ($pos !== FALSE)
  76.       {
  77.          $logged_in = TRUE;
  78.          break;
  79.       }
  80.    }
  81. }
  82.  
  83. $html->clear();
  84. unset($html);
  85.  
  86. $notification_filename = 'notify_login.mail';
  87.  
  88. if ($logged_in)
  89. {
  90.    if (file_exists($notification_filename))
  91.       @unlink($notification_filename);
  92.  
  93.    include_once 'vistaclix.com.php';
  94. }
  95. else
  96. {
  97.    $html = str_get_html($response);
  98.  
  99.    $token = '';
  100.    $form = $html->find('form[method=post]', 0);
  101.    if (isset($form))
  102.       $token = $form->find('input[name=token]', 0)->value;
  103.  
  104.    $html->clear();
  105.    unset($html);
  106.  
  107.    // get the captcha image
  108.    $url = 'https://vistaclix.com/image.php';
  109.    $referer = 'https://vistaclix.com/login.php';
  110.  
  111.    $ch = curl_init();
  112.  
  113.    curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
  114.    curl_setopt ($ch, CURLOPT_COOKIESESSION, 0);
  115.    curl_setopt ($ch, CURLOPT_FAILONERROR, 0);
  116.    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
  117.    curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1);
  118.    //curl_setopt ($ch, CURLOPT_POST, 1);
  119.    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  120.    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  121.    curl_setopt ($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
  122.  
  123.    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
  124.    curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
  125.    if ($config['use_proxy'] !== FALSE)
  126.    {
  127.       curl_setopt ($ch, CURLOPT_PROXY, $config['proxy']);
  128.       curl_setopt ($ch, CURLOPT_PROXYUSERPWD, $config['proxy_username'].':'.$config['proxy_password']);
  129.    }
  130.  
  131.    curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
  132.    curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
  133.    curl_setopt ($ch, CURLOPT_ENCODING, "");
  134.    //curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  135.    curl_setopt ($ch, CURLOPT_REFERER, $referer);
  136.    curl_setopt ($ch, CURLOPT_URL, $url);
  137.    curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8");
  138.  
  139.    $response = curl_exec($ch);
  140.    $error = curl_error($ch);
  141.    $info = curl_getinfo($ch);
  142.    $err_no = curl_errno($ch);
  143.  
  144.    curl_close($ch);
  145.    unset($ch);
  146.  
  147.    if ($err_no)
  148.    {
  149.       echo $error;
  150.       echo '<br /><br />Back to the <a href="index.php">main page</a>.';
  151.       exit();
  152.    }
  153.  
  154.    if ( ! empty($info['content_type']) and ($info['http_code'] == 200) and ($info['header_size'] > 0))
  155.    {
  156.       switch ($info['content_type'])
  157.       {
  158.          case 'image/png':
  159.             $captcha_filename = 'captcha.png';
  160.             break;
  161.          case 'image/jpeg':
  162.             $captcha_filename = 'captcha.jpg';
  163.             break;
  164.          default:
  165.             $captcha_filename = 'captcha.jpg';
  166.             break;
  167.       }
  168.    }
  169.  
  170.    if (empty($captcha_filename))
  171.    {
  172.       echo 'Failed to retrieve captcha image.';
  173.       echo '<br /><br />Back to the <a href="index.php">main page</a>.';
  174.       exit();
  175.    }
  176.  
  177.    $captcha_filename = 'images/'.$captcha_filename;
  178.    @chmod('images', 0777);
  179.    @file_put_contents($captcha_filename, $response);
  180.  
  181. ?>
  182.  
  183.    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  184.    <html xmlns="http://www.w3.org/1999/xhtml">
  185.    <head>
  186.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  187.      <title>VistaClix Autosurf</title>
  188.      <link href="images/favicon.ico" rel="shortcut icon" />
  189.    </head>
  190.  
  191.    <body>
  192.       <div align="center">
  193.          <form method="post" action="vistaclix.com.php">
  194.             <input type="hidden" name="token" value="<?php echo $token; ?>" />
  195.             <table>
  196.                <tr>
  197.                   <td></td>
  198.                   <td><img src="<?php echo $captcha_filename; ?>"></td>
  199.                </tr>
  200.                <tr>
  201.                   <td><label for="captcha_code">Captcha</label></td>
  202.                   <td><input type="text" name="captcha_code" size="21" /></td>
  203.                </tr>
  204.                <tr>
  205.                   <td></td>
  206.                   <td align="left"><input type="submit" name="login" value="Auto Surf"></td>
  207.                </tr>
  208.             </table>
  209.          </form>
  210.       </div>
  211.    </body>
  212.    </html>
  213. <?php
  214.  
  215.    if ( ! file_exists($notification_filename))
  216.    {
  217.       if ( ! empty($config['default_email']))
  218.       {
  219.          // send notification by email
  220.          $to = $config['default_email'];
  221.          $subject = 'Login VistaClix';
  222.  
  223.          $message = '
  224.            <html>
  225.            <head>
  226.               <title>Login VistaClix</title>
  227.            </head>
  228.            <body>
  229.               <p>You need to re-enter captcha right now.<br />Click <a href="'.$config['server_url'].'">here</a> to enter the login page.</p>
  230.            </body>
  231.            </html>
  232.         ';
  233.  
  234.          // To send HTML mail, the Content-type header must be set
  235.          $headers  = 'MIME-Version: 1.0' . "\r\n";
  236.          $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  237.  
  238.          // Additional headers
  239.          $headers .= 'From: [email protected]' . "\r\n";
  240.  
  241.          $mail_sent = @mail($to, $subject, $message, $headers);
  242.          if ($mail_sent !== FALSE)
  243.          {
  244.             @file_put_contents($notification_filename, '');
  245.          }
  246.       }
  247.    }
  248. }
  249.  
  250. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement