Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*****************Автоматическая валидация анкет на хостинге через логин пароль один раз в сутки
- if ($cur_hour == 5 and $cur_min == 55) {
- $ridding = fopen('service/passdata.txt', 'r'); $unsr = fgets($ridding, 123456); fclose($ridding); $passdata = unserialize($unsr); ksort($passdata);
- foreach ($tokens as $key => $token) {
- if ($token[token] <> 5) {
- $setonline = vkapi('account.setOnline?access_token='.$token[token].'&v=5.59'); $online_json = json_decode($setonline, true); $errcode = $online_json['error']['error_code'];
- if ($errcode == 17) { $nacc = $key; $phone = $passdata[$nacc]['phone']; $login = $passdata[$nacc]['mail']; $password = $passdata[$nacc]['pass']; $security_check_code = getscode("$phone");
- if (isset($phone) and isset($login) and isset($password)) {
- $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])) { echo 'Не удалось авторизоваться <br /> <br />'.$post_auth['headers']; exit; }
- // переходим по полученной для редиректа ссылке
- $get_auth_location = post(trim($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 getscode($phone) { $sim = substr($phone, 0, 1);
- if($sim == '+') { $phone = substr($phone, 1); }
- $prifixKz = substr($phone, 0, 2);
- $prifixRus = substr($phone, 0, 1);
- $prifixUkr = substr($phone, 0, 2);
- $prifixChina = substr($phone, 0, 2);
- if($prifixKz == '77') { $chunked_code = substr($phone, 2, 7); }
- else if($prifixRus == '7') { $chunked_code = substr($phone, 1, 8); }
- else if($prifixUkr == '38') { $chunked_code = substr($phone, 3, 7); }
- else if($prifixChina == '86') { $chunked_code = substr($phone, 2, 9); }
- else { $phone = array('tel' => $phone, 'country' => 'Unknown'); }
- return $chunked_code; }
- //********функции для валидации страницы
- 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
- ));
- return $get;
- }
- 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);
- }
- //**
- $time_start = microtime(true);
- $time_end = microtime(true);
- $time_full = $time_end - $time_start;
- $cur_date = date('H:i-d:m');
- $fp = fopen ("microtime.txt", 'a+'); fwrite($fp, "$time_full at $cur_min - $cur_date \r\n"); fclose($fp);
- //***
- if (is_array($proxyraw) and is_array($new_proxy_raw)) { $sumresult = array_replace($proxyraw, $new_proxy_raw); ssnwrite($sumresult, "service/proxyraw.txt"); }
- if (!is_array($proxyraw) and is_array($new_proxy_raw)) { ssnwrite($new_proxy_raw, "service/proxyraw.txt"); }
- // обновление данных мускль телеграм бота
- if (strlen($tgpeer) < 3) {
- $getupdates = tgapi($tgtoken, getUpdates); $jdecode = json_decode($getupdates, 1);
- $tginterlocutor = $jdecode['result']['0']['message']['from']['id']; $uname = $jdecode['result']['0']['message']['from']['username'];
- if ($tgpeer == 0) { $link = mysqli_connect($host, $sql_user, $sql_pass, $sql_user);
- $query = "UPDATE telegram SET tgnum = $tgnum, tgtoken = '$tgtoken', tgname = '$tgname', tginterlocutor = '$tginterlocutor', uname = '$uname' WHERE tgnum = $tgnum";
- $result = mysqli_query($link, $query) or die("Ошибка " . mysqli_error($link)); }
- mysqli_close($link);
- }
Advertisement
Add Comment
Please, Sign In to add comment