source: trollforge/dsp-trollforge/MegaTokyo/Mtreg.rb @ 233

Revision 41, 2.5 KB checked in by sam, 8 years ago (diff)
  • DSP's trollforge snapshot.
Line 
1#/usr/local/bin/ruby
2
3require 'cgi'
4require 'net/http'
5
6proxy_port = 0
7proxy = 'proxy:port'
8proxy, proxy_port = proxy.split /:/
9
10code = %w(
115d5e4c7ea73dee3414cf2c7b64623f07
120a5b5e8f81f9bc1ad36951d164bbdcc7
133f5153ad7a39ce5c638d2d4d76a4f7d2
1402105b0bf998dda0521651fc5358ebb4
1504e0c0cf3c07da9acf71bc55ea4abd0c
16553f5f17d919d5fe39dbf2ecec527a5f
176536c447424ca0816105a14488a30e75
1893e552ee61a82f00461b4fd9d3975514
19cb2469fe19cff2b6fb1181751592528f
203f4078f6ebf0d261f428c2dab07ef7ed
21)
22
23
24def make_int min, max
25        (rand * (max - min)).round + min
26end
27
28def make_str min, max
29        buf = ''
30        make_int(min, max).times do
31                buf << make_int(?a, ?z).chr
32        end
33        buf
34end
35
36txt = String.new
37regid = String.new
38z = Array.new
39m = 0
40rcode = String.new
41
42session = Net::HTTP::Proxy(proxy, 
43proxy_port).new('forums.megatokyo.com', 80)   
44
45head, txt = (session.get '/index.php?act=Reg&CODE=00')
46
47txt.each do |x|
48        x.match /.*regid.*value='(.*)' \/>/
49        regid = $1 if $1
50        x.match /<img src='(.*=\d)'/
51        y = $1; z.push y if y and x.match /Code/
52end
53
54puts "> fetching image files"
55z.each do |l| 
56        l.gsub!('&amp;', '&').chomp!
57        `wget -q -nc "#{l}" -O "tmp/#{m}.tmp"`
58        m += 1
59end
60
61puts "> running md5..."
626.times do |i|
63        # OR if you have md5sum use:
64        # `md5sum tmp/#{i}.tmp`.match /(.*)\s\s.*/
65        `md5 tmp/#{i}.tmp`.match /^MD5.*= (.*)$/
66        10.times do |j|
67                if $1 == code[j]
68                        rcode << j.to_s
69                end
70        end
71end
72
73usrname = (make_str 4, 10)
74usr = (make_str 3, 12)
75email = usr + '@mailinator.com'
76
77post =
78'act=Reg' +
79'&CODE=02' +
80'&coppa_user=0' +
81'&UserName=' + usrname +
82'&PassWord=password_here' +
83'&PassWord_Check=password_here' +
84'&EmailAddress=' + email +
85'&EmailAddress_two=' + email +
86'&regid=' + regid + 
87'&reg_code=' + rcode + 
88'&agree=1'
89
90puts "> sending..."
91head, body = session.post('/index.php', post)
92
93if body.match /your registration has been submitted/i
94        puts "> registration accepted"
95end
96
97sleep 60
98
99get = '/mailinator/ShowMail.do?email=' + usr + '&msgnum=0'
100
101session = Net::HTTP::Proxy(proxy, 
102proxy_port).new('mailinator.com', 80)
103head, body = session.get(get)
104
105if body.match /mailinator.s anti-abuse code.*what mailbox you/i
106        puts '> banned from mailinator'
107        exit
108end
109
110body.match /..href.(.*act.Reg.*CODE....uid.*)>http/
111$1.match /.*(\/index.php.*)$/
112rel = $1
113
114
115session = Net::HTTP::Proxy(proxy, 
116proxy_port).new('forums.megatokyo.com', 80)   
117
118puts "> validating..."
119head, body = session.get(rel)
120
121puts "> account: #{usrname}:password_here\n\n"
122`echo #{usrname}:password_here >> mtusrs.txt`
Note: See TracBrowser for help on using the repository browser.