Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from multiprocessing.pool import ThreadPool
- import requests
- import random
- import string
- import time
- import configparser
- import sys
- sys.setrecursionlimit(100000);
- requests.packages.urllib3.disable_warnings();
- def sign_up(proxy):
- print('Trying to create account with proxy:', proxy)
- # creates a request session
- session = requests.session()
- # creates headers
- headers = {'User-Agent': 'Roblox/WinInet'}
- # sets sessions headers
- session.headers.update(headers)
- session.proxies.update({'http': 'http://' + proxy, 'https': 'https://' + proxy})
- # gets cookies used for signup
- try:
- r = session.get('https://www.roblox.com/', timeout=10)
- except:
- return
- # extracts data site key
- sitekey = r.text.split('data-sitekey="')[-1].split('">')[0]
- # send request to api to complete captcha
- response = complete_captcha(sitekey)
- # extracts csrf token
- csrf_token = r.text.split("Roblox.XsrfToken.setToken('")[-1].split("');")[0]
- # creates headers for post request
- headers = {'X-CSRF-TOKEN': csrf_token, 'Referer': 'https://www.roblox.com/', 'Origin': 'https://www.roblox.com'}
- # generates random username
- username = generate()
- # generates random password
- password = generate()
- # creates payload for post request
- payload = {'isEligibleForHideAdsAbTest': 'False', 'username': username, 'password': password, 'birthday': '1 Jan 1990', 'gender': '2', 'isTosAgreementBoxChecked': 'true', 'context': 'RollerCoasterSignupForm'}
- # posts data to server in order to achieve account creation
- session.post('https://api.roblox.com/signup/v1', headers=headers, data=payload)
- # sends captcha response
- session.post('https://api.roblox.com/captcha/validate/signup', headers=headers, data={'g-Recaptcha-response': response})
- # posts data to server in order to achieve account creation
- r = session.post('https://api.roblox.com/signup/v1', headers=headers, data=payload)
- # validates sign up
- if 'userId' in r.text:
- # notifies user account has been created
- print('Created account:', username)
- # method that uses the gurillamail api to verify email
- # creates a get email address payload
- payload = {"f": "get_email_address"}
- # sends payload and returns email
- r = session.get("http://api.guerrillamail.com/ajax.php", params=payload)
- # extracts email
- email = r.json()["email_addr"].split('@')[0] + '@spam4.me'
- # notifies user
- print('Got Email Address:', email)
- # goes to settings page to grab csrf-token
- r = session.get('https://www.roblox.com/my/account#!/info')
- # extracts csrf-token
- csrf_token = r.text.split("Roblox.XsrfToken.setToken('")[-1].split("');")[0]
- # creates change email headers
- verification = {'X-CSRF-TOKEN': csrf_token}
- # creates change email payload
- payload = {'emailAddress': email, 'password': password}
- # sends payload to change email
- r = session.post('https://www.roblox.com/account/changeemail', data=payload, headers=verification)
- # validates change
- if not r.json()['Success']:
- # notifies user
- print('Could not change email.')
- print('Reason:', r.json()['Message'])
- # returns to main thread
- return
- print('Successfully changed email.')
- # waits for email to arrive via the api
- print('Checking email...')
- # creates view emails payload
- payload = {"f": "check_email", "seq": "1"}
- # loops until email is found
- while True:
- # waits for 10 seconds
- time.sleep(10)
- # sends request to api
- r = session.get("http://api.guerrillamail.com/ajax.php", params=payload)
- try:
- # iterates through email list
- for email in r.json()["list"]:
- # check if the email was sent by roblox
- if email["mail_from"] == "email_validate@roblox.com":
- # extracts email id
- email_id = email["mail_id"]
- # notifies user
- print('Found email ID:', email_id)
- # creates a view email payload
- payload = {"f": "fetch_email", "email_id": email_id}
- # sneds payload to gurillamail
- r = session.get("http://api.guerrillamail.com/ajax.php", params=payload)
- # grabs verification link
- verify_link = r.json()['mail_body'].split('<a href="')[-1].split('">')[0].replace('&', '&')
- # prints verify link
- print('Got verify link:', verify_link)
- # verifies email address
- r = session.get(verify_link)
- # notifies user
- print('Successfully verified email address.')
- # writes username and password to file
- with open(output_file, 'a') as f:
- # seperates username and password with colon
- f.write('{}:{}\n'.format(username, password))
- # returns to main thread
- return
- except KeyError:
- continue
- elif 'reasons' in r.text:
- # notifies user of problem
- print('There was an error signing up on account:', username)
- print('Reason:', r.json()['reasons'][0])
- else:
- # prints response for debugging
- print('Error:', r.text)
- def complete_captcha(sitekey):
- # completes captcha and returns response
- # sends requests to api to complete capacha
- capacha_payload = {'key': api_key, 'method': 'userrecaptcha', 'googlekey': sitekey, 'pageurl': 'https://www.roblox.com/', 'json': '1'}
- request = requests.get('http://2captcha.com/in.php', params=capacha_payload)
- # gets capacha response key
- get_payload = {'key': api_key, 'action': 'get', 'id': request.json()['request'], 'json': '1'}
- # loops until a captcha response is grabbed
- while True:
- # attempts to grab captcha response
- capacha_response = requests.get('http://2captcha.com/res.php', params=get_payload, timeout=20)
- # checks if the captcha is ready
- if capacha_response.json()['request'] != 'CAPCHA_NOT_READY':
- # returns captcha response
- return capacha_response.json()['request']
- def generate():
- # generates a random string
- return ''.join(random.choice(string.ascii_letters + string.digits) for x in range(random.randint(10,20)))
- if __name__ == '__main__':
- # reads config file
- config = configparser.ConfigParser()
- config.read('config.ini')
- try:
- # sets api key
- api_key = config['account creator']['api_key']
- # sets proxy list path
- proxy_path = config['account creator']['proxy_list_path']
- # gets output file
- output_file = config['account creator']['output_file']
- # gets thread count
- thread_count = int(config['general']['thread_count'])
- except KeyError:
- sys.exit('Config file error')
- # gets proxy list
- proxies = open(proxy_path).read().split('\n')
- # multi-threaded processes
- p = ThreadPool(processes=thread_count)
- p.map(sign_up, proxies)
- p.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement