Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $filename = 'disable.cron';
- clearstatcache();
- if (file_exists($filename))
- exit();
- $time_limit = 60*60;
- ini_set('max_execution_time', $time_limit);
- set_time_limit($time_limit);
- include_once 'config.php';
- include_once '../simple_html_dom.php';
- $gacookie = getcwd()."/file.cookie";
- @chmod($gacookie, 0777);
- $logged_in = FALSE;
- $url = 'https://vistaclix.com/login.php';
- $referer = 'https://vistaclix.com/login.php';
- $ch = curl_init();
- curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
- curl_setopt ($ch, CURLOPT_COOKIESESSION, 0);
- curl_setopt ($ch, CURLOPT_FAILONERROR, 0);
- curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
- curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1);
- //curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt ($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
- curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
- curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
- if ($config['use_proxy'] !== FALSE)
- {
- curl_setopt ($ch, CURLOPT_PROXY, $config['proxy']);
- curl_setopt ($ch, CURLOPT_PROXYUSERPWD, $config['proxy_username'].':'.$config['proxy_password']);
- }
- curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
- curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
- curl_setopt ($ch, CURLOPT_ENCODING, "");
- //curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
- curl_setopt ($ch, CURLOPT_REFERER, $referer);
- curl_setopt ($ch, CURLOPT_URL, $url);
- 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");
- $response = curl_exec($ch);
- $error = curl_error($ch);
- $info = curl_getinfo($ch);
- $err_no = curl_errno($ch);
- curl_close($ch);
- unset($ch);
- if ($err_no)
- {
- echo $error;
- echo '<br /><br />Back to the <a href="index.php">main page</a>.';
- exit();
- }
- $html = str_get_html($response);
- $links = $html->find('li a');
- if (isset($links))
- {
- foreach ($links as $link)
- {
- $link_my_account = $link->href;
- $pos = stripos($link_my_account, '/acc.php');
- if ($pos !== FALSE)
- {
- $logged_in = TRUE;
- break;
- }
- }
- }
- $html->clear();
- unset($html);
- $notification_filename = 'notify_login.mail';
- if ($logged_in)
- {
- if (file_exists($notification_filename))
- @unlink($notification_filename);
- include_once 'vistaclix.com.php';
- }
- else
- {
- $html = str_get_html($response);
- $token = '';
- $form = $html->find('form[method=post]', 0);
- if (isset($form))
- $token = $form->find('input[name=token]', 0)->value;
- $html->clear();
- unset($html);
- // get the captcha image
- $url = 'https://vistaclix.com/image.php';
- $referer = 'https://vistaclix.com/login.php';
- $ch = curl_init();
- curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
- curl_setopt ($ch, CURLOPT_COOKIESESSION, 0);
- curl_setopt ($ch, CURLOPT_FAILONERROR, 0);
- curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
- curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1);
- //curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt ($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
- curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
- curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
- if ($config['use_proxy'] !== FALSE)
- {
- curl_setopt ($ch, CURLOPT_PROXY, $config['proxy']);
- curl_setopt ($ch, CURLOPT_PROXYUSERPWD, $config['proxy_username'].':'.$config['proxy_password']);
- }
- curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
- curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
- curl_setopt ($ch, CURLOPT_ENCODING, "");
- //curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
- curl_setopt ($ch, CURLOPT_REFERER, $referer);
- curl_setopt ($ch, CURLOPT_URL, $url);
- 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");
- $response = curl_exec($ch);
- $error = curl_error($ch);
- $info = curl_getinfo($ch);
- $err_no = curl_errno($ch);
- curl_close($ch);
- unset($ch);
- if ($err_no)
- {
- echo $error;
- echo '<br /><br />Back to the <a href="index.php">main page</a>.';
- exit();
- }
- if ( ! empty($info['content_type']) and ($info['http_code'] == 200) and ($info['header_size'] > 0))
- {
- switch ($info['content_type'])
- {
- case 'image/png':
- $captcha_filename = 'captcha.png';
- break;
- case 'image/jpeg':
- $captcha_filename = 'captcha.jpg';
- break;
- default:
- $captcha_filename = 'captcha.jpg';
- break;
- }
- }
- if (empty($captcha_filename))
- {
- echo 'Failed to retrieve captcha image.';
- echo '<br /><br />Back to the <a href="index.php">main page</a>.';
- exit();
- }
- $captcha_filename = 'images/'.$captcha_filename;
- @chmod('images', 0777);
- @file_put_contents($captcha_filename, $response);
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>VistaClix Autosurf</title>
- <link href="images/favicon.ico" rel="shortcut icon" />
- </head>
- <body>
- <div align="center">
- <form method="post" action="vistaclix.com.php">
- <input type="hidden" name="token" value="<?php echo $token; ?>" />
- <table>
- <tr>
- <td></td>
- <td><img src="<?php echo $captcha_filename; ?>"></td>
- </tr>
- <tr>
- <td><label for="captcha_code">Captcha</label></td>
- <td><input type="text" name="captcha_code" size="21" /></td>
- </tr>
- <tr>
- <td></td>
- <td align="left"><input type="submit" name="login" value="Auto Surf"></td>
- </tr>
- </table>
- </form>
- </div>
- </body>
- </html>
- <?php
- if ( ! file_exists($notification_filename))
- {
- if ( ! empty($config['default_email']))
- {
- // send notification by email
- $to = $config['default_email'];
- $subject = 'Login VistaClix';
- $message = '
- <html>
- <head>
- <title>Login VistaClix</title>
- </head>
- <body>
- <p>You need to re-enter captcha right now.<br />Click <a href="'.$config['server_url'].'">here</a> to enter the login page.</p>
- </body>
- </html>
- ';
- // To send HTML mail, the Content-type header must be set
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- // Additional headers
- $mail_sent = @mail($to, $subject, $message, $headers);
- if ($mail_sent !== FALSE)
- {
- @file_put_contents($notification_filename, '');
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement