Advertisement
Guest User

noga t.me/spamcartel

a guest
Oct 20th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.60 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. header('Content-Type: text/html; charset=utf-8');
  4.  
  5. /*
  6. $ch = curl_init();
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. //curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Requested-With: XMLHttpRequest'));
  9. curl_setopt($ch, CURLOPT_USERAGENT, $ua);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. //curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
  12. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  13. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  14. curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  16. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  17. curl_setopt($ch, CURLOPT_PROXY, $proxy);
  18. curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  19. curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
  20. curl_setopt($ch, CURLOPT_COOKIEJAR, realpath($cookiesFile));
  21. curl_setopt($ch, CURLOPT_COOKIEFILE, realpath($cookiesFile));
  22. curl_setopt($ch, CURLOPT_REFERER, 'http://google.com');
  23. $result = curl_exec($ch);
  24. curl_close($ch);
  25. */
  26.  
  27.  
  28.  
  29. /*
  30. * Создание нового файла
  31.  
  32. create ('test.txt');
  33.  
  34. */
  35.  
  36. function create ($file) {
  37. $create = fopen(realpath($file), "w");
  38. fclose($create);
  39. }
  40.  
  41.  
  42.  
  43. /*
  44. * Сохранение в файл
  45.  
  46. save ('test.txt', "Hello World");
  47.  
  48. */
  49.  
  50. function save (
  51. $file,
  52. $data
  53. ) {
  54. $file = realpath($file);
  55. $current = file_get_contents($file);
  56. $current .= $data . "\r\n";
  57. file_put_contents($file, $current);
  58. }
  59.  
  60.  
  61.  
  62. /*
  63. * System Result
  64.  
  65. saveSys ($result);
  66.  
  67. */
  68.  
  69. function saveSys (
  70. $data
  71. ) {
  72. $file = realpath('saveSys.txt');
  73.  
  74. $create = fopen($file, "w");
  75. fclose($create);
  76.  
  77. $current = file_get_contents($file);
  78. $current .= $data . "\r\n";
  79. file_put_contents($file, $current);
  80. }
  81.  
  82.  
  83.  
  84. /*
  85. * Save Page
  86.  
  87. savePage ($result);
  88.  
  89. */
  90.  
  91. function savePage (
  92. $data
  93. ) {
  94. $file = realpath('page.html');
  95.  
  96. $create = fopen($file, "w");
  97. fclose($create);
  98.  
  99. $current = file_get_contents($file);
  100. $current .= $data . "\r\n";
  101. file_put_contents($file, $current);
  102. }
  103.  
  104.  
  105.  
  106. /*
  107. * Удаление первой строки из файла
  108.  
  109. delStr ('test.txt');
  110.  
  111. */
  112.  
  113. function delStr (
  114. $file
  115. ) {
  116. $lines = file(realpath($file));
  117. unset($lines[0]);
  118. file_put_contents($file, implode('', $lines));
  119. }
  120.  
  121.  
  122.  
  123. /*
  124. * Рандомизатор
  125.  
  126. $text = '{Hello|Hi|Yo}';
  127. echo rnd ($text);
  128.  
  129. */
  130.  
  131. function rnd($text) {
  132. while (preg_match('#\{([^\{\}]+)\}#i', $text, $m)) {
  133. $v = explode('|', $m[1]);
  134. $i = rand(0, count($v) - 1);
  135. $text = preg_replace('#'.preg_quote($m[0]).'#i', $v[$i], $text, 1);
  136. }
  137. return $text;
  138. }
  139.  
  140.  
  141.  
  142. /*
  143. * Генерация
  144.  
  145. echo gen();
  146.  
  147. */
  148.  
  149. function gen($length = 10) {
  150. $chars = 'qwertyuiopasdfghjklzxcvbnm0123456789';
  151. $numChars = strlen($chars);
  152. $string = '';
  153. for ($i = 0; $i < $length; $i++) {
  154. $string .= substr($chars, rand(1, $numChars) - 1, 1);
  155. }
  156. return $string;
  157. }
  158.  
  159.  
  160.  
  161. /*
  162. * ruCaptcha
  163.  
  164. $recognize = recognize();
  165.  
  166. */
  167.  
  168. function recognize(
  169. $filename = 'captcha.png',
  170. $apikey = '***',
  171. $is_verbose = true,
  172. $domain = 'rucaptcha.com',
  173. $rtimeout = 5,
  174. $mtimeout = 120,
  175. $is_phrase = 0,
  176. $is_regsense = 0,
  177. $is_numeric = 1,
  178. $min_len = 4,
  179. $max_len = 7,
  180. $language = 0
  181. ) {
  182. if (!file_exists($filename))
  183. {
  184. if ($is_verbose) echo "file $filename not found\n";
  185. return false;
  186. }
  187. $postdata = array(
  188. 'method' => 'post',
  189. 'key' => $apikey,
  190. 'file' => new CurlFile($filename),
  191. 'phrase' => $is_phrase,
  192. 'regsense' => $is_regsense,
  193. 'numeric' => $is_numeric,
  194. 'min_len' => $min_len,
  195. 'max_len' => $max_len,
  196. 'language' => $language
  197.  
  198. );
  199. $ch = curl_init();
  200. curl_setopt($ch, CURLOPT_URL, "http://$domain/in.php");
  201. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  202. curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  203. curl_setopt($ch, CURLOPT_POST, 1);
  204. curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  205. $result = curl_exec($ch);
  206. if (curl_errno($ch))
  207. {
  208. if ($is_verbose) echo "CURL returned error: ".curl_error($ch)."\n";
  209. return false;
  210. }
  211. curl_close($ch);
  212. if (strpos($result, "ERROR")!==false)
  213. {
  214. if ($is_verbose) echo "server returned error: $result\n";
  215. return false;
  216. }
  217. else
  218. {
  219. $ex = explode("|", $result);
  220. $captcha_id = $ex[1];
  221. if ($is_verbose) echo "captcha sent, got captcha ID $captcha_id\n";
  222. $waittime = 0;
  223. if ($is_verbose) echo "waiting for $rtimeout seconds\n";
  224. sleep($rtimeout);
  225. while(true)
  226. {
  227. $result = file_get_contents("http://$domain/res.php?key=".$apikey.'&action=get&id='.$captcha_id);
  228. if (strpos($result, 'ERROR')!==false)
  229. {
  230. if ($is_verbose) echo "server returned error: $result\n";
  231. return false;
  232. }
  233. if ($result=="CAPCHA_NOT_READY")
  234. {
  235. if ($is_verbose) echo "captcha is not ready yet\n";
  236. $waittime += $rtimeout;
  237. if ($waittime>$mtimeout)
  238. {
  239. if ($is_verbose) echo "timelimit ($mtimeout) hit\n";
  240. break;
  241. }
  242. if ($is_verbose) echo "waiting for $rtimeout seconds\n";
  243. sleep($rtimeout);
  244. }
  245. else
  246. {
  247. $ex = explode('|', $result);
  248. if (trim($ex[0])=='OK') return trim($ex[1]);
  249. }
  250. }
  251.  
  252. return false;
  253. }
  254. }
  255.  
  256.  
  257.  
  258. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement