Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.52 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors','On');
  3. error_reporting('E_ALL');
  4. function rm_by_val($needle, &$array, $all = true){
  5. if(!$all){
  6. if(FALSE !== $key = array_search($needle,$array)) unset($array[$key]);
  7. return;
  8. }
  9. foreach(array_keys($array,$needle) as $key){
  10. unset($array[$key]);
  11. }
  12. }
  13. include_once("config.php");
  14. include_once("captcha.php");
  15. function login($login,$pass,$hash,$proxy)
  16. {
  17. $cookie = "cookies/".$hash.".txt";
  18. // file_put_contents($cookie,"");
  19. if( !cURLcheckBasicFunctions() ){
  20. echo "ohohoohoh! ВООБЩЕ LOL КАК ТАКОЕ МОЖЕТ БЫТЬ ЭТО Ж НЕВОЗМОЖНО!1! ВСЕ ПЛОХО, КОРОЧЕ!";
  21. }
  22. $ch = curl_init();
  23.  
  24. $acc = explode(":",$proxy);
  25. $plogin = $acc[0];
  26. $dog = strrpos($acc[1],"@");
  27. $ppassword = substr($acc[1],0,$dog);
  28. /*
  29.  
  30. 1Ywdk4uJ5Iks:darmir2012@gmail.com@193.124.187.166:40961
  31.  
  32. */
  33. // $ppassword = explode("@",$acc[3])[0];
  34. $proxy = substr($acc[1],$dog+1,strlen($acc[1]));//explode(":",explode("@",$acc[3])[1])[0];
  35. $phost = $proxy;
  36. $pport = $acc[2];
  37. ///////////////////
  38. ///////////////////////
  39.  
  40. if($proxy == "none") $proxy = false;
  41. else {
  42. $proxy = $proxy.":".$pport;
  43. }
  44. ////////////////////////////////
  45. if($ch)
  46. {
  47. if(!curl_setopt($ch,CURLOPT_URL, "http://m.vk.com") )
  48. {
  49. // fclose($fp); // to match fopen()
  50. echo "очынь страна!1!!!1!";
  51. curl_close($ch); // to match curl_init()
  52. return false;
  53. }
  54.  
  55. if($proxy !== false){
  56. if( !curl_setopt($ch, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
  57. if($plogin != 'none') curl_setopt($ch, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
  58. //////////////////////////////////////////////////////////////////////////////
  59. //KILL THIS!1!1!1!111!!
  60. /////////////////////////////////////////////////////////////////////////////
  61. }
  62. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
  63.  
  64. if( !curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
  65. if( !curl_setopt($ch, CURLOPT_HEADER, 1) ) ui_net_error();
  66. if( !curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
  67. if( !curl_setopt($ch, CURLOPT_TIMEOUT, 30)) ui_net_error();
  68. if( !curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
  69.  
  70. if( ! ($res = curl_exec($ch)) ) ui_net_error();
  71.  
  72. curl_close($ch);
  73. file_put_contents("proxy_error.log",$res."\n====\n".$proxy."|_|".$plogin."=".$ppassword);
  74. $tags = preg_match('|<form method="post" action="(.*?)" novalidate>|sei',$res,$regs);
  75. if(count($regs)===0){
  76. file_put_contents("proxy_error.log",$res."\n====\n".$proxy."|_|".$plogin."=".$ppassword);
  77. vkgg_error("Ошибка прокси!");
  78. return false;
  79. }
  80.  
  81. $link = $regs[1];
  82. //////////////////////
  83.  
  84. $data = array();
  85. $data['email'] = $login;
  86. $data['pass'] = $pass;
  87. $curl = curl_init();
  88. if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
  89. if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
  90. if( !curl_setopt($curl,CURLOPT_POST, true)) ui_net_error();
  91. if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
  92. if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
  93. if( !curl_setopt($curl,CURLOPT_POSTFIELDS, $data))ui_net_error();
  94. // curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
  95. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
  96. if($proxy !== false){
  97. if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
  98. if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
  99. //////////////////////////////////////////////////////////////////////////////
  100. //KILL THIS!1!1!1!111!!
  101. /////////////////////////////////////////////////////////////////////////////
  102. }
  103. if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
  104. if( !curl_setopt($curl, CURLOPT_HEADER, 1))ui_net_error();
  105. if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1))ui_net_error();
  106. curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
  107. $result = curl_exec($curl);
  108. curl_close($curl);
  109. file_put_contents("logined1.log",$result);
  110.  
  111. if(strpos($result,'<img id="captcha" alt=')){
  112. echo "Ожидаем капчу...<br/>";
  113. $tags = preg_match('|<form method="post" action="(.*?)" novalidate>|sei',$result,$regs);
  114. if(count($regs)===0){
  115. // file_put_contents("curr_proxy.txt",$proxy);
  116. echo "странно";
  117. return false;
  118. }
  119. $link = $regs[1];
  120. $tags = preg_match('|type="hidden" name="captcha_sid" value="(.*?)"|sei',$result,$regs);
  121. if(count($regs)===0){
  122. echo "странно";
  123. return false;
  124. }
  125. $sid = $regs[1];
  126. //////////////////////
  127. // echo $link."=".$sid.";";
  128. $data = array();
  129. $data['email'] = $login;
  130. $data['pass'] = $pass;
  131. $data['captcha_sid'] = $sid;
  132. $data['captcha_key'] = sendCaptcha($sid,0);
  133. // echo ":".$data['captcha_key'].":";
  134. $curl = curl_init();
  135. if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
  136. if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
  137. if( !curl_setopt($curl,CURLOPT_POST, true)) ui_net_error();
  138. if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
  139. if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
  140. // curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
  141. if( !curl_setopt($curl,CURLOPT_POSTFIELDS, $data))ui_net_error();
  142. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
  143. if($proxy !== false){
  144. if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
  145. if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
  146. //////////////////////////////////////////////////////////////////////////////
  147. //KILL THIS!1!1!1!111!!
  148. /////////////////////////////////////////////////////////////////////////////
  149. }
  150. if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
  151. if( !curl_setopt($curl, CURLOPT_HEADER, 1))ui_net_error();
  152. // if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true))ui_net_error();
  153. curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
  154. $result = curl_exec($curl);
  155. curl_close($curl);
  156.  
  157. $tags = preg_match('|Location: (.*?)\r\n|m',$result,$regs);
  158. if(count($regs)===0){
  159. echo "Ошибка с прокси";
  160. return false;
  161. }
  162.  
  163. $link = $regs[1];
  164. if(strpos($result,"cation: http://m.vk.com/login?role=fast&to=&s=1&m=1&emai")){
  165. vkgg_error("Пароль/логин неверный");
  166. return false;
  167. }
  168. $curl = curl_init();
  169. if( !curl_setopt($curl,CURLOPT_URL, $link)) ui_net_error();
  170. if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
  171. curl_setopt($curl, CURLOPT_HEADER, 1);
  172. if( !curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie) ) ui_net_error();
  173. if( !curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie) ) ui_net_error();
  174. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208');
  175. if($proxy !== false){
  176. if( !curl_setopt($curl, CURLOPT_PROXY, $proxy)) echo "Ошибка прокси";
  177. if($plogin != 'none') curl_setopt($curl, CURLOPT_PROXYUSERPWD,$plogin.":".$ppassword);
  178. //////////////////////////////////////////////////////////////////////////////
  179. //KILL THIS!1!1!1!111!!
  180. /////////////////////////////////////////////////////////////////////////////
  181. }
  182. if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
  183. curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
  184. // curl_setopt($curl,CURLOPT_FOLLOWLOCATION, true);
  185. $result = curl_exec($curl);
  186. curl_close($curl);echo "HE OK";
  187. }
  188. file_put_contents("newSTproxy.txt",$result);
  189.  
  190. if(strpos($result,"cation: http://m.vk.com/login?role=fast&to=&s=1&m=1&emai")){
  191. vkgg_error("Пароль/логин неверный");
  192. return false;
  193. }
  194. echo "BCE OK";
  195. file_put_contents("login_complete.txt",$result);
  196. return true;
  197. }
  198. else return false;
  199.  
  200.  
  201. }
  202. function curl_fast_get($url){
  203. $curl = curl_init();
  204. if( !curl_setopt($curl,CURLOPT_URL, $url)) ui_net_error();
  205. if( !curl_setopt($curl, CURLOPT_RETURNTRANSFER, true) ) ui_net_error();
  206. if( !curl_setopt($curl, CURLOPT_COOKIEFILE, "file.txt") ) ui_net_error();
  207. if( !curl_setopt($curl, CURLOPT_COOKIEJAR, "file.txt") ) ui_net_error();
  208. if( !curl_setopt($curl, CURLOPT_TIMEOUT, 30)) ui_net_error();
  209. if( !curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE))ui_net_error();
  210. curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
  211. $result = curl_exec($curl);
  212. curl_close($curl);
  213. return $result;
  214. }
  215. function ui_net_error(){
  216. echo "<p class='error'>Ошибка подключения к серверам вконтакте</p>";
  217. return false;
  218. }
  219.  
  220. function ui_enter_yet(){
  221. echo "<p class='info'>Вход уже выполнен</p>";
  222. }
  223.  
  224. function cURLcheckBasicFunctions()
  225. {
  226. if( !function_exists("curl_init") &&
  227. !function_exists("curl_setopt") &&
  228. !function_exists("curl_exec") &&
  229. !function_exists("curl_close") ) return false;
  230. else return true;
  231. }
  232.  
  233. function getCountry($id=-1){
  234. $js = json_decode(file_get_contents("country.json"),true);
  235. if($id===-1){
  236. return $js['countries'];
  237. }
  238. foreach($js['countries'] as $c){
  239. if($c[0] === $id) return $c[1];
  240. }
  241. return false;
  242. }
  243.  
  244. function get_tasks(){
  245. $all = array_slice(scandir($_SERVER['DOCUMENT_ROOT']."/tasks"),2);
  246. return $all;
  247. }
  248. function vkgg_error($msg){
  249. echo "<p style='color:#c0392b;font-weight:bold;'>".$msg."</p>";
  250. }
  251. function vkgg_success($msg){
  252. echo "<p style='color:#27ae60;'>".$msg."</p>";
  253. }
  254. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement