Skip to content

Commit

Permalink
Avoiding needless mac_address lookup, empty interfaces, banner tweak.
Browse files Browse the repository at this point in the history
mac_address lookup & empty iface for #112.
Banner tweak for #92
  • Loading branch information
derv82 committed Aug 16, 2018
1 parent d7120bc commit f76c339
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 3 additions & 1 deletion wifite/tools/airmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(self, phy, interface, driver, chipset):
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.
Expand Down Expand Up @@ -101,6 +100,9 @@ def get_interfaces():
if phy == 'PHY' or phy == 'Interface':
continue # Header

if len(interface.strip()) == 0:
continue

interfaces.append(AirmonIface(phy, interface, driver, chipset))

return interfaces
Expand Down
10 changes: 8 additions & 2 deletions wifite/tools/iwconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def get_interfaces(cls, mode=None):
from ..util.process import Process

interfaces = set()
iface = ''

(out, err) = Process.call('iwconfig')
for line in out.split('\n'):
Expand All @@ -37,11 +38,16 @@ def get_interfaces(cls, mode=None):
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)
Expand Down
13 changes: 6 additions & 7 deletions wifite/wifite.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ def run(self):

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):
Expand Down

0 comments on commit f76c339

Please sign in to comment.