diff --git a/bopscrk/modules/args.py b/bopscrk/modules/args.py index db0dd68..865aa91 100644 --- a/bopscrk/modules/args.py +++ b/bopscrk/modules/args.py @@ -30,19 +30,41 @@ def __init__(self): parser.add_argument('-w', action="store", metavar='', type=str, dest='words', help='words to combine comma-separated (will be combined with all words)') - parser.add_argument('-m', '--min', action="store", metavar='', type=int, dest='min', - default=self.DEFAULT_MIN, help='min length for the words to generate (default: {})'.format(self.DEFAULT_MIN)) + parser.add_argument( + '-m', + '--min', + action="store", + metavar='', + type=int, + dest='min', + default=self.DEFAULT_MIN, + help=f'min length for the words to generate (default: {self.DEFAULT_MIN})', + ) - parser.add_argument('-M', '--max', action="store", metavar='', type=int, dest='max', - default=self.DEFAULT_MAX, help='max length for the words to generate (default: {})'.format(self.DEFAULT_MAX)) + parser.add_argument( + '-M', + '--max', + action="store", + metavar='', + type=int, + dest='max', + default=self.DEFAULT_MAX, + help=f'max length for the words to generate (default: {self.DEFAULT_MAX})', + ) parser.add_argument('-c', '--case', action="store_true", help='enable case transformations') parser.add_argument('-l', '--leet', action="store_true", help='enable leet transformations') - parser.add_argument('-n', action="store", metavar='', type=int, dest='n_words', - default=self.DEFAULT_N_WORDS, help='max amount of words to combine each time ' - '(default: {})'.format(self.DEFAULT_N_WORDS)) + parser.add_argument( + '-n', + action="store", + metavar='', + type=int, + dest='n_words', + default=self.DEFAULT_N_WORDS, + help=f'max amount of words to combine each time (default: {self.DEFAULT_N_WORDS})', + ) parser.add_argument('-a', '--artists', action="store", metavar='', type=str, dest='artists', default=False, help='artists to search song lyrics (comma-separated)') @@ -52,13 +74,27 @@ def __init__(self): # help='exclude all the words included in other wordlists ' # '(several wordlists should be comma-separated)') - parser.add_argument('-o', '--output', action="store", metavar='', type=str, - dest='outfile', default=self.DEFAULT_OUTPUT_FILE, - help='output file to save the wordlist (default: {})'.format(self.DEFAULT_OUTPUT_FILE)) + parser.add_argument( + '-o', + '--output', + action="store", + metavar='', + type=str, + dest='outfile', + default=self.DEFAULT_OUTPUT_FILE, + help=f'output file to save the wordlist (default: {self.DEFAULT_OUTPUT_FILE})', + ) - parser.add_argument('-C', '--config', action="store", metavar='', type=str, - dest='cfg_file', default=self.DEFAULT_CFG_FILE, - help='specify config file to use (default: {})'.format(self.DEFAULT_CFG_FILE)) + parser.add_argument( + '-C', + '--config', + action="store", + metavar='', + type=str, + dest='cfg_file', + default=self.DEFAULT_CFG_FILE, + help=f'specify config file to use (default: {self.DEFAULT_CFG_FILE})', + ) parser.add_argument('--version', action="store_true", help='print version and exit') @@ -70,7 +106,9 @@ def __init__(self): def set_interactive_options(self): while True: - min_length = input(' {}[?]{} Passwords min length [{}] >>> '.format(color.BLUE, color.END, self.DEFAULT_MIN)) + min_length = input( + f' {color.BLUE}[?]{color.END} Passwords min length [{self.DEFAULT_MIN}] >>> ' + ) if is_empty(min_length): self.min_length = self.DEFAULT_MIN; break else: @@ -78,64 +116,68 @@ def set_interactive_options(self): self.min_length = int(min_length) break except ValueError: - print(' {}[!]{} Min length should be an integer'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Min length should be an integer') while True: - max_length = input(' {}[?]{} Password\'s max length [{}] >>> '.format(color.BLUE, color.END, self.DEFAULT_MAX)) + max_length = input( + f" {color.BLUE}[?]{color.END} Password\'s max length [{self.DEFAULT_MAX}] >>> " + ) if is_empty(max_length): self.max_length = self.DEFAULT_MAX; break else: try: max_length = int(max_length) if max_length < self.min_length: - print(' {}[!]{} Max should be greater or equal than min'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Max should be greater or equal than min') else: self.max_length = max_length break except ValueError: - print(' {}[!]{} Max length should be an integer'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Max length should be an integer') - firstname = input(' {}[?]{} First name >>> '.format(color.BLUE, color.END)) - surname = input(' {}[?]{} Surname >>> '.format(color.BLUE, color.END)) - lastname = input(' {}[?]{} Last name >>> '.format(color.BLUE, color.END)) + firstname = input(f' {color.BLUE}[?]{color.END} First name >>> ') + surname = input(f' {color.BLUE}[?]{color.END} Surname >>> ') + lastname = input(f' {color.BLUE}[?]{color.END} Last name >>> ') while True: - birth = input(' {}[?]{} Birth date (DD/MM/YYYY) >>> '.format(color.BLUE, color.END)) + birth = input(f' {color.BLUE}[?]{color.END} Birth date (DD/MM/YYYY) >>> ') if not is_empty(birth) and not is_valid_date(birth): - print(' {}[!]{} Birthdate wrong format'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Birthdate wrong format') else: break - self.artists = input(' {}[?]{} Artist names to search song lyrics (comma-separated) >>> '.format(color.BLUE, color.END)) - if is_empty(self.artists): - self.artists = False - else: - self.artists = self.artists.split(',') - - others = input(' {}[?]{} Some other relevant words (comma-separated) >>> '.format(color.BLUE, color.END)) - - leet = input(' {}[?]{} Do yo want to make leet transforms? [y/n] >>> '.format(color.BLUE, color.END)) - case = input(' {}[?]{} Do yo want to make case transforms? [y/n] >>> '.format(color.BLUE, color.END)) - - if leet.lower() == 'y': self.leet = True - else: self.leet = False + self.artists = input( + f' {color.BLUE}[?]{color.END} Artist names to search song lyrics (comma-separated) >>> ' + ) + self.artists = False if is_empty(self.artists) else self.artists.split(',') + others = input( + f' {color.BLUE}[?]{color.END} Some other relevant words (comma-separated) >>> ' + ) - if case.lower() == 'y': self.case = True - else: self.case = False + leet = input( + f' {color.BLUE}[?]{color.END} Do yo want to make leet transforms? [y/n] >>> ' + ) + case = input( + f' {color.BLUE}[?]{color.END} Do yo want to make case transforms? [y/n] >>> ' + ) + self.leet = leet.lower() == 'y' + self.case = case.lower() == 'y' while True: - n_words = input(' {}[?]{} How much words do you want to combine at most [{}] >>> '.format(color.BLUE, color.END, self.DEFAULT_N_WORDS)) + n_words = input( + f' {color.BLUE}[?]{color.END} How much words do you want to combine at most [{self.DEFAULT_N_WORDS}] >>> ' + ) if is_empty(n_words): self.n_words = self.DEFAULT_N_WORDS; break else: try: n_words = int(n_words) if n_words < 1: - print(' {}[!]{} Should be greater or equal than 1'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Should be greater or equal than 1') else: self.n_words = n_words break except ValueError: - print(' {}[!]{} Should be an integer'.format(color.RED, color.END)) + print(f' {color.RED}[!]{color.END} Should be an integer') # while True: # exclude = input(' {}[?]{} Exclude words from other wordlists? >>> '.format(color.BLUE, color.END)) @@ -152,7 +194,9 @@ def set_interactive_options(self): # self.exclude_wordlists = exclude # break - self.outfile = input(' {}[?]{} Output file [{}] >>> '.format(color.BLUE, color.END, self.DEFAULT_OUTPUT_FILE)) + self.outfile = input( + f' {color.BLUE}[?]{color.END} Output file [{self.DEFAULT_OUTPUT_FILE}] >>> ' + ) if is_empty(self.outfile): self.outfile = self.DEFAULT_OUTPUT_FILE print('') # Print blank line after all questions @@ -170,13 +214,11 @@ def set_interactive_options(self): self.base_wordlist.append(lastname) if not is_empty(birth): birth = birth.split('/') - for i in birth: - self.base_wordlist.append(i) + self.base_wordlist.extend(iter(birth)) self.base_wordlist.append((birth[2])[-2:]) # Also add two last digits of the year if not is_empty(others): others = others.split(',') - for i in others: - self.base_wordlist.append(i.lower()) + self.base_wordlist.extend(i.lower() for i in others) def set_cli_options(self): self.base_wordlist = [] diff --git a/bopscrk/modules/auxiliars.py b/bopscrk/modules/auxiliars.py index 9958ad9..0e747fc 100644 --- a/bopscrk/modules/auxiliars.py +++ b/bopscrk/modules/auxiliars.py @@ -14,10 +14,7 @@ def is_empty(variable): """ Check if a variable (in a type convertible to string) is empty. Returns True or False """ - empty = False - if len(str(variable)) == 0: - empty = True - return empty + return not str(variable) def is_valid_date(date_str): """ @@ -49,13 +46,12 @@ def append_wordlist_to_file(filepath, wordlist): def remove_duplicates_from_file(infile_path, outfile_path="temp.000000000.bopscrk"): lines_seen = set() # holds lines already seen - outfile = open(outfile_path, "w") - infile = open(infile_path, "r") - for line in infile: - if line not in lines_seen: # not a duplicate - outfile.write(line) - lines_seen.add(line) - outfile.close() + with open(outfile_path, "w") as outfile: + infile = open(infile_path, "r") + for line in infile: + if line not in lines_seen: # not a duplicate + outfile.write(line) + lines_seen.add(line) infile.close() os.remove(infile_path) os.rename(outfile_path, infile_path) \ No newline at end of file diff --git a/bopscrk/modules/banners.py b/bopscrk/modules/banners.py index 350d3ed..b8b3af2 100644 --- a/bopscrk/modules/banners.py +++ b/bopscrk/modules/banners.py @@ -22,38 +22,84 @@ def banner(name, version, author="r3nt0n"): name_rand_case = case_transforms(name) name_rand_case = name_rand_case[randint((len(name_rand_case) - 3), (len(name_rand_case) - 1))] version = version[:3] - print(' ,----------------------------------------------------, ,------------,');sleep(interval) - print(' | [][][][][] [][][][][] [][][][] [][__] [][][][] | | v{}{}{} |'.format(color.BLUE, version, color.END));sleep(interval) - print(' | | |------------|');sleep(interval) - print(' | [][][][][][][][][][][][][][_] [][][] [][][][] |===| {}{}{} |'.format(color.RED, name_rand_leet, color.END));sleep(interval) - print(' | [_][][][]{}[]{}[][][][]{}[][]{}[][][ | [][][] [][][][] |===| {}{}{}{} |'.format(color.KEY_HIGHL, color.END, color.KEY_HIGHL, color.END, color.BOLD, color.RED, name, color.END));sleep(interval) - print(' | [][_][]{}[]{}[][][][][]{}[]{}[][][][]|| [] [][][][] |===| {}{}{} |'.format(color.KEY_HIGHL, color.END, color.KEY_HIGHL, color.END, color.RED, name_rand_case, color.END));sleep(interval) - print(' | [__][][][]{}[]{}[]{}[]{}[][][][][][__] [][][] [][][]|| | |------------|'.format(color.KEY_HIGHL, color.END, color.KEY_HIGHL, color.END));sleep(interval) - print(' | [__][________________][__] [__][]|| | |{} {} {}|'.format(color.GREEN, author, color.END));sleep(interval) - print(' `----------------------------------------------------´ `------------´\n');sleep(interval) + print(' ,----------------------------------------------------, ,------------,') + sleep(interval) + print( + f' | [][][][][] [][][][][] [][][][] [][__] [][][][] | | v{color.BLUE}{version}{color.END} |' + ) + sleep(interval) + print(' | | |------------|') + sleep(interval) + print( + f' | [][][][][][][][][][][][][][_] [][][] [][][][] |===| {color.RED}{name_rand_leet}{color.END} |' + ) + sleep(interval) + print( + f' | [_][][][]{color.KEY_HIGHL}[]{color.END}[][][][]{color.KEY_HIGHL}[][]{color.END}[][][ | [][][] [][][][] |===| {color.BOLD}{color.RED}{name}{color.END} |' + ) + sleep(interval) + print( + f' | [][_][]{color.KEY_HIGHL}[]{color.END}[][][][][]{color.KEY_HIGHL}[]{color.END}[][][][]|| [] [][][][] |===| {color.RED}{name_rand_case}{color.END} |' + ) + sleep(interval) + print( + f' | [__][][][]{color.KEY_HIGHL}[]{color.END}[]{color.KEY_HIGHL}[]{color.END}[][][][][][__] [][][] [][][]|| | |------------|' + ) + sleep(interval) + print( + f' | [__][________________][__] [__][]|| | |{color.GREEN} {author} {color.END}|' + ) + sleep(interval) + print(' `----------------------------------------------------´ `------------´\n') + sleep(interval) def help_banner(): - print(u' +---------------------------------------------------------------------+');sleep(interval) - print(u' | Fields can be left empty. You can use accentuation in your words. |');sleep(interval) - print(u' | If you enable case transforms, won\'t matter the lower/uppercases |');sleep(interval) - print(u' | in your input. In "others" field (interactive mode), you can write |');sleep(interval) - print(u' | several words comma-separated (e.g.: 2C,Flipper). |');sleep(interval) - print(u' | |');sleep(interval) - print(u' | For advanced usage and documentation: |');sleep(interval) - print(u' | {}https://github.com/r3nt0n/bopscrk{} |'.format(color.ORANGE,color.END));sleep(interval) - print(u' +---------------------------------------------------------------------+\n');sleep(interval) + print(u' +---------------------------------------------------------------------+') + sleep(interval) + print(u' | Fields can be left empty. You can use accentuation in your words. |') + sleep(interval) + print(u' | If you enable case transforms, won\'t matter the lower/uppercases |') + sleep(interval) + print(u' | in your input. In "others" field (interactive mode), you can write |') + sleep(interval) + print(u' | several words comma-separated (e.g.: 2C,Flipper). |') + sleep(interval) + print(u' | |') + sleep(interval) + print(u' | For advanced usage and documentation: |') + sleep(interval) + print( + f' | {color.ORANGE}https://github.com/r3nt0n/bopscrk{color.END} |' + ) + sleep(interval) + print(u' +---------------------------------------------------------------------+\n') + sleep(interval) def bopscrk_banner(): sleep(interval * 4) print('\n') - print(u'{} ▄▄▄▄ ▒█████ ██▓███ ██████ ▄████▄ ██▀███ ██ ▄█▀'.format(color.ORANGE));sleep(interval) - print(u' ▓█████▄ ▒██▒ ██▒▓██░ ██▒▒██ ▒ ▒██▀ ▀█ ▓██ ▒ ██▒ ██▄█▒ ');sleep(interval) - print(u' ▒██▒ ▄██▒██░ ██▒▓██░ ██▓▒░ ▓██▄ ▒▓█ ▄ ▓██ ░▄█ ▒▓███▄░ ');sleep(interval) - print(u' ▒██░█▀ ▒██ ██░▒██▄█▓▒ ▒ ▒ ██▒▒▓▓▄ ▄██▒▒██▀▀█▄ ▓██ █▄ ');sleep(interval) - print(u' ░▓█ ▀█▓░ ████▓▒░▒██▒ ░ ░▒██████▒▒▒ ▓███▀ ░░██▓ ▒██▒▒██▒ █▄');sleep(interval) - print(u' ░▒▓███▀▒░ ▒░▒░▒░ ▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░░ ▒▓ ░▒▓░▒ ▒▒ ▓▒');sleep(interval) - print(u' ▒░▒ ░ ░ ▒ ▒░ ░▒ ░ ░ ░▒ ░ ░ ░ ▒ ░▒ ░ ▒░░ ░▒ ▒░');sleep(interval) - print(u' ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░░ ░ ░ ░░ ░');sleep(interval) - print(u' ░ ░ ░ ░ ░ ░ ░ ░ ░');sleep(interval) - print(u' ░ ░ {}'.format(color.END));sleep(interval) + print( + f'{color.ORANGE} ▄▄▄▄ ▒█████ ██▓███ ██████ ▄████▄ ██▀███ ██ ▄█▀' + ) + sleep(interval) + print(u' ▓█████▄ ▒██▒ ██▒▓██░ ██▒▒██ ▒ ▒██▀ ▀█ ▓██ ▒ ██▒ ██▄█▒ ') + sleep(interval) + print(u' ▒██▒ ▄██▒██░ ██▒▓██░ ██▓▒░ ▓██▄ ▒▓█ ▄ ▓██ ░▄█ ▒▓███▄░ ') + sleep(interval) + print(u' ▒██░█▀ ▒██ ██░▒██▄█▓▒ ▒ ▒ ██▒▒▓▓▄ ▄██▒▒██▀▀█▄ ▓██ █▄ ') + sleep(interval) + print(u' ░▓█ ▀█▓░ ████▓▒░▒██▒ ░ ░▒██████▒▒▒ ▓███▀ ░░██▓ ▒██▒▒██▒ █▄') + sleep(interval) + print(u' ░▒▓███▀▒░ ▒░▒░▒░ ▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░░ ▒▓ ░▒▓░▒ ▒▒ ▓▒') + sleep(interval) + print(u' ▒░▒ ░ ░ ▒ ▒░ ░▒ ░ ░ ░▒ ░ ░ ░ ▒ ░▒ ░ ▒░░ ░▒ ▒░') + sleep(interval) + print(u' ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░░ ░ ░ ░░ ░') + sleep(interval) + print(u' ░ ░ ░ ░ ░ ░ ░ ░ ░') + sleep(interval) + print( + f' ░ ░ {color.END}' + ) + sleep(interval) #sleep(interval*2) \ No newline at end of file diff --git a/bopscrk/modules/combinators.py b/bopscrk/modules/combinators.py index f5b4745..c6d3f31 100644 --- a/bopscrk/modules/combinators.py +++ b/bopscrk/modules/combinators.py @@ -17,9 +17,7 @@ def add_common_separators(wordlist): new_wordlist = [] for word in words: for separator in Config.SEPARATORS_CHARSET: - new_wordlist.append(word + separator) - new_wordlist.append(separator + word) - + new_wordlist.extend((word + separator, separator + word)) base_wordlist_with_seps = new_wordlist[:] #with tqdm(total=len(words)) as progressbar: @@ -27,8 +25,7 @@ def add_common_separators(wordlist): for word in words: for wordseparated in base_wordlist_with_seps: if word not in wordseparated: - new_wordlist.append(wordseparated + word) - new_wordlist.append(word + wordseparated) + new_wordlist.extend((wordseparated + word, word + wordseparated)) #progressbar.update() progressbar() @@ -44,10 +41,7 @@ def combinator(wordlist, nWords): #with tqdm(total=len(wlist_combined)) as progressbar: with alive_bar(total=len(wlist_combined), bar='bubbles', unknown='bubbles', spinner='bubbles',receipt=False) as progressbar: for combination in wlist_combined: - #progressbar.set_description("Processing %s" % combination) - word = '' - for i in combination: - word += i + word = ''.join(combination) if word not in new_wordlist: new_wordlist.append(word) #progressbar.update() progressbar() diff --git a/bopscrk/modules/config.py b/bopscrk/modules/config.py index b505902..ff0ec41 100644 --- a/bopscrk/modules/config.py +++ b/bopscrk/modules/config.py @@ -30,9 +30,7 @@ def merge_settings(self, chars, strings): def parse_booleans(self, value): try: - if value.lower() == 'true': - return True - return False + return value.lower() == 'true' except AttributeError: return None diff --git a/bopscrk/modules/excluders.py b/bopscrk/modules/excluders.py index 8475d79..7577525 100644 --- a/bopscrk/modules/excluders.py +++ b/bopscrk/modules/excluders.py @@ -19,17 +19,15 @@ def multithread_exclude(word_to_exclude, wordlist): #args = (word, words_to_exclude) diff_wordlist += pool.starmap(compare, [(word_to_exclude, word) for word in wordlist]) - # Rewriting here removes excluded words from final_wordlist before it checks next wordlist - final_wordlist = [word for word in diff_wordlist if word is not None] - return final_wordlist + return [word for word in diff_wordlist if word is not None] def remove_duplicates(wordlist): return list(OrderedDict.fromkeys(wordlist)) def remove_by_lengths(wordlist, min_length, max_length): '''expect a list, return a new list with the values between min and max length provided''' - new_wordlist = [] - for word in wordlist: - #if (len(str(word)) < min_length) or (len(str(word)) > max_length): wordlist.remove(word) - if (len(str(word)) >= min_length) and (len(str(word)) <= max_length): new_wordlist.append(str(word)) - return new_wordlist \ No newline at end of file + return [ + str(word) + for word in wordlist + if (len(str(word)) >= min_length) and (len(str(word)) <= max_length) + ] \ No newline at end of file diff --git a/bopscrk/modules/transforms.py b/bopscrk/modules/transforms.py index 84ebcdc..68324a6 100644 --- a/bopscrk/modules/transforms.py +++ b/bopscrk/modules/transforms.py @@ -27,8 +27,7 @@ def case_transforms(word): i=0 new_word = '' for char in word: - if i % 2 == 0: new_word += char.upper() - else: new_word += char + new_word += char.upper() if i % 2 == 0 else char i += 1 if new_word not in new_wordlist: new_wordlist.append(new_word) @@ -36,24 +35,20 @@ def case_transforms(word): i=0 new_word = '' for char in word: - if i % 2 != 0: new_word += char.upper() - else: new_word += char + new_word += char.upper() if i % 2 != 0 else char i += 1 if new_word not in new_wordlist: new_wordlist.append(new_word) # Make consonants upper (hello => HeLLo) vowels = 'aeiou' - new_word = '' - for char in word: - if char.lower() not in vowels: new_word += char.upper() - else: new_word += char + new_word = ''.join( + char.upper() if char.lower() not in vowels else char for char in word + ) if new_word not in new_wordlist: new_wordlist.append(new_word) - # Make vowels upper (hello => hEllO) - new_word = '' - for char in word: - if char.lower() in vowels: new_word += char.upper() - else: new_word += char + new_word = ''.join( + char.upper() if char.lower() in vowels else char for char in word + ) if new_word not in new_wordlist: new_wordlist.append(new_word) # recursive call function (not working, maybe this option won't be even useful) @@ -69,9 +64,8 @@ def case_transforms(word): def leet_transforms(word): new_wordlist = [] original_size = len(new_wordlist) - i=0 leet_charset = Config.LEET_CHARSET - for char in word: + for i, char in enumerate(word): for lchar in leet_charset: leeted_char = '' if lchar.startswith(char.lower()): @@ -79,8 +73,6 @@ def leet_transforms(word): new_word = word[:i] + leeted_char + word[i + 1:] if new_word not in new_wordlist: new_wordlist.append(new_word) # dont break to allow multiple transforms to a single char (e.g. a into 4 and @) - i += 1 - # MULTITHREAD RECURSIVE call function (doesn't seem efficient) # if Config.RECURSIVE_LEET and (len(new_wordlist) > original_size): # new_wordlist += multithread_transforms(leet_transforms, new_wordlist) @@ -115,9 +107,10 @@ def artist_space_transforms(word): new_wordlist.append(word.replace(' ', '')) # Replace spaces in artist name with all space replacements charset if (Config.ARTIST_SPACE_REPLACEMENT and Config.SPACE_REPLACEMENT_CHARSET): - for character in Config.SPACE_REPLACEMENT_CHARSET: - new_wordlist.append(word.replace(' ', character)) - + new_wordlist.extend( + word.replace(' ', character) + for character in Config.SPACE_REPLACEMENT_CHARSET + ) return new_wordlist @@ -131,8 +124,10 @@ def lyric_space_transforms(word): new_wordlist.append(word.replace(' ', '')) # Replace spaces in phrase with all space replacements charset if (Config.LYRIC_SPACE_REPLACEMENT and Config.SPACE_REPLACEMENT_CHARSET): - for character in Config.SPACE_REPLACEMENT_CHARSET: - new_wordlist.append(word.replace(' ', character)) + new_wordlist.extend( + word.replace(' ', character) + for character in Config.SPACE_REPLACEMENT_CHARSET + ) return new_wordlist