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

Merged tested pull requests and added manufacturer/oui functionality #186

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Ignore multiple ESSIDs with -E #166
simonblack committed Dec 14, 2018
commit 795e3c12924e599365aadab2867f9441c17c9216
11 changes: 6 additions & 5 deletions wifite/args.py
Original file line number Diff line number Diff line change
@@ -125,14 +125,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',
10 changes: 5 additions & 5 deletions wifite/config.py
Original file line number Diff line number Diff line change
@@ -42,7 +42,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
@@ -245,10 +245,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
6 changes: 4 additions & 2 deletions wifite/tools/airodump.py
Original file line number Diff line number Diff line change
@@ -275,11 +275,13 @@ def filter_targets(targets, skip_wps=False):

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)
elif manufacturer and result[i].bssid:
o = Configuration.manufacturers.get(''.join(result[i].bssid.split(':')[:3]), '')
2 changes: 1 addition & 1 deletion wifite/util/scanner.py
Original file line number Diff line number Diff line change
@@ -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