Skip to content

Instantly share code, notes, and snippets.

@mrbrutti
Created September 14, 2009 17:31
Show Gist options
  • Save mrbrutti/186788 to your computer and use it in GitHub Desktop.
Save mrbrutti/186788 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'base64'
class BMN
def self.decode(input, offset)
# thanks tlrobinson @ github
input.unpack("m*")[0][4..-1].unpack("C*").map{|c| c - offset }.pack("C*")
end
def self.fetch_users(domain,size=nil)
begin
url = Net::HTTP.get URI.parse("http://www.bugmenot.com/view/#{domain}")
key = ( url.scan(/var key =(.*);/)[0][0].to_i + 112 ) / 12
ulist = url.scan(/tr><th>Username <\/th><td><script>d\('(.*)'\);<\/script><\/td><\/tr>
[\n\s]+<tr><th>Password <\/th><td><script>d\('(.*)'\);<\/script><\/td><\/tr>\
[\n\s]+<tr><th>Other<\/th><td><script>d\('(.*)'\);<\/script><\/td><\/tr>\
[\n\s]+<tr><th>Stats<\/th><td class="stats"><em class="(.*)">(.*)% success rate<\/em>/)
ulist[0..(size.to_i-1 || -1)].each do |user,pass,other,status,percent|
puts "#{percent.to_i < 51 ? "\033[31m" : "\033[32m"} U: #{decode(user,key)} | " +
"P: #{decode(pass,key)} | " +
"O: #{decode(other,key)} | " +
"S: #{status} [#{percent}%]" + "\033\[0m"
puts "-----------------------------------------"
end
rescue
return "Something went wrong"
end
return ulist
end
end
#test > ruby bugmenot.rb domain.com 5
puts "LIST OF USER/PASS/OTHER/% for domain #{ARGV[0]}"
puts "-----------------------------------------"
BMN.fetch_users ARGV[0], ARGV[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment