回答受付が終了しました
パスワード付きのrarファイルにブルートフォースアタックをするpythonコードです。
パスワード付きのrarファイルにブルートフォースアタックをするpythonコードです。 動作はするみたいですが、当たりのパスワードをテキストファイルに入れてかけて見ても「パスワードは見つかりませんでした」と、出ます。 どこが間違ってるのでしょうか? import rarfile from tqdm import tqdm rarfile.UNRAR_TOOL = r"unrar.exe" wordlist = "テキスト.txt" rar_file = "ファイル.rar" rar_file = rarfile.RarFile n_words = len(list(open(wordlist, "rb"))) print("Total passwords to test:", n_words) with open(wordlist, "rb") as wordlist: for word in tqdm(wordlist, total=n_words, unit="word"): try: rar_file.extractall(pwd=word) except: continue else: print("[+] Password found:", word.decode('UTF-8')) exit(0) print("[!] Password not found, try other wordlist.")
プログラミング・245閲覧