Avoiding needless mac_address lookup, empty interfaces, banner tweak.

mac_address lookup & empty iface for #112.
Banner tweak for #92
This commit is contained in:
derv82
2018-08-16 01:10:34 -07:00
parent d7120bca50
commit f76c339bb7
3 changed files with 17 additions and 10 deletions

View File

@@ -19,7 +19,6 @@ class AirmonIface(object):
self.interface = interface self.interface = interface
self.driver = driver self.driver = driver
self.chipset = chipset self.chipset = chipset
self.mac_address = Ifconfig.get_mac(interface)
# Max length of fields. # Max length of fields.
# Used for printing a table of interfaces. # Used for printing a table of interfaces.
@@ -101,6 +100,9 @@ class Airmon(Dependency):
if phy == 'PHY' or phy == 'Interface': if phy == 'PHY' or phy == 'Interface':
continue # Header continue # Header
if len(interface.strip()) == 0:
continue
interfaces.append(AirmonIface(phy, interface, driver, chipset)) interfaces.append(AirmonIface(phy, interface, driver, chipset))
return interfaces return interfaces

View File

@@ -29,6 +29,7 @@ class Iwconfig(Dependency):
from ..util.process import Process from ..util.process import Process
interfaces = set() interfaces = set()
iface = ''
(out, err) = Process.call('iwconfig') (out, err) = Process.call('iwconfig')
for line in out.split('\n'): for line in out.split('\n'):
@@ -37,11 +38,16 @@ class Iwconfig(Dependency):
if not line.startswith(' '): if not line.startswith(' '):
iface = line.split(' ')[0] iface = line.split(' ')[0]
if '\t' in iface: 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: if mode is None:
interfaces.add(iface) 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) interfaces.add(iface)
return list(interfaces) return list(interfaces)

View File

@@ -64,13 +64,12 @@ class Wifite(object):
def print_banner(self): def print_banner(self):
""" Displays ASCII art of the highest caliber. """ """ Displays ASCII art of the highest caliber. """
Color.pl(r''' Color.pl(r'{G} . {GR}{D} {W}{G} . {W}')
{G} . {GR}{D} {W}{G} . {W} Color.pl(r'{G}.´ · .{GR}{D} {W}{G}. · `. {G}wifite {D}%s{W}' % Configuration.version)
{G}.´ · .{GR}{D} {W}{G}. · `. {G}wifite {D}%s{W} Color.pl(r'{G}: : : {GR}{D} (¯) {W}{G} : : : {W}{D}automated wireless auditor{W}')
{G}: : : {GR}{D} (¯) {W}{G} : : : {W}{D}automated wireless auditor Color.pl(r'{G}`. · `{GR}{D} \ {W}{G}´ · .´ {C}{D}https://github.com/derv82/wifite2{W}')
{G}`. · `{GR}{D} \ {W}{G}´ · .´ {C}{D}https://github.com/derv82/wifite2 Color.pl(r'{G} ` {GR}{D}¯¯\{W}{G} ´ {W}')
{G} ` {GR}{D}/¯¯¯\{W}{G} ´ {W} Color.pl('')
''' % Configuration.version)
def user_wants_to_continue(self, targets_remaining, attacks_remaining=0): def user_wants_to_continue(self, targets_remaining, attacks_remaining=0):