Adding my scripts and writeups to the folder

This commit is contained in:
HTB
2021-03-09 20:28:34 -06:00
parent cf301732f1
commit a672261fd9
8 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#Takes a file containing separate words and returns all permutations to further generate a wordlist from
from itertools import permutations
#Begin with list of words and append results to original list
infile = "words"
outfile = "wordlist"
#Create list L that contains each word
with open(infile) as wordlist:
L = [line.rstrip() for line in wordlist]
#Permutate words at every length from 1 through len(words)
with open(outfile, "w") as wordlist:
for n in range(len(L)+1):
for perm in permutations(L, n):
wordlist.write(''.join(perm))
wordlist.write('\n')