From 710dd98b6687563916cfc6b928cdfb0aee8aa15b Mon Sep 17 00:00:00 2001 From: derv82 Date: Mon, 3 Sep 2018 17:02:27 -0700 Subject: [PATCH] Detect when --dict is a directory, show warning and ignore wordlist. In case people pass in a directory, until we figure out #135 --- wifite/config.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wifite/config.py b/wifite/config.py index 0d38830..74ac894 100755 --- a/wifite/config.py +++ b/wifite/config.py @@ -283,12 +283,15 @@ class Configuration(object): cls.wpa_filter = args.wpa_filter if args.wordlist: - if os.path.exists(args.wordlist): - cls.wordlist = args.wordlist - Color.pl('{+} {C}option:{W} using wordlist {G}%s{W} to crack WPA handshakes' % args.wordlist) - else: + if not os.path.exists(args.wordlist): cls.wordlist = None Color.pl('{+} {C}option:{O} wordlist {R}%s{O} was not found, wifite will NOT attempt to crack handshakes' % args.wordlist) + elif os.path.isfile(args.wordlist): + cls.wordlist = args.wordlist + Color.pl('{+} {C}option:{W} using wordlist {G}%s{W} to crack WPA handshakes' % args.wordlist) + elif os.path.isdir(args.wordlist): + cls.wordlist = None + Color.pl('{+} {C}option:{O} wordlist {R}%s{O} is a directory, not a file. Wifite will NOT attempt to crack handshakes' % args.wordlist) if args.wpa_deauth_timeout: cls.wpa_deauth_timeout = args.wpa_deauth_timeout