FreedomCoder (owner)

Revisions

gist: 186788 Download_button fork
public
Public Clone URL: git://gist.github.com/186788.git
Embed All Files: show embed
Bugmenot.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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]