Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore multiple ESSIDs with -E #166

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions wifite/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions wifite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions wifite/tools/airodump.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,13 @@ 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)
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
Expand Down
2 changes: 1 addition & 1 deletion wifite/util/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down