import requests
import string
import random
import urllib
import StringIO
import gzip
import json
import time
import hashlib
import threading
threads = 5
sleep = 5
def random_machine_id():
return ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(24))
class register(object):
def __init__(self):
names = ["Ahmed", "Mohamed", "Mahmoud", "Salah", "Sayed", "Ezzat", "Khaled", "John", "Abdo", "Adel", "Nabil", "Fathy", "Omar", "Reda", "Alaa"]
r = requests.get("https://mailto.space/get/inbox/229397671eaf6fa84c44ea27c68bd22a561dbc20/new").json()
self.email = "%s@%s"%(r[0], r[1])
self.password = random.randint(100000000000,999999999999)
self.fName = random.choice(names)
self.lName = random.choice(names)
self.birthday = "19%s-%s-%s"%(random.randint(50,99), random.randint(1,12), random.randint(1,28))
self.access_token = ""
def Register(self):
data = sorted([
('email',self.email),
('firstname',self.fName),
('lastname',self.lName),
('gender','M'),
('password',self.password),
('birthday',self.birthday),
('return_multiple_errors','true'),
('attempt_login','true'),
('reg_instance','84e02e60-3883-4282-8b2f-f6e22b5734b1'),
('device_id','84e02e60-3883-4282-8b2f-f6e22b5734b1'),
('family_device_id','cfa53049-7230-41ee-a275-ad24061010e7'),
('format','json'),
('skip_session_info','true'),
('advertising_id','09a81cbe-9b67-4411-953c-564dd55115dc'),
('meta_inf_fbmeta','NO_FILE'),
('locale','en_US'),
('client_country_code','US'),
('method','user.register'),
('fb_api_req_friendly_name','registerAccount'),
('fb_api_caller_class','com.facebook.registration.fragment.RegistrationCreateAccountFragment'),
('api_key','882a8490361da98702bf97a021ddc14d')
])
sig = ""
for x in data:
sig += str(x[0]) + "=" + str(x[1])
sig += "62f8ce9f74b12f84c123cc23437a4a32"
m = hashlib.md5()
m.update(sig)
data.append(("sig", m.hexdigest()))
headers = {
'X-Fb-Connection-Type' : 'mobile.LTE',
'X-Fb-Net-Hni' : '310260',
'X-Fb-Sim-Hni' : '310260',
'X-Fb-Net-Sid' : '',
'X-Fb-Http-Engine' : 'Apache',
'Content-Type' : 'application/x-www-form-urlencoded',
'Content-Encoding' : 'gzip',
'User-Agent' : '[FBAN/FB4A;FBAV/37.0.0.0.109;FBBV/11557663;FBDM/{density=1.5,width=480,height=854};FBLC/en_US;FBCR/Android;FBMF/unknown;FBBD/generic;FBPN/com.facebook.katana;FBDV/google_sdk;FBSV/4.4.2;FBOP/1;FBCA/armeabi-v7a:armeabi;]'
}
out = StringIO.StringIO()
with gzip.GzipFile(fileobj=out, mode="w") as f:
f.write(urllib.urlencode(data))
r = requests.post("https://b-api.facebook.com/method/user.register", headers=headers, data=out.getvalue())
#print r.text
def Login(self):
data = {
'batch': '[{"method":"POST","body":"format=json&device_id=0cd272a7-17dc-4766-958e-5b48799250bf&email='+self.email+'&password='+str(self.password)+'&credentials_type=password&generate_session_cookies=1&error_detail_type=button_with_disabled&machine_id='+random_machine_id()+'&locale=en_US&client_country_code=US&fb_api_req_friendly_name=authenticate","name":"authenticate","omit_response_on_success":false,"relative_url":"method/auth.login"},{"method":"POST","body":"query_id=10153437257771729&method=get&strip_nulls=true&query_params=%7B%220%22%3A75%2C%221%22%3A120%2C%222%22%3A480%7D&locale=en_US&client_country_code=US&fb_api_req_friendly_name=GetLoggedInUserQuery","name":"getLoggedInUser","depends_on":"authenticate","omit_response_on_success":false,"relative_url":"graphql?access_token={result=authenticate:$.access_token}"}]',
'fb_api_caller_class': 'com.facebook.katana.server.handler.Fb4aAuthHandler',
'fb_api_req_friendly_name': 'authLogin'
}
headers = {
'Authorization' : 'OAuth 350685531728|62f8ce9f74b12f84c123cc23437a4a32',
'X-Fb-Connection-Type' : 'mobile.LTE',
'X-Fb-Net-Hni' : '310260',
'X-Fb-Sim-Hni' : '310260',
'X-Fb-Net-Sid' : '',
'X-Fb-Http-Engine' : 'Apache',
'Content-Type' : 'application/x-www-form-urlencoded',
'Content-Encoding' : 'gzip',
'User-Agent' : '[FBAN/FB4A;FBAV/37.0.0.0.109;FBBV/11557663;FBDM/{density=1.5,width=480,height=854};FBLC/en_US;FBCR/Android;FBMF/unknown;FBBD/generic;FBPN/com.facebook.katana;FBDV/google_sdk;FBSV/4.4.2;FBOP/1;FBCA/armeabi-v7a:armeabi;]'
}
out = StringIO.StringIO()
with gzip.GzipFile(fileobj=out, mode="w") as f:
f.write(urllib.urlencode(data))
try:
r = requests.post("https://b-graph.facebook.com/?include_headers=false&locale=en_US&client_country_code=US", headers=headers, data=out.getvalue())
pass
if 'access_token' in json.loads(r.json()[0]['body']):
self.access_token = json.loads(r.json()[0]['body'])['access_token']
print "[!] Access Token : " + self.access_token
def Confirm(self):
inbox = requests.get("https://mailto.space/get/mails/"+self.email.split("@")[0])
status = True
while status:
if len(inbox.json()[1]) >= 1:
status = False
#print "yes, i have it now!"
ff = 1
url = requests.get("https://mailto.space/get/content/"+inbox.json()[1].keys()[0]+"/text").text
while(ff):
try:
#print "CODE: " + url.split("c=")[1].split("&")[0]
ff = 0
url = requests.get("https://mailto.space/get/content/"+inbox.json()[1].keys()[1]+"/text").text
ff = 1
data = {
'normalized_contactpoint': self.email,
'contactpoint_type': 'EMAIL',
'code': url.split("c=")[1].split("&")[0],
'source': 'ANDROID_DIALOG_API',
'surface': 'hard_cliff',
'format': 'json',
'locale': 'en_US',
'client_country_code': 'US',
'method': 'user.confirmcontactpoint',
'fb_api_req_friendly_name': 'confirmContactpoint',
'fb_api_caller_class': 'com.facebook.confirmation.fragment.ConfCodeInputFragment',
}
headers = {
'Authorization' : 'OAuth ' + self.access_token,
'X-Fb-Connection-Type' : 'mobile.LTE',
'X-Fb-Net-Hni' : '310260',
'X-Fb-Sim-Hni' : '310260',
'X-Fb-Net-Sid' : '',
'X-Fb-Http-Engine' : 'Apache',
'Content-Type' : 'application/x-www-form-urlencoded',
'Content-Encoding' : 'gzip',
'User-Agent' : '[FBAN/FB4A;FBAV/37.0.0.0.109;FBBV/11557663;FBDM/{density=1.5,width=480,height=854};FBLC/en_US;FBCR/Android;FBMF/unknown;FBBD/generic;FBPN/com.facebook.katana;FBDV/google_sdk;FBSV/4.4.2;FBOP/1;FBCA/armeabi-v7a:armeabi;]'
}
out = StringIO.StringIO()
with gzip.GzipFile(fileobj=out, mode="w") as f:
f.write(urllib.urlencode(data))
r = requests.post("https://api.facebook.com/method/user.confirmcontactpoint", headers=headers, data=out.getvalue())
#print r.text
if r.text == "true":
print "[info] Email : {1} -> Passoword : {0}".format(self.email , self.password)
break
inbox = requests.get("https://mailto.space/get/mails/"+self.email.split("@")[0])
#print "Wait!"
def worker():
f = register()
f.Register()
f.Login()
f.Confirm()
return
while(1):
threads_ = []
print "[!] Starting {} Thread/s".format(threads)
for i in range(threads):
t
= threading.
Thread(target
=worker
) threads_.append(t)
t.start()
print "[!] Sleeping {} Second/s".format(sleep)
time.sleep(sleep)