| 1 | #/usr/local/bin/ruby |
|---|
| 2 | |
|---|
| 3 | require 'cgi' |
|---|
| 4 | require 'net/http' |
|---|
| 5 | |
|---|
| 6 | proxy_port = 0 |
|---|
| 7 | proxy = 'proxy:port' |
|---|
| 8 | proxy, proxy_port = proxy.split /:/ |
|---|
| 9 | |
|---|
| 10 | code = %w( |
|---|
| 11 | 5d5e4c7ea73dee3414cf2c7b64623f07 |
|---|
| 12 | 0a5b5e8f81f9bc1ad36951d164bbdcc7 |
|---|
| 13 | 3f5153ad7a39ce5c638d2d4d76a4f7d2 |
|---|
| 14 | 02105b0bf998dda0521651fc5358ebb4 |
|---|
| 15 | 04e0c0cf3c07da9acf71bc55ea4abd0c |
|---|
| 16 | 553f5f17d919d5fe39dbf2ecec527a5f |
|---|
| 17 | 6536c447424ca0816105a14488a30e75 |
|---|
| 18 | 93e552ee61a82f00461b4fd9d3975514 |
|---|
| 19 | cb2469fe19cff2b6fb1181751592528f |
|---|
| 20 | 3f4078f6ebf0d261f428c2dab07ef7ed |
|---|
| 21 | ) |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | def make_int min, max |
|---|
| 25 | (rand * (max - min)).round + min |
|---|
| 26 | end |
|---|
| 27 | |
|---|
| 28 | def make_str min, max |
|---|
| 29 | buf = '' |
|---|
| 30 | make_int(min, max).times do |
|---|
| 31 | buf << make_int(?a, ?z).chr |
|---|
| 32 | end |
|---|
| 33 | buf |
|---|
| 34 | end |
|---|
| 35 | |
|---|
| 36 | txt = String.new |
|---|
| 37 | regid = String.new |
|---|
| 38 | z = Array.new |
|---|
| 39 | m = 0 |
|---|
| 40 | rcode = String.new |
|---|
| 41 | |
|---|
| 42 | session = Net::HTTP::Proxy(proxy, |
|---|
| 43 | proxy_port).new('forums.megatokyo.com', 80) |
|---|
| 44 | |
|---|
| 45 | head, txt = (session.get '/index.php?act=Reg&CODE=00') |
|---|
| 46 | |
|---|
| 47 | txt.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/ |
|---|
| 52 | end |
|---|
| 53 | |
|---|
| 54 | puts "> fetching image files" |
|---|
| 55 | z.each do |l| |
|---|
| 56 | l.gsub!('&', '&').chomp! |
|---|
| 57 | `wget -q -nc "#{l}" -O "tmp/#{m}.tmp"` |
|---|
| 58 | m += 1 |
|---|
| 59 | end |
|---|
| 60 | |
|---|
| 61 | puts "> running md5..." |
|---|
| 62 | 6.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 |
|---|
| 71 | end |
|---|
| 72 | |
|---|
| 73 | usrname = (make_str 4, 10) |
|---|
| 74 | usr = (make_str 3, 12) |
|---|
| 75 | email = usr + '@mailinator.com' |
|---|
| 76 | |
|---|
| 77 | post = |
|---|
| 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 | '®id=' + regid + |
|---|
| 87 | '®_code=' + rcode + |
|---|
| 88 | '&agree=1' |
|---|
| 89 | |
|---|
| 90 | puts "> sending..." |
|---|
| 91 | head, body = session.post('/index.php', post) |
|---|
| 92 | |
|---|
| 93 | if body.match /your registration has been submitted/i |
|---|
| 94 | puts "> registration accepted" |
|---|
| 95 | end |
|---|
| 96 | |
|---|
| 97 | sleep 60 |
|---|
| 98 | |
|---|
| 99 | get = '/mailinator/ShowMail.do?email=' + usr + '&msgnum=0' |
|---|
| 100 | |
|---|
| 101 | session = Net::HTTP::Proxy(proxy, |
|---|
| 102 | proxy_port).new('mailinator.com', 80) |
|---|
| 103 | head, body = session.get(get) |
|---|
| 104 | |
|---|
| 105 | if body.match /mailinator.s anti-abuse code.*what mailbox you/i |
|---|
| 106 | puts '> banned from mailinator' |
|---|
| 107 | exit |
|---|
| 108 | end |
|---|
| 109 | |
|---|
| 110 | body.match /..href.(.*act.Reg.*CODE....uid.*)>http/ |
|---|
| 111 | $1.match /.*(\/index.php.*)$/ |
|---|
| 112 | rel = $1 |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | session = Net::HTTP::Proxy(proxy, |
|---|
| 116 | proxy_port).new('forums.megatokyo.com', 80) |
|---|
| 117 | |
|---|
| 118 | puts "> validating..." |
|---|
| 119 | head, body = session.get(rel) |
|---|
| 120 | |
|---|
| 121 | puts "> account: #{usrname}:password_here\n\n" |
|---|
| 122 | `echo #{usrname}:password_here >> mtusrs.txt` |
|---|