Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import base64
- import random
- import time
- from const import HOST, PASSWORD, REG_REQUEST, CAPTCHA_REQUEST, DOMAIN_REQUEST, UPDATE_REQUEST, FILENAME, ERROR_FILE, \
- WORD
- from helpers import request
- COUNT = 666
- DOMAIN_COUNT = 15
- TIMEOUT = 10 # next step is raise it up a bit until it's just fine. Thier webserver is pretty weak and it shatters connection. Anti-DDoS I guess
- PROT = 'http'
- def _get_words(filename):
- words = []
- with open(filename) as f:
- for line in f:
- words.append(line)
- f.close()
- return words
- def get_random_word(words):
- is_suited = False
- while not is_suited and not out_of_words:
- word = random.choice(words)
- if used_words[word] < 100:
- used_words[word] += 1
- return word
- out_of_words = set([used_words[x] == 100 for x in words]) in set(True)
- raise Exception('out of words')
- def registrate_user():
- email = '@'.join([
- ''.join(['herm1', str(random.randint(0, 4294967296))]),
- 'dmntest.com'])
- # r = request(protocol=PROT, host=HOST, uri=CAPTCHA_REQUEST, method='get')
- # captcha_id = r.cookies._cookies[HOST]['/']['CAPTCHA'].value[3:]
- cookies = {
- 'CookieCheck': 'Enabled=True',
- # 'CAPTCHA': 'ID={}'.format(captcha_id)
- }
- params = {
- 'userid': email,
- 'pass': PASSWORD,
- 'passconfirm': PASSWORD,
- 'fname': 'pepe',
- 'lname': 'dodo',
- 'question': 'My+first+phone+number.',
- 'answer': '123',
- # 'captcha': captcha_id,
- 'action': 'Submit',
- }
- r = request(protocol=PROT, host=HOST, uri=REG_REQUEST, method='post', data=params, cookies=cookies)
- print('[INFO] User {} is registered'.format(email))
- return email
- def registrate_domain(user, password, i):
- hostname = WORD + '{:04d}'.format(i)
- data = {'Host': hostname, 'Dom': HOST}
- cookies = dict(CookieCheck='Enabled=True', DDNS='user={user}&pass={password}'.format(
- user=user,
- password=base64.encodestring(password.encode()).decode()[0:-1],
- ))
- print('[INFO] trying to create {} for {}'.format(hostname + '.' + HOST, user))
- r = request(protocol=PROT, host=HOST, uri=DOMAIN_REQUEST, method='post', data=data, cookies=cookies)
- return hostname + '.' + HOST
- def random_name(word='kingbigtest'):
- # name = ''.join([word, str(random.randint(0, 4294967296))])
- i = 0
- while True:
- yield word + '{:04d}'.format(i)
- def update_domain(my_site_name, user, password):
- print('[INFO] trying to update {}'.format(my_site_name))
- r = request(
- protocol=PROT,
- host=HOST,
- uri=UPDATE_REQUEST.format(site_name=my_site_name),
- method='post',
- auth=(user, password),
- )
- with open(FILENAME, 'a') as file:
- file.writelines(my_site_name + '\t\t\t' + user + '\n')
- file.close()
- return True
- def logger(where, what):
- print('[ERROR] Shit! During {} got {}'.format(where, what))
- with open(ERROR_FILE, 'a') as file:
- file.writelines('During {} got {}\n'.format(where, what))
- file.close()
- def main():
- begin = time.time()
- for i in range(COUNT):
- user = registrate_user()
- for di in range(DOMAIN_COUNT):
- domain_name = registrate_domain(user, PASSWORD, DOMAIN_COUNT * i + di + 990)
- update_domain(domain_name, user, PASSWORD)
- print('[INFO] Update completed.') # restart alarm
- print('Done! For all of them\n took {} seconds'.format(time.time()-begin))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement