From f76c339bb7071910dba0626fb4c5c62a6df04ee9 Mon Sep 17 00:00:00 2001 From: derv82 Date: Thu, 16 Aug 2018 01:10:34 -0700 Subject: [PATCH] Avoiding needless mac_address lookup, empty interfaces, banner tweak. mac_address lookup & empty iface for #112. Banner tweak for #92 --- wifite/tools/airmon.py | 4 +++- wifite/tools/iwconfig.py | 10 ++++++++-- wifite/wifite.py | 13 ++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/wifite/tools/airmon.py b/wifite/tools/airmon.py index 8313a12..630b572 100755 --- a/wifite/tools/airmon.py +++ b/wifite/tools/airmon.py @@ -19,7 +19,6 @@ class AirmonIface(object): self.interface = interface self.driver = driver self.chipset = chipset - self.mac_address = Ifconfig.get_mac(interface) # Max length of fields. # Used for printing a table of interfaces. @@ -101,6 +100,9 @@ class Airmon(Dependency): if phy == 'PHY' or phy == 'Interface': continue # Header + if len(interface.strip()) == 0: + continue + interfaces.append(AirmonIface(phy, interface, driver, chipset)) return interfaces diff --git a/wifite/tools/iwconfig.py b/wifite/tools/iwconfig.py index a3aa127..78103be 100755 --- a/wifite/tools/iwconfig.py +++ b/wifite/tools/iwconfig.py @@ -29,6 +29,7 @@ class Iwconfig(Dependency): from ..util.process import Process interfaces = set() + iface = '' (out, err) = Process.call('iwconfig') for line in out.split('\n'): @@ -37,11 +38,16 @@ class Iwconfig(Dependency): if not line.startswith(' '): iface = line.split(' ')[0] if '\t' in iface: - iface = iface.split('\t')[0] + iface = iface.split('\t')[0].strip() + + iface = iface.strip() + if len(iface) == 0: + continue + if mode is None: interfaces.add(iface) - if mode is not None and 'Mode:{}'.format(mode) in line: + if mode is not None and 'Mode:{}'.format(mode) in line and len(iface) > 0: interfaces.add(iface) return list(interfaces) diff --git a/wifite/wifite.py b/wifite/wifite.py index d117354..9fbdf59 100755 --- a/wifite/wifite.py +++ b/wifite/wifite.py @@ -64,13 +64,12 @@ class Wifite(object): def print_banner(self): """ Displays ASCII art of the highest caliber. """ - Color.pl(r''' -{G} . {GR}{D} {W}{G} . {W} -{G}.´ · .{GR}{D} {W}{G}. · `. {G}wifite {D}%s{W} -{G}: : : {GR}{D} (¯) {W}{G} : : : {W}{D}automated wireless auditor -{G}`. · `{GR}{D} /¯\ {W}{G}´ · .´ {C}{D}https://github.com/derv82/wifite2 -{G} ` {GR}{D}/¯¯¯\{W}{G} ´ {W} -''' % Configuration.version) + Color.pl(r'{G} . {GR}{D} {W}{G} . {W}') + Color.pl(r'{G}.´ · .{GR}{D} {W}{G}. · `. {G}wifite {D}%s{W}' % Configuration.version) + Color.pl(r'{G}: : : {GR}{D} (¯) {W}{G} : : : {W}{D}automated wireless auditor{W}') + Color.pl(r'{G}`. · `{GR}{D} /¯\ {W}{G}´ · .´ {C}{D}https://github.com/derv82/wifite2{W}') + Color.pl(r'{G} ` {GR}{D}/¯¯¯\{W}{G} ´ {W}') + Color.pl('') def user_wants_to_continue(self, targets_remaining, attacks_remaining=0):