diff --git a/py/Airodump.py b/py/Airodump.py index be859f7..3a5fb46 100644 --- a/py/Airodump.py +++ b/py/Airodump.py @@ -299,9 +299,8 @@ if __name__ == '__main__': from Color import Color targets = airodump.get_targets() - Target.print_header() for idx, target in enumerate(targets, start=1): - Color.pl(' {G}%s %s' % (str(idx).rjust(3), target)) + Color.pl(' {G}%s %s' % (str(idx).rjust(3), target.to_str())) Configuration.delete_temp() diff --git a/py/Arguments.py b/py/Arguments.py index 2d393c2..bbbe96f 100644 --- a/py/Arguments.py +++ b/py/Arguments.py @@ -54,6 +54,10 @@ class Arguments(object): type=str, help=Color.s('ESSID (e.g. {GR}NETGEAR07{W}) of access point to attack')) glob.add_argument('--essid', help=argparse.SUPPRESS, action='store', dest='target_essid', type=str) + glob.add_argument('--showb', + action='store_true', + dest='show_bssids', + help=Color.s('Show BSSIDs of targets while scanning')) glob.add_argument('-v', '--verbose', action='count', diff --git a/py/Configuration.py b/py/Configuration.py index efc2c11..8d55dd1 100644 --- a/py/Configuration.py +++ b/py/Configuration.py @@ -37,6 +37,7 @@ class Configuration(object): Configuration.target_essid = None # User-defined AP name Configuration.target_bssid = None # User-defined AP BSSID 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. Configuration.no_deauth = False # Deauth hidden networks & WPA handshake targets Configuration.num_deauths = 1 # Number of deauth packets to send to each target. @@ -133,6 +134,9 @@ class Configuration(object): if args.five_ghz == True: Configuration.five_ghz = True Color.pl('{+} {C}option:{W} including {G}5Ghz networks{W} in scans') + if args.show_bssids == True: + Configuration.show_bssids = True + Color.pl('{+} {C}option:{W} showing {G}bssids{W} of targets during scan') if args.no_deauth == True: Configuration.no_deauth = True Color.pl('{+} {C}option:{W} will {R}not{W} {O}deauth{W} clients during scans or captures') diff --git a/py/Scanner.py b/py/Scanner.py index 6e48b59..2f77f8a 100644 --- a/py/Scanner.py +++ b/py/Scanner.py @@ -132,10 +132,25 @@ class Scanner(object): # Overwrite the current line Color.p('\r') - Target.print_header() + # First row: columns + Color.p(' NUM') + Color.p(' ESSID') + if Configuration.show_bssids: + Color.p(' BSSID') + Color.pl(' CH ENCR POWER WPS? CLIENT') + + # Second row: separator + Color.p(' ---') + Color.p(' -------------------------') + if Configuration.show_bssids: + Color.p(' -----------------') + Color.pl(' --- ---- ----- ---- ------') + + # Remaining rows: targets for idx, target in enumerate(self.targets, start=1): Color.clear_entire_line() - Color.pl(' {G}%s %s' % (str(idx).rjust(3), target)) + Color.p(' {G}%s ' % str(idx).rjust(3)) + Color.pl(target.to_str(Configuration.show_bssids)) @staticmethod def get_terminal_height(): diff --git a/py/Target.py b/py/Target.py index 0c4d57d..bd68a99 100644 --- a/py/Target.py +++ b/py/Target.py @@ -78,7 +78,7 @@ class Target(object): if bssid_multicast.match(self.bssid): raise Exception("Ignoring target with Multicast BSSID (%s)" % self.bssid) - def __str__(self): + def to_str(self, show_bssid=False): ''' *Colored* string representation of this Target. Specifically formatted for the "scanning" table view. @@ -99,6 +99,11 @@ class Target(object): # Unknown ESSID essid = Color.s("{O}%s" % essid) + if show_bssid: + bssid = Color.s('{O}%s ' % self.bssid) + else: + bssid = '' + channel_color = "{G}" if int(self.channel) > 14: channel_color = "{C}" @@ -131,24 +136,16 @@ class Target(object): if len(self.clients) > 0: clients = Color.s('{G} ' + str(len(self.clients))) - result = '%s %s %s %s %s %s' % (essid, channel, - encryption, power, - wps, clients) + result = '%s %s%s %s %s %s %s' % ( + essid, bssid, channel, encryption, power, wps, clients) result += Color.s("{W}") return result - @staticmethod - def print_header(): - ''' Prints header rows for "scanning" table view ''' - print ' NUM ESSID CH ENCR POWER WPS? CLIENT' - print ' --- ------------------------- --- ---- ----- ---- ------' - if __name__ == '__main__': fields = 'AA:BB:CC:DD:EE:FF,2015-05-27 19:28:44,2015-05-27 19:28:46,1,54,WPA2,CCMP TKIP,PSK,-58,2,0,0.0.0.0,9,HOME-ABCD,'.split(',') t = Target(fields) t.clients.append("asdf") t.clients.append("asdf") - Target.print_header() - Color.pl(' {G}%s %s' % ('1'.rjust(3), t)) + print t.to_str()