Last active
November 21, 2022 12:53
-
-
Save FalloutR/3bf9c9a4843ebea344243137fc27196b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import csv | |
import json | |
import string | |
import math | |
import requests | |
import threading | |
import random | |
import deathbycaptcha | |
word_array = ["","Karil","Kiler","K1ler","Kil3r","K1ll3r","Noob2","N3wb","Favor","Hand","Slack","Fad","Bruh","D34D","Paige","Larry","Th3","M4ny","P1ll","Junki3","L4b0r","P4rty","W1ldy","Fallen","xx","6969","Fun","B33F","DEADBEEF","Dad","Lob","Deb","Koh","Gary","Garry","G4ry","Jerry","J3rry","E4rth","Bearer","Guthan","Glien","Gnome","Sara","Domin","Guthix","Varack","Ride","Raider","Fallout","Flying","Machine","Dob","Rob","Bot","Life","L1f3","Otter","W4ter","Fire","Read","Gi4nt","Hilt","Conqr","Speer","Edge","Slay","Guide","lyf3","lyf3","4lyfe","Seal"] | |
#Posts captchas to DeathByCaptcha and information to Runescape | |
class Poster: | |
def __init__(self,dbc_user,dbc_passw,datah): | |
self.client = deathbycaptcha.HttpClient(dbc_user,dbc_passw) | |
self.datah = datah | |
def postRunescape(self,account_number,infoGen): | |
email = infoGen.getEmail(account_number) | |
passw = infoGen.getPassword(6) | |
name = infoGen.getName() | |
while self.checkName(name) == False: | |
name = infoGen.getName() | |
day = random.randint(1,28) | |
month = random.randint(1,12) | |
year = random.randint(1987,2000) | |
captcha = self.solveCaptcha() | |
print("Account Info Generated:") | |
print(" %s" % (email)) | |
print(" %s" % (passw)) | |
print(" %s" % (name)) | |
print(" %s" % (captcha)) | |
print("POSTING") | |
r = requests.post("https://secure.runescape.com/m=account-creation/create_account",data={ | |
'day':day, | |
'displayname':name, | |
'email1':email, | |
'g-recaptcha-response':captcha["text"], | |
'month':month, | |
'onlyOneEmail':1, | |
'onlyOnePassword':1, | |
'password1':passw, | |
'submit':'Play+Now', | |
'theme':['oldschool','oldschool'], | |
'year':year | |
}) | |
print("POST reponse: %s" % (r)) | |
if r.ok: | |
print("Checking Created...") | |
if self.checkName(name) == False: | |
print("Successfully Created! Saving") | |
acc = [name,email,passw] | |
self.datah.writeAccount(acc) | |
else: | |
print ("Error creating account: %s"%(email)) | |
print("Reporting captcha, exiting thread...") | |
self.client.report(captcha["captcha"]) | |
sys.exit() | |
else: | |
print ("Error creating account: %s"%(email)) | |
print("Reporting captcha, exiting thread...") | |
self.client.report(captcha["captcha"]) | |
sys.exit() | |
def checkName(self,name): | |
print("Checking name: %s" % (name)) | |
r = requests.post("https://secure.runescape.com/m=account-creation/check_displayname.ajax",headers={'Referer':'https://secure.runescape.com/m=account-creation/create_account?theme=oldschool'},data={'displayname':name}) | |
output = str(r.content) | |
if "true" in output: | |
print("Output from displayname check: True") | |
return True | |
else: | |
print("Output from displayname check: False") | |
return False | |
def solveCaptcha(self): | |
captcha_in = { | |
'googlekey': '6LccFA0TAAAAAHEwUJx_c1TfTBWMTAOIphwTtd1b', | |
'pageurl': 'https://secure.runescape.com/m=account-creation/create_account?theme=oldschool' | |
} | |
captcha_json = json.dumps(captcha_in) | |
try: | |
solved_captcha = self.client.decode(type=4,token_params=captcha_json) | |
if solved_captcha: | |
#print ("CAPTCHA %s solved: %s" % (solved_captcha["captcha"], solved_captcha["text"])) | |
if solved_captcha["text"] == '': | |
self.client.report(solved_captcha["captcha"]) | |
print ("'' captcha, exitting") | |
sys.exit() | |
return | |
if solved_captcha["text"] == '?': | |
self.client.report(solved_captcha["captcha"]) | |
print ("? captcha, exitting") | |
sys.exit() | |
return | |
if solved_captcha["text"] == None: | |
self.client.report(solved_captcha["captcha"]) | |
print ("None captcha, exitting") | |
sys.exit() | |
return | |
return (solved_captcha) | |
else: | |
print ("error with captcha, exitting") | |
sys.exit() | |
return | |
except deathbycaptcha.AccessDeniedException: | |
print ("error: Access to DBC API denied, check your credentials and/or balance") | |
sys.exit() | |
return | |
#Generates calculated emails, pseudorandom names, and random passwords | |
class InfoGenerator: | |
def __init__(self,word_array,email_pre,email_suf): | |
self.word_array = word_array | |
self.email_pre = email_pre | |
self.email_suf = email_suf | |
#Generates a single email | |
#{email_pre}{number}@{email_suf} | |
def getEmail(self,number): | |
email = self.email_pre+str(number)+"@"+email_suf | |
return email | |
#Generate an arbitary amount of emails | |
#{email_pre}{starting_number+i(amount_to_create)}@{email_suf} | |
def getEmails(self,starting_number,amount_to_create): | |
emails = [] | |
for n in range(amount_to_create): | |
emails.append(self.getEmail(starting_number+n)) | |
return emails | |
#Generates a single password of an arbitrary length | |
def getPassword(self,length): | |
paas = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase + string.digits, k=length)) | |
return paas | |
#Generates an arbitary amount passwords of an arbitrary length | |
def getPasswords(self,length,amount_to_create): | |
paass = [] | |
for n in range(amount_to_create): | |
paass.append(''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase + string.digits, k=length))) | |
return paass | |
#Generates a single name | |
def getName(self): | |
first_word = self.getFirstWord() | |
name = self.finishName(first_word) | |
return name | |
#Generate an arbitary amount of names | |
def getNames(self,amount_to_create): | |
names = [] | |
for n in range(amount_to_create): | |
first_word = self.getFirstWord() | |
names.append(self.finishName(first_word)) | |
return names | |
#Picks a random word from the word_array and adds numbers before and/or after | |
def getFirstWord(self): | |
self.sortWords() | |
rand = random.randint(0,len(self.lt_array)-1) | |
rand_lt = self.lt_array[rand] | |
rand_word = rand_lt[random.randint(0,len(rand_lt)-1)] | |
num_chance = random.randint(1,4) | |
#Random Chance to add Numbers before and/or after the first word | |
#Can be modified for different "more realistic" name scheme | |
if num_chance == 4: | |
first_word = str(random.randint(0,99))+rand_word | |
elif num_chance == 3: | |
first_word = rand_word+str(random.randint(0,99)) | |
elif num_chance == 2: | |
first_word = str(random.randint(0,99))+rand_word+str(random.randint(0,99)) | |
elif num_chance == 1: | |
first_word = rand_word | |
return first_word | |
#Gets a second word from the word_array and adds numbers to the rest of the name if applicable | |
def finishName(self,first_word): | |
able_lt = self.calculateSpacesLeft(first_word) | |
sec_word = able_lt[random.randint(0,len(able_lt)-1)] | |
proto_name = first_word+sec_word | |
name_len = len(proto_name) | |
if name_len<12: | |
name=proto_name+str(random.randint(1,10**((12-name_len)-1))) | |
else: | |
name=proto_name | |
return name | |
#Calculates the spaces left in the name given the first word | |
#returns a word array of words that can still fit | |
def calculateSpacesLeft(self,first_word): | |
able_calc = 12-len(first_word) | |
if able_calc >= 10: | |
able_lt = self.lt10 | |
elif able_calc == 9: | |
able_lt = self.lt9 | |
elif able_calc == 8: | |
able_lt = self.lt8 | |
elif able_calc == 7: | |
able_lt = self.lt7 | |
elif able_calc == 6: | |
able_lt = self.lt6 | |
elif able_calc == 5: | |
able_lt = self.lt5 | |
elif able_calc == 4: | |
able_lt = self.lt4 | |
elif able_calc == 3: | |
able_lt = self.lt3 | |
elif able_calc == 2: | |
able_lt = self.lt2 | |
elif able_calc == 1: | |
able_lt = self.lt1 | |
return able_lt | |
def sortWords(self): | |
self.lt10 = [] | |
self.lt9 = [] | |
self.lt8 = [] | |
self.lt7 = [] | |
self.lt6 = [] | |
self.lt5 = [] | |
self.lt4 = [] | |
self.lt3 = [] | |
self.lt2 = [] | |
self.lt1 = [] | |
for ea in self.word_array: | |
if len(ea) > 10: | |
print ("Discarded word: %s"%(ea)) | |
if len(ea) <= 10: | |
self.lt10.append(ea) | |
if len(ea) <= 9: | |
self.lt9.append(ea) | |
if len(ea) <= 8: | |
self.lt8.append(ea) | |
if len(ea) <= 7: | |
self.lt7.append(ea) | |
if len(ea) <= 6: | |
self.lt6.append(ea) | |
if len(ea) <= 5: | |
self.lt5.append(ea) | |
if len(ea) <= 4: | |
self.lt4.append(ea) | |
if len(ea) <= 3: | |
self.lt3.append(ea) | |
if len(ea) <= 2: | |
self.lt2.append(ea) | |
if len(ea) <= 1: | |
self.lt1.append(ea) | |
self.lt_array = [self.lt10,self.lt9,self.lt8,self.lt7,self.lt6,self.lt5,self.lt4,self.lt3,self.lt2,self.lt1] | |
class DataHandler: | |
def __init__(self,dbc=None): | |
if dbc == None: | |
self.dbc = "accounts.csv" | |
else: | |
self.dbc = dbc; | |
def writeAccount(self,data): | |
if self.dbc == "accounts.csv": | |
with open(self.dbc,"a") as accFile: | |
writer = csv.writer(accFile) | |
writer.writerow(data) | |
else: | |
print("shitfuck not implemented yet") | |
#Our abstract code | |
if len(sys.argv) == 8 or len(sys.argv) == 9: | |
dbc_user = str(sys.argv[1]) | |
dbc_passw = str(sys.argv[2]) | |
email_pre = str(sys.argv[3]) | |
email_suf = str(sys.argv[4]) | |
amount_to_create = int(sys.argv[5]) | |
starting_number = int(sys.argv[6]) | |
group_count = int(sys.argv[7]) | |
if len(sys.argv) == 9: | |
dbconn = int(sys.argv[8]) | |
else: | |
dbconn = None | |
print ("Creating %d accounts, assigned to email %s@%s starting at %d" % (amount_to_create, email_pre, email_suf, starting_number)) | |
print ("Using %d threads at a time" % (group_count)) | |
#print("Creating one account cuz test") | |
infoGen = InfoGenerator(word_array,email_pre,email_suf) | |
datah = DataHandler(dbconn) | |
poster = Poster(dbc_user,dbc_passw,datah) | |
groups = int(math.ceil(amount_to_create/group_count)) | |
created = amount_to_create | |
for ea in range(groups): | |
if (created-group_count)<0: | |
create = (created-group_count)+group_count | |
else: | |
create = group_count | |
thr = [None]*create | |
for i in range(create): | |
thr[i] = threading.Thread(target=poster.postRunescape, args=(int(((ea*create)+i)+starting_number),infoGen), kwargs={}) | |
thr[i].start() | |
created-=1 | |
thr[-1].join() | |
else: | |
print ("Missing arguments, exitting") | |
print ("Usage:") | |
print (" python asyncCreator.py deathbycaptcha_username deathbycaptcha_password email_prefix email_suffix amount_to_create starting_number thread_count") | |
print ("For information about each param see the forum thread:") | |
print (" https://dreambot.org/forums/index.php?/topic/16139-python-account-generator/") | |
sys.exit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment