Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors','On');
- error_reporting('E_ALL');
- function rm_by_val($needle, &$array, $all = true){
- if(!$all){
- if(FALSE !== $key = array_search($needle,$array)) unset($array[$key]);
- return;
- }
- foreach(array_keys($array,$needle) as $key){
- unset($array[$key]);
- }
- }
- include_once("config.php");
- include_once("captcha.php");
- function login($login,$pass,$hash,$proxy)
- {
- $cookie = "cookies/".$hash.".txt";
- // file_put_contents($cookie,"");
- if( !cURLcheckBasicFunctions() ){
- echo "ohohoohoh! ВООБЩЕ LOL КАК ТАКОЕ МОЖЕТ БЫТЬ ЭТО Ж НЕВОЗМОЖНО!1! ВСЕ ПЛОХО, КОРОЧЕ!";
- }
- $ch = curl_init();
- $acc = explode(":",$proxy);
- $plogin = $acc[0];
- $dog = strrpos($acc[1],"@");
- $ppassword = substr($acc[1],0,$dog);
- /*
- 1Ywdk4uJ5Iks:darmir2012@gmail.com@193.124.187.166:40961
- */
- // $ppassword = explode("@",$acc[3])[0];
- $proxy = substr($acc[1],$dog+1,strlen($acc[1]));//explode(":",explode("@",$acc[3])[1])[0];
- $phost = $proxy;
- $pport = $acc[2];
- ///////////////////
- ///////////////////////
- if($proxy == "none") $proxy = false;
- else {
- $proxy = $proxy.":".$pport;
- }
- ////////////////////////////////
- if($ch)
- {
- if(!curl_setopt($ch,CURLOPT_URL, "http://m.vk.com") )
- {
- // fclose($fp); // to match fopen()
- echo "очынь страна!1!!!1!";
- curl_close($ch); // to match curl_init()
- return false;
- }
- if($proxy !== false){
- if( !curl_setopt($ch, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
- if($plogin != 'none') curl_setopt($ch, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
- //////////////////////////////////////////////////////////////////////////////
- //KILL THIS!1!1!1!111!!
- /////////////////////////////////////////////////////////////////////////////
- }
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
- if( !curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
- if( !curl_setopt($ch, CURLOPT_HEADER, 1) ) ui_net_error();
- if( !curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
- if( !curl_setopt($ch, CURLOPT_TIMEOUT, 30)) ui_net_error();
- if( !curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
- if( ! ($res = curl_exec($ch)) ) ui_net_error();
- curl_close($ch);
- file_put_contents("proxy_error.log",$res."\n====\n".$proxy."|_|".$plogin."=".$ppassword);
- $tags = preg_match('|<form method="post" action="(.*?)" novalidate>|sei',$res,$regs);
- if(count($regs)===0){
- file_put_contents("proxy_error.log",$res."\n====\n".$proxy."|_|".$plogin."=".$ppassword);
- vkgg_error("Ошибка прокси!");
- return false;
- }
- $link = $regs[1];
- //////////////////////
- $data = array();
- $data['email'] = $login;
- $data['pass'] = $pass;
- $curl = curl_init();
- if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
- if( !curl_setopt($curl,CURLOPT_POST, true)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
- if( !curl_setopt($curl,CURLOPT_POSTFIELDS, $data))ui_net_error();
- // curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
- curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
- if($proxy !== false){
- if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
- if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
- //////////////////////////////////////////////////////////////////////////////
- //KILL THIS!1!1!1!111!!
- /////////////////////////////////////////////////////////////////////////////
- }
- if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_HEADER, 1))ui_net_error();
- if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1))ui_net_error();
- curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($curl);
- curl_close($curl);
- file_put_contents("logined1.log",$result);
- if(strpos($result,'<img id="captcha" alt=')){
- echo "Ожидаем капчу...<br/>";
- $tags = preg_match('|<form method="post" action="(.*?)" novalidate>|sei',$result,$regs);
- if(count($regs)===0){
- // file_put_contents("curr_proxy.txt",$proxy);
- echo "странно";
- return false;
- }
- $link = $regs[1];
- $tags = preg_match('|type="hidden" name="captcha_sid" value="(.*?)"|sei',$result,$regs);
- if(count($regs)===0){
- echo "странно";
- return false;
- }
- $sid = $regs[1];
- //////////////////////
- // echo $link."=".$sid.";";
- $data = array();
- $data['email'] = $login;
- $data['pass'] = $pass;
- $data['captcha_sid'] = $sid;
- $data['captcha_key'] = sendCaptcha($sid,0);
- // echo ":".$data['captcha_key'].":";
- $curl = curl_init();
- if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
- if( !curl_setopt($curl,CURLOPT_POST, true)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
- // curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
- if( !curl_setopt($curl,CURLOPT_POSTFIELDS, $data))ui_net_error();
- curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
- if($proxy !== false){
- if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
- if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
- //////////////////////////////////////////////////////////////////////////////
- //KILL THIS!1!1!1!111!!
- /////////////////////////////////////////////////////////////////////////////
- }
- if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_HEADER, 1))ui_net_error();
- // if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true))ui_net_error();
- curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($curl);
- curl_close($curl);
- $tags = preg_match('|Location: (.*?)\r\n|m',$result,$regs);
- if(count($regs)===0){
- echo "Ошибка с прокси";
- return false;
- }
- $link = $regs[1];
- if(strpos($result,"cation: http://m.vk.com/login?role=fast&to=&s=1&m=1&emai")){
- vkgg_error("Пароль/логин неверный");
- return false;
- }
- $curl = curl_init();
- if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
- curl_setopt($curl, CURLOPT_HEADER, 1);
- if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
- curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
- if($proxy !== false){
- if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
- if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
- //////////////////////////////////////////////////////////////////////////////
- //KILL THIS!1!1!1!111!!
- /////////////////////////////////////////////////////////////////////////////
- }
- if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
- curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
- // curl_setopt($curl,CURLOPT_FOLLOWLOCATION, true);
- $result = curl_exec($curl);
- curl_close($curl);echo "HE OK";
- }
- file_put_contents("newSTproxy.txt",$result);
- if(strpos($result,"cation: http://m.vk.com/login?role=fast&to=&s=1&m=1&emai")){
- vkgg_error("Пароль/логин неверный");
- return false;
- }
- echo "BCE OK";
- file_put_contents("login_complete.txt",$result);
- return true;
- }
- else return false;
- }
- function curl_fast_get($url){
- $curl = curl_init();
- if( !curl_setopt($curl,CURLOPT_URL, $url)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEFILE, "file.txt") ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_COOKIEJAR, "file.txt") ) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
- if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE))ui_net_error();
- curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($curl);
- curl_close($curl);
- return $result;
- }
- function ui_net_error(){
- echo "<p class='error'>Ошибка подключения к серверам вконтакте</p>";
- return false;
- }
- function ui_enter_yet(){
- echo "<p class='info'>Вход уже выполнен</p>";
- }
- function cURLcheckBasicFunctions()
- {
- if( !function_exists("curl_init") &&
- !function_exists("curl_setopt") &&
- !function_exists("curl_exec") &&
- !function_exists("curl_close") ) return false;
- else return true;
- }
- function getCountry($id=-1){
- $js = json_decode(file_get_contents("country.json"),true);
- if($id===-1){
- return $js['countries'];
- }
- foreach($js['countries'] as $c){
- if($c[0] === $id) return $c[1];
- }
- return false;
- }
- function get_tasks(){
- $all = array_slice(scandir($_SERVER['DOCUMENT_ROOT']."/tasks"),2);
- return $all;
- }
- function vkgg_error($msg){
- echo "<p style='color:#c0392b;font-weight:bold;'>".$msg."</p>";
- }
- function vkgg_success($msg){
- echo "<p style='color:#27ae60;'>".$msg."</p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement