Created
May 28, 2023 14:04
-
-
Save nullenc0de/22ede639ad319896bb27736b8c0377e6 to your computer and use it in GitHub Desktop.
Find Best Wordlist
This file contains hidden or 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 os | |
def find_best_wordlists(user_word, max_wordlists): | |
wordlists_dir = '/opt/OneListForAll/dict' | |
wordlists = os.listdir(wordlists_dir) | |
matched_wordlists = [] | |
for wordlist in wordlists: | |
if user_word.lower() in wordlist.lower(): | |
matched_wordlists.append(wordlist) | |
matched_wordlists = sorted(matched_wordlists, key=lambda x: x.lower()) | |
return matched_wordlists[:max_wordlists] | |
# Get user input | |
user_word = input("Enter a word: ") | |
# Set the maximum number of wordlists | |
max_wordlists = 5 | |
# Find the best wordlists | |
best_wordlists = find_best_wordlists(user_word, max_wordlists) | |
if best_wordlists: | |
print(f"The top {max_wordlists} wordlists for '{user_word}' are:") | |
for i, wordlist in enumerate(best_wordlists): | |
print(f"{i+1}. {wordlist}") | |
else: | |
print("No wordlists found.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment