2.1.1: Option to ignore APs without clients (--clients-only or -co)

Requested in #79
This commit is contained in:
derv82
2018-04-06 17:25:31 -04:00
parent b716e6099f
commit 2b7870cb7c
3 changed files with 12 additions and 1 deletions

View File

@@ -118,6 +118,11 @@ class Arguments(object):
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)
glob.add_argument('--clients-only', '-co',
action='store_true',
dest='clients_only',
help=Color.s('Only show targets that have associated clients (default: {G}off{W})'))
glob.add_argument('--showb',
action='store_true',
dest='show_bssids',

View File

@@ -12,7 +12,7 @@ class Configuration(object):
initialized = False # Flag indicating config has been initialized
temp_dir = None # Temporary directory
version = '2.1.0'
version = '2.1.1'
@staticmethod
def initialize(load_interface=True):
@@ -40,6 +40,7 @@ class Configuration(object):
Configuration.target_essid = None # User-defined AP name
Configuration.target_bssid = None # User-defined AP BSSID
Configuration.ignore_essid = None # ESSIDs to ignore
Configuration.clients_only = False # Only show targets that have associated clients
Configuration.five_ghz = False # Scan 5Ghz channels
Configuration.show_bssids = False # Show BSSIDs in targets list
Configuration.random_mac = False # Should generate a random Mac address at startup.
@@ -150,6 +151,9 @@ class Configuration(object):
if args.ignore_essid is not None:
Configuration.ignore_essid = args.ignore_essid
Color.pl('{+} {C}option:{W} {O}ignoring ESSIDs that include {R}%s{W}' % args.ignore_essid)
if args.clients_only == True:
Configuration.clients_only = True
Color.pl('{+} {C}option:{W} {O}ignoring targets that do not have associated clients')
if args.scan_time:
Configuration.scan_time = args.scan_time
Color.pl('{+} {C}option:{W} ({G}pillage{W}) attack all targets after {G}%d{W}s' % args.scan_time)

View File

@@ -237,6 +237,8 @@ class Airodump(object):
result = []
# Filter based on Encryption
for target in targets:
if Configuration.clients_only and len(target.clients) == 0:
continue
if 'WEP' in Configuration.encryption_filter and 'WEP' in target.encryption:
result.append(target)
elif 'WPA' in Configuration.encryption_filter and 'WPA' in target.encryption: