Advertisement
Guest User

Untitled

a guest
Dec 26th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. <?php
  2. $count = 0;
  3. $captcha = 0;
  4. $aim = $_POST['aim']; //245909964;
  5.  
  6. if (empty($aim)) {
  7. $aim = 1;
  8. }
  9. $c = $_POST['count'];
  10. $group = 157188546;
  11. $data = array ("", ""); //(id, pass, id2, pass2...)
  12. $i = 0;
  13. $j = 0;
  14. $client_id = '3697615';
  15. $client_secret = 'AlVXZFMUqyrnABp8ncuU';
  16. $domain = 'https://oauth.vk.com/';
  17.  
  18. function send_captcha($image_id) {
  19. $imagedata = file_get_contents('http://api.vk.com/captcha.php?sid=660914944611');
  20. $base64 = base64_encode($imagedata);
  21. $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'task' => array('type' => 'ImageToTextTask', 'body' => $base64));
  22. $json = json_encode($request_data);
  23. $ch = curl_init('https://api.anti-captcha.com/createTask');
  24. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  25. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  26. curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
  27. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  28.  
  29. $response = curl_exec($ch);
  30. $obj = json_decode($response);
  31. return $obj->{'taskId'};
  32. }
  33.  
  34. function get_captcha_text($task_id) {
  35. $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'taskId' => $task_id);
  36. $json = json_encode($request_data);
  37. $ch = curl_init('https://api.anti-captcha.com/getTaskResult');
  38. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  39. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  40. curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
  41. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  42. $response = curl_exec($ch);
  43. $obj = json_decode($response);
  44. if (($obj->{'errorId'}) == 0) {
  45. if ($obj->{'status'} == 'ready') {
  46. if (!(empty($obj->{'solution'}->{'text'}))) {
  47. return $obj->{'solution'}->{'text'};
  48. }
  49. } else {
  50. sleep(2);
  51. $text = get_captcha_text($task_id);
  52. return $text;
  53. }
  54. } else {
  55. return 1;
  56. }
  57. }
  58.  
  59. $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'task' => array('type' => 'ImageToTextTask', 'body' => $base64) );
  60. $json = json_encode($request_data);
  61.  
  62. function get_curl($url) {
  63. if (function_exists('curl_init')) {
  64. $ch = curl_init();
  65. curl_setopt($ch, CURLOPT_URL, $url);
  66. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  67. curl_setopt($ch, CURLOPT_HEADER, 0);
  68. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  69. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  70. $output = curl_exec($ch);
  71. echo curl_error($ch);
  72. curl_close($ch);
  73. return $output;
  74. } else {
  75. return file_get_contents($url);
  76. }
  77. }
  78.  
  79. while (!(empty($data[$i]))) {
  80. $url = $domain.'token?grant_type=password&client_id='.$client_id.'&client_secret='.$client_secret.'&username='.$data[$i++].'&password='.$data[$i++].'&v=5.69&2fa_supported=1';
  81. $html = get_curl($url, true);
  82. $obj = json_decode($html);
  83. if (empty($obj->{'error'})) {
  84. $array[$j]['token'] = $obj->{'access_token'};
  85. $array[$j++]['uid'] = $obj->{'user_id'};
  86. }
  87. }
  88. $j = 0;
  89. while ($count < $c) {
  90. usleep(500000);
  91. $url = 'https://api.vk.com/method/groups.invite?group_id='.$group.'&user_id='.$aim.'&v=5.59&access_token='.$array[$j]['token'].$param;
  92. if (!(empty($param))) {
  93. $param = '';
  94. }
  95. $html = get_curl($url, true);
  96. $obj = json_decode($html);
  97. //var_dump($obj);
  98. //die();
  99. if (($obj->{'error'}->{'error_code'}) == 14) {
  100. $task = send_captcha($task);
  101. sleep(2);
  102. $text = get_captcha_text($task);
  103. $param = '&captcha_sid=660914944611&captcha_key='.$text;
  104. $captcha++;
  105. } else {
  106. if (($obj->{'error'}->{'error_code'}) == 103) {
  107. die('<b>Упс. Лимит на приглашения.</b> <br>Разослано пришлашений: '.$count.' <br>Введено каптч: '.$captcha.' <br>ID группы: '.$group);
  108. } else {
  109. if (($obj->{'error'}->{'error_code'}) == 15) {
  110. die("<b>".$obj->{'error'}->{'error_msg'}.".</b> <br>Разослано пришлашений: ".$count." <br>Введено каптч: ".$captcha." <br>ID группы: ".$group);
  111. } else {
  112. if (($obj->{'error'}->{'error_code'}) == '') {
  113. $j += 2;
  114. $count++;
  115. if (empty($array[$j]['token'])) {
  116. $j = 0;
  117. }
  118. }
  119. }
  120. }
  121. }
  122. $url = 'https://api.vk.com/method/groups.removeUser?group_id='.$group.'&user_id='.$aim.'&v=5.59&access_token='.$array[$j]['token'];
  123. $html = get_curl($url, true);
  124. }
  125. echo 'Разослано пришлашений: '.$count.' <br>Введено каптч: '.$captcha.' <br>ID группы: '.$group;
  126.  
  127. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement