Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.68 KB | None | 0 0
  1. <?php
  2.  
  3. header("X-Accel-Expires: 0");
  4.  
  5. $login = $_GET['login'];
  6. $pass = $_GET['pass'];
  7.  
  8. function login1($login, $pass){
  9.  
  10. $post = "act=login&role=al_frame&expire=&captcha_sid=&captcha_key=&_origin=https%3A%2F%2Fvk.com&ip_h=7ab6dfc4b71e5a6f56&email=".$login."&pass=".$pass;
  11.  
  12. $fp = fsockopen('*.*.*.*', 1234, $errno, $errstr, 30);
  13.  
  14. if($fp){
  15.  
  16. $out  = "POST /?act=login HTTP/1.0\r\n";
  17. $out .= "Host: login.vk.com\r\n";
  18. $out .= "Connection: keep-alive\r\n";
  19. $out .= "Content-Length: ".strlen($post)."\r\n";
  20. $out .= "Cache-Control: max-age=0\r\n";
  21. $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,* /*;q=0.8\r\n";
  22. $out .= "Origin: https://vk.com";
  23. $out .= "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\r\n";
  24. $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
  25. $out .= "Accept-Encoding: gzip,deflate,lzma,sdch\r\n";
  26. $out .= "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n";
  27. $out .= "Cookie: remixlang=0; remixdt=7200; remixsslsid=1; remixflash=14.0.0; remixscreen_depth=32; remixseenads=0\r\n\r\n";
  28.  
  29. fwrite($fp, $out);
  30. fwrite($fp, $post);
  31.  
  32. $str = fread($fp, 1024);
  33.  
  34. fclose($fp);
  35.  
  36. }
  37.  
  38. return $str;
  39.  
  40. }
  41.  
  42. $l1 = login1($login,$pass);
  43.  
  44. preg_match("/location:(.*)[\r|\n]/siU",$l1,$a);
  45. if($a[1]){
  46. $location = trim($a[1]);
  47. }else{
  48. echo 1;
  49. fwrite(fopen('login.txt','a+'),"preg_match : 1 - ".$login."\n");
  50. #mail("kimsufi@mail.ru", "Error", "preg_match : 1 - ".$login);
  51. exit();
  52. }
  53.  
  54.  
  55. function login2($location){
  56.  
  57. $fp = fsockopen('*.*.*.*', 1234, $errno, $errstr, 30);
  58.  
  59. if($fp){
  60.  
  61. $s = '/login.php';
  62. $ex = explode($s, $location);
  63. $get = $s.$ex[1];
  64.  
  65. $out  = "GET ".$get." HTTP/1.0\r\n";
  66. $out .= "Host: vk.com\r\n";
  67. $out .= "Connection: keep-alive\r\n";
  68. $out .= "Cache-Control: max-age=0\r\n";
  69. $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n";
  70. $out .= "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\r\n";
  71. $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
  72. $out .= "Accept-Encoding: gzip,deflate,lzma,sdch\r\n";
  73. $out .= "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n";
  74. $out .= "Cookie: remixlang=0; remixdt=7200; remixsslsid=1; remixflash=14.0.0; remixscreen_depth=32; remixseenads=0\r\n\r\n";
  75.  
  76. fwrite($fp, $out);
  77.  
  78. $str = fread($fp, 1024);
  79.  
  80. fclose($fp);
  81.  
  82. }
  83.  
  84. return $str;
  85.  
  86. }
  87.  
  88. $l2 = login2($location);
  89.  
  90. preg_match("/remixsid.*=(.*);/siU",$l2,$a);
  91.  
  92. if(strlen($a[1])>0){
  93.  
  94. /* Проверка 1 */
  95.  
  96. $sid = str_replace(';', '', $a[0]);
  97.  
  98. $curl = curl_init();
  99. curl_setopt($curl, CURLOPT_URL, 'http://vk.com/audio');
  100. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  101. curl_setopt($curl, CURLOPT_HEADER, 0);
  102. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  103. curl_setopt($curl, CURLOPT_PROXY, '*.*.*.*:1234');
  104. curl_setopt($curl, CURLOPT_ENCODING, "");
  105. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0');
  106. curl_setopt($curl, CURLOPT_POST, true);
  107. curl_setopt($curl, CURLOPT_POSTFIELDS, "act=search&al=1&gid=0&id=0&offset=0&performer=0&q=Michael+Jackson&sort=0");
  108. #curl_setopt($curl, CURLOPT_COOKIE, "remixsid=".$sid);
  109. curl_setopt($curl, CURLOPT_COOKIE, $sid);
  110. curl_setopt($ch,CURLOPT_TIMEOUT,30);
  111.  
  112. $data = curl_exec($curl);
  113.  
  114. curl_close($curl);
  115.  
  116. preg_match_all("/audio_info([-0-9]+)_([0-9]+)[^0-9].*value=\"(.*)\".*<a href=\"\/search\?c\[q\]=.*\".*\">(.*)<\/a>.*<span class=\"title\">(.*)<\/span><span.*<div class=\"duration fl_r\">(.*)</siU",$data,$a);
  117.  
  118. $c = count($a[1]);
  119.  
  120. if($c>1){
  121. mysql_write($login,$pass,$sid);
  122. }else{
  123. if(stripos($data,'security_check')){
  124. preg_match_all("/login\.php(.*)</siU",$data,$a);
  125.  
  126. if($a[1][0]){
  127.  
  128. $curl = curl_init();
  129. curl_setopt($curl, CURLOPT_URL, 'http://vk.com/login.php'.$a[1][0]);
  130. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  131. curl_setopt($curl, CURLOPT_HEADER, 0);
  132. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  133. curl_setopt($curl, CURLOPT_PROXY, '*.*.*.*:1234');
  134. curl_setopt($curl, CURLOPT_ENCODING, "");
  135. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0');
  136. #curl_setopt($curl, CURLOPT_COOKIE, "remixsid=".$sid);
  137. curl_setopt($curl, CURLOPT_COOKIE, $sid);
  138. curl_setopt($ch,CURLOPT_TIMEOUT,30);
  139.  
  140. $data = curl_exec($curl);
  141.  
  142. curl_close($curl);
  143.  
  144. preg_match_all("/hash: \'([0-9a-z]+)\'/siU",$data,$a);
  145.  
  146. /* Если найден hash */
  147.  
  148. if($a[1][0]){
  149.  
  150. $code = substr($login, 2, -2);
  151.  
  152. $curl = curl_init();
  153. curl_setopt($curl, CURLOPT_URL, 'http://vk.com/login.php?act=security_check');
  154. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  155. curl_setopt($curl, CURLOPT_HEADER, 0);
  156. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  157. curl_setopt($curl, CURLOPT_PROXY, '*.*.*.*:1234');
  158. curl_setopt($curl, CURLOPT_ENCODING, "");
  159. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0');
  160. curl_setopt($curl, CURLOPT_POST, true);
  161. curl_setopt($curl, CURLOPT_POSTFIELDS, "al=1&al_page=3&code=".$code."&hash=".$a[1][0]."&to=");
  162. #curl_setopt($curl, CURLOPT_COOKIE, "remixsid=".$sid);
  163. curl_setopt($curl, CURLOPT_COOKIE, $sid);
  164. curl_setopt($ch,CURLOPT_TIMEOUT,30);
  165.  
  166. $data = curl_exec($curl);
  167. curl_close($curl);
  168.  
  169. /***** Проверка 2 *****/
  170.  
  171. if($data){
  172. $curl = curl_init();
  173. curl_setopt($curl, CURLOPT_URL, 'http://vk.com/audio');
  174. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  175. curl_setopt($curl, CURLOPT_HEADER, 0);
  176. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  177. curl_setopt($curl, CURLOPT_PROXY, '*.*.*.*:1234');
  178. curl_setopt($curl, CURLOPT_ENCODING, "");
  179. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0');
  180. curl_setopt($curl, CURLOPT_POST, true);
  181. curl_setopt($curl, CURLOPT_POSTFIELDS, "act=search&al=1&gid=0&id=0&offset=0&performer=0&q=Michael+Jackson&sort=0");
  182. #curl_setopt($curl, CURLOPT_COOKIE, "remixsid=".$sid);
  183. curl_setopt($curl, CURLOPT_COOKIE, $sid);
  184. curl_setopt($ch,CURLOPT_TIMEOUT,30);
  185.  
  186. echo $data = curl_exec($curl);
  187.  
  188. curl_close($curl);
  189.  
  190. preg_match_all("/audio_info([-0-9]+)_([0-9]+)[^0-9].*value=\"(.*)\".*<a href=\"\/search\?c\[q\]=.*\".*\">(.*)<\/a>.*<span class=\"title\">(.*)<\/span><span.*<div class=\"duration fl_r\">(.*)</siU",$data,$a);
  191. #print_r($a);
  192.  
  193. $c = count($a[1]);
  194.  
  195. if($c>1){
  196. mysql_write($login,$pass,$sid);
  197. }else{
  198. echo '7';
  199. fwrite(fopen('login.txt','a+'),"finish : 7 - ".$login."\n");
  200. #mail("kimsufi@mail.ru", "Error", "finish : 7 - ".$login);
  201. exit();
  202. }
  203.  
  204. }else{
  205. echo '6';
  206. fwrite(fopen('login.txt','a+'),"bad data (Проверка 2) : 6 - ".$login."\n");
  207. #mail("kimsufi@mail.ru", "Error", "bad data (Проверка 2) : 6 - ".$login);
  208. exit();
  209. }
  210. /********************/
  211.  
  212. }else{
  213. echo '5';
  214. fwrite(fopen('login.txt','a+'),"bad hash : 5 - ".$login."\n");
  215. #mail("kimsufi@mail.ru", "Error", "bad hash : 5 - ".$login);
  216. exit();
  217. }
  218.  
  219. /*********************/
  220. }else{
  221. echo '4';
  222. fwrite(fopen('login.txt','a+'),"security_check, preg_match : 4 - ".$login."\n");
  223. #mail("kimsufi@mail.ru", "Error", "security_check, preg_match : 4 - ".$login);
  224. exit();
  225. }
  226.  
  227. }else{
  228. echo '3';
  229. fwrite(fopen('login.txt','a+'),"security_check : 3 - ".$login."\n");
  230. #mail("kimsufi@mail.ru", "Error", "security_check : 3 - ".$login);
  231. exit();
  232. }
  233.  
  234. }
  235.  
  236.  
  237. }else{
  238. echo '2';
  239. fwrite(fopen('login.txt','a+'),"preg_match : 2 - ".$login."\n");
  240. #mail("kimsufi@mail.ru", "Error", "preg_match : 2 - ".$login);
  241. exit();
  242. }
  243.  
  244. function mysql_write($login,$pass,$sid){
  245. #echo $sid;
  246.  
  247. $mysql = mysql_connect('localhost', 'root', 'pass');
  248. mysql_select_db('music');
  249.  
  250. $query = "REPLACE INTO sid VALUES ('".$login."','".$pass."','".$sid."')";
  251. mysql_query($query);
  252.  
  253. mysql_close($mysql);
  254.  
  255. }
  256.  
  257. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement