Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import urllib
- import urllib2
- import httplib
- import re
- import random
- import lxml.html
- import cookielib
- import os
- from random import randrange
- from PIL import Image
- def recapcha():
- try:
- global traloi
- global c_src
- headers = ({"Host": "api.recaptcha.net",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Connection": "keep-alive"})
- request = urllib2.Request('http://api.recaptcha.net/noscript?k=6LfHsgMAAAAAAMVjkB1nC_nI5qfAjVk0qxz4VtPV', None,headers)
- connect = urllib2.urlopen(request)
- r_data = connect.read()
- print "[*] Lay Link ReCapCha"
- tree = lxml.html.fromstring(r_data)
- src = tree.xpath(".//img[@alt='']")[0].get('src')
- c_src = src.replace("image?c=", "")
- img_src = "http://www.google.com/recaptcha/api/" + src
- print "[*] Link ReCapCha La: %s" % img_src
- request_1 = urllib2.Request(img_src, None, headers)
- f1 = urllib2.urlopen(request_1)
- img_wb = f1.read()
- open('temp.jpg', 'wb').write(img_wb)
- showimg = Image.open('temp.jpg')
- showimg.show()
- traloi = raw_input("[*] Nhap Capcha:\n")
- except urllib2.HTTPError, e:
- print e.code
- main()
- except urllib2.URLError, e:
- print e.args
- main()
- except(KeyboardInterrupt):
- print "[*] Tai Lai ReCapCha"
- main()
- def d_recapcha():
- try:
- global key
- params = urllib.urlencode({'recaptcha_challenge_field':'%s'%c_src,
- 'recaptcha_response_field': '%s'%traloi,
- 'submit':'T%EF%BF%BDi+l%EF%BF%BD+ng%3F%3Fi'})
- lenth = len(params)
- headers = ({"Host": "api.recaptcha.net",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Referer": "http://api.recaptcha.net/noscript?k=6LfHsgMAAAAAAMVjkB1nC_nI5qfAjVk0qxz4VtPV",
- "Connection": "keep-alive",
- "Content-Type": "application/x-www-form-urlencoded",
- "Content-Length": "%s"%lenth})
- print "[*] Get Key"
- request = urllib2.Request('http://api.recaptcha.net/noscript?k=6LfHsgMAAAAAAMVjkB1nC_nI5qfAjVk0qxz4VtPV', params, headers)
- connect = urllib2.urlopen(request)
- r_data = connect.read()
- r_key = re.search('cols="100">(.*)</textarea>',r_data)
- if r_key:
- key = r_key.group(1)
- print "Key is : %s " % key
- else:
- print "[-] Nhap sai capcha roi"
- print "[*] Reload"
- main()
- except urllib2.HTTPError, e:
- print e.code
- main()
- except urllib2.URLError, e:
- print e.args
- main()
- except(KeyboardInterrupt):
- print "[*] Reload ReCapCha"
- main()
- def Hash():
- try:
- global hash
- params = urllib.urlencode({'s':'',
- 'securitytoken': 'guest',
- 'do': 'register',
- 'url':'http://vnhfamily.us/forum/',
- 'month':'',
- 'day':'',
- 'year':'',
- 'who':'adult',
- 'agree':'1'})
- lenth = len(params)
- headers = ({"Host": "vnhfamily.us",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0",
- "Referer": "http://vnhfamily.us/forum/register.php?do=signup",
- "Cookie": "PHPSESSID=%s"%sid,
- "Authorization": "Basic Vk5IOlZOSA==",
- "Connection": "keep-alive",
- "Content-type": "application/x-www-form-urlencoded",
- "Content-Length": "%s"%lenth})
- print "[*] Lay Ma Hash"
- request = urllib2.Request('http://vnhfamily.us/forum/register.php?do=register', params,headers)
- connect = urllib2.urlopen(request)
- r_data = connect.read()
- tree = lxml.html.fromstring(r_data)
- hash = tree.xpath(".//input[@id='hash']")[0].get('value')
- print "[*] Hash La: %s" % (hash)
- except urllib2.HTTPError, e:
- print e.code
- main()
- except urllib2.URLError, e:
- print e.args
- main()
- except(KeyboardInterrupt):
- main()
- def reg():
- global user
- kytu1 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- kytu2 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- kytu3 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- kytu4 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- kytu5 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- kytu6 = random.choice('qwertyuiopasdfghjklzxcvbnm')
- t_user = '%s%s%s%s%s%s'%(kytu1,kytu2,kytu3,kytu4,kytu5,kytu6)
- i = randrange(9999)
- user = '%s%s' % (t_user,i)
- email = '%s%s@gmail.com' % (t_user,i)
- c_email = '%s%s@gmail.com' % (t_user,i)
- print "UserName: %s" % user
- print "Email: %s" % email
- try:
- params = urllib.urlencode({'s':'',
- 'securitytoken': 'guest',
- 'do': 'addmember',
- 'url':'http://vnhfamily.us/forum/index.php',
- 'agree':'1',
- 'password_md5':'',
- 'passwordconfirm_md5':'',
- 'day':'0',
- 'month':'0',
- 'year':'0',
- 'username':'%s'%(user),
- 'password':'manhmanh',
- 'passwordconfirm':'manhmanh',
- 'email':'%s'%(email),
- 'emailconfirm':'%s'%(c_email),
- 'humanverify[hash]':'%s'%(hash),
- 'recaptcha_challenge_field':'%s'%(key),
- 'recaptcha_response_field':'manual_challenge',
- 'referrername':'',
- 'timezoneoffset':'7',
- 'dst':'2',
- 'options[adminemail]':'1'})
- lenth = len(params)
- headers = ({
- "Host": "vnhfamily.us",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0",
- "Referer": "http://vnhfamily.us/forum/register.php?do=register",
- "Cookie": "PHPSESSID=%s"%sid,
- "Authorization": "Basic Vk5IOlZOSA==",
- "Connection": "keep-alive",
- "Content-type": "application/x-www-form-urlencoded",
- "Content-Length": "%s"%lenth})
- print "Dang Ky User %s" % user
- print "Please Wait ..."
- request = urllib2.Request('http://vnhfamily.us/forum/register.php?do=add', params,headers)
- connect = urllib2.urlopen(request)
- r_data = connect.read()
- print "Dang Ky Thanh Cong User: %s" % user
- print "================================================================================"
- except urllib2.HTTPError, e:
- print e.code
- main()
- except urllib2.URLError, e:
- print e.args
- main()
- except(KeyboardInterrupt):
- main()
- def ReceivedCookie():
- print "Dang Nhap http://vnhfamily.us/forum"
- COOKIEFILE = 'temp'
- urlopen = urllib2.urlopen
- cj = cookielib.LWPCookieJar()
- Request = urllib2.Request
- opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
- urllib2.install_opener(opener)
- if cj != None:
- if os.path.isfile(COOKIEFILE):
- cj.load(COOKIEFILE)
- params = urllib.urlencode({'do':'login',
- 'url': '/forum/index.php',
- 'vb_login_md5password': '1f5d020ac0ce982f5846897871b6b5ec',
- 'vb_login_md5password_utf':'1f5d020ac0ce982f5846897871b6b5ec',
- 's':'',
- 'securitytoken':'guest',
- 'vb_login_username':'%s'%(user),
- 'vvb_login_password':'',
- 'cookieuser':'1'})
- length = len(params)
- print "Length is %s" % length
- headers = ({"Host": "vnhfamily.us",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Referer": "http://vnhfamily.us/forum/index.php",
- "Cookie": "PHPSESSID=%s"%(sid),
- "Connection": "keep-alive",
- "Authorization": "Basic Vk5IOlZOSA==",
- "Connection": "keep-alive",
- "Content-type": "application/x-www-form-urlencoded",
- "Content-Length": "%s"%length})
- theurl = 'http://vnhfamily.us/forum/login.php?do=login'
- try:
- req = Request(theurl, params, headers)
- handle = urlopen(req)
- the_page = handle.read()
- except IOError, e:
- print 'We failed to open "%s".' % theurl
- if hasattr(e, 'code'):
- print 'We failed with error code - %s.' % e.code
- if cj == None:
- print "We don't have a cookie library available - sorry."
- print "I can't show you any cookies."
- else:
- print '[*] Cookies we have Received:'
- for index, cookie in enumerate(cj):
- print "%s:%s" % (cookie.name,cookie.value)
- cj.save(COOKIEFILE)
- def Login():
- data = open('temp','r').read()
- userid = re.search('bbuserid=(.*); path=',data)
- password = re.search('bbpassword=(.*); path=',data)
- print "[*] Login with ID = %s and Password_Hash = %s" % (userid.group(1),password.group(1))
- headers = ({"Host": "vnhfamily.us",
- "User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Referer": "http://vnhfamily.us/forum/login.php?do=login",
- "Cookie": "PHPSESSID=%s; bbuserid=%s; bbpassword=%s"%(sid,userid.group(1),password.group(1)),
- "Authorization": "Basic Vk5IOlZOSA==",
- "Connection": "keep-alive"})
- theurl = 'http://vnhfamily.us/forum/index.php'
- topurl = 'http://vnhfamily.us/forum/ajax.php?do=allforum&result=20'
- try:
- req = urllib2.Request(theurl, None, headers)
- top = urllib2.Request(topurl, None, headers)
- response = urllib2.urlopen(req)
- response1 = urllib2.urlopen(top)
- the_page = response.read()
- the_page1 = response1.read()
- except IOError, e:
- print 'We failed to open "%s".' % theurl
- print "================================================================================"
- def main():
- recapcha()
- d_recapcha()
- Hash()
- reg()
- ReceivedCookie()
- Login()
- if __name__ == "__main__":
- sid = raw_input("[*] Nhap PHPSESSID:\n")
- while True:
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement