2.1.1: Option to ignore APs without clients (--clients-only or -co)
Requested in #79
This commit is contained in:
@@ -118,6 +118,11 @@ class Arguments(object):
|
|||||||
help=self._verbose('Hides targets with ESSIDs that match the given text'))
|
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('--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',
|
glob.add_argument('--showb',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='show_bssids',
|
dest='show_bssids',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Configuration(object):
|
|||||||
|
|
||||||
initialized = False # Flag indicating config has been initialized
|
initialized = False # Flag indicating config has been initialized
|
||||||
temp_dir = None # Temporary directory
|
temp_dir = None # Temporary directory
|
||||||
version = '2.1.0'
|
version = '2.1.1'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def initialize(load_interface=True):
|
def initialize(load_interface=True):
|
||||||
@@ -40,6 +40,7 @@ class Configuration(object):
|
|||||||
Configuration.target_essid = None # User-defined AP name
|
Configuration.target_essid = None # User-defined AP name
|
||||||
Configuration.target_bssid = None # User-defined AP BSSID
|
Configuration.target_bssid = None # User-defined AP BSSID
|
||||||
Configuration.ignore_essid = None # ESSIDs to ignore
|
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.five_ghz = False # Scan 5Ghz channels
|
||||||
Configuration.show_bssids = False # Show BSSIDs in targets list
|
Configuration.show_bssids = False # Show BSSIDs in targets list
|
||||||
Configuration.random_mac = False # Should generate a random Mac address at startup.
|
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:
|
if args.ignore_essid is not None:
|
||||||
Configuration.ignore_essid = args.ignore_essid
|
Configuration.ignore_essid = args.ignore_essid
|
||||||
Color.pl('{+} {C}option:{W} {O}ignoring ESSIDs that include {R}%s{W}' % 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:
|
if args.scan_time:
|
||||||
Configuration.scan_time = 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)
|
Color.pl('{+} {C}option:{W} ({G}pillage{W}) attack all targets after {G}%d{W}s' % args.scan_time)
|
||||||
|
|||||||
@@ -237,6 +237,8 @@ class Airodump(object):
|
|||||||
result = []
|
result = []
|
||||||
# Filter based on Encryption
|
# Filter based on Encryption
|
||||||
for target in targets:
|
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:
|
if 'WEP' in Configuration.encryption_filter and 'WEP' in target.encryption:
|
||||||
result.append(target)
|
result.append(target)
|
||||||
elif 'WPA' in Configuration.encryption_filter and 'WPA' in target.encryption:
|
elif 'WPA' in Configuration.encryption_filter and 'WPA' in target.encryption:
|
||||||
|
|||||||
Reference in New Issue
Block a user