From b31e8c98cdb53cd6473875c8059d957c6c86060d Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Tue, 23 Oct 2018 16:14:38 +0300 Subject: [PATCH 1/2] tools/airodump.py: Ignore multiple ESSIDs with -E * Allow multiple ESSIDs to be ignored by appending all the -E/--ignore-essid values to the ignore_essids list * The check on whether to ignore an ESSID or not is now case sensitive for better control Signed-off-by: Radu Nicolau --- wifite/args.py | 11 ++++++----- wifite/config.py | 10 +++++----- wifite/tools/airodump.py | 4 +++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/wifite/args.py b/wifite/args.py index af6b6183a..f5aa7dbd5 100755 --- a/wifite/args.py +++ b/wifite/args.py @@ -115,14 +115,15 @@ def _add_global_args(self, glob): dest='target_essid', type=str) glob.add_argument('-E', - action='store', - dest='ignore_essid', + action='append', + dest='ignore_essids', metavar='[text]', type=str, default=None, - help=self._verbose('Hides targets with ESSIDs that match the given text')) - glob.add_argument('--ignore-essid', help=argparse.SUPPRESS, action='store', - dest='ignore_essid', type=str) + help=self._verbose('Hides targets with ESSIDs that match the given text. ' + 'Can be used more than once.')) + glob.add_argument('--ignore-essid', help=argparse.SUPPRESS, action='append', + dest='ignore_essids', type=str) glob.add_argument('--clients-only', action='store_true', diff --git a/wifite/config.py b/wifite/config.py index 9759ff5b5..8b9673fa7 100755 --- a/wifite/config.py +++ b/wifite/config.py @@ -41,7 +41,7 @@ def initialize(cls, load_interface=True): cls.target_channel = None # User-defined channel to scan cls.target_essid = None # User-defined AP name cls.target_bssid = None # User-defined AP BSSID - cls.ignore_essid = None # ESSIDs to ignore + cls.ignore_essids = None # ESSIDs to ignore cls.clients_only = False # Only show targets that have associated clients cls.five_ghz = False # Scan 5Ghz channels cls.show_bssids = False # Show BSSIDs in targets list @@ -215,10 +215,10 @@ def parse_settings_args(cls, args): cls.target_essid = args.target_essid Color.pl('{+} {C}option:{W} targeting ESSID {G}%s{W}' % args.target_essid) - if args.ignore_essid is not None: - cls.ignore_essid = args.ignore_essid - Color.pl('{+} {C}option:{W} {O}ignoring ESSIDs that include {R}%s{W}' % ( - args.ignore_essid)) + if args.ignore_essids is not None: + cls.ignore_essids = args.ignore_essids + Color.pl('{+} {C}option: {O}ignoring ESSID(s): {R}%s{W}' % + ', '.join(args.ignore_essids)) if args.clients_only == True: cls.clients_only = True diff --git a/wifite/tools/airodump.py b/wifite/tools/airodump.py index 0092af117..9db648dc1 100755 --- a/wifite/tools/airodump.py +++ b/wifite/tools/airodump.py @@ -271,7 +271,9 @@ def filter_targets(targets, skip_wps=False): essid = Configuration.target_essid i = 0 while i < len(result): - if result[i].essid is not None and Configuration.ignore_essid is not None and Configuration.ignore_essid.lower() in result[i].essid.lower(): + if result[i].essid is not None and\ + Configuration.ignore_essids is not None and\ + result[i].essid in Configuration.ignore_essids: result.pop(i) elif bssid and result[i].bssid.lower() != bssid.lower(): result.pop(i) From cb0afd2867c943bcff1513b549868582be08950f Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Tue, 23 Oct 2018 16:16:55 +0300 Subject: [PATCH 2/2] Targeted attack make -e ESSID case sensitive * Finding and attacking an AP based on the ESSID is now case sensitive, for more precise control Signed-off-by: Radu Nicolau --- wifite/tools/airodump.py | 2 +- wifite/util/scanner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wifite/tools/airodump.py b/wifite/tools/airodump.py index 9db648dc1..8b74e2e8b 100755 --- a/wifite/tools/airodump.py +++ b/wifite/tools/airodump.py @@ -277,7 +277,7 @@ def filter_targets(targets, skip_wps=False): result.pop(i) elif bssid and result[i].bssid.lower() != bssid.lower(): result.pop(i) - elif essid and result[i].essid and result[i].essid.lower() != essid.lower(): + elif essid and result[i].essid and result[i].essid != essid: result.pop(i) else: i += 1 diff --git a/wifite/util/scanner.py b/wifite/util/scanner.py index 29b11db28..4910caf4f 100755 --- a/wifite/util/scanner.py +++ b/wifite/util/scanner.py @@ -93,7 +93,7 @@ def found_target(self): if bssid and target.bssid and bssid.lower() == target.bssid.lower(): self.target = target break - if essid and target.essid and essid.lower() == target.essid.lower(): + if essid and target.essid and essid == target.essid: self.target = target break