Add eviltwin args. Add "Dependency" subclass
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from .dependency import Dependency
|
||||
from ..util.process import Process
|
||||
from ..util.input import xrange
|
||||
from ..config import Configuration
|
||||
|
||||
import os
|
||||
|
||||
class Aircrack(object):
|
||||
class Aircrack(Dependency):
|
||||
dependency_required = True
|
||||
dependency_name = 'aircrack-ng'
|
||||
dependency_url = 'https://www.aircrack-ng.org/install.html'
|
||||
|
||||
def __init__(self, ivs_file=None):
|
||||
|
||||
self.cracked_file = os.path.abspath(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from .dependency import Dependency
|
||||
from ..config import Configuration
|
||||
from ..util.process import Process
|
||||
from ..util.timer import Timer
|
||||
@@ -54,7 +55,11 @@ class WEPAttackType(object):
|
||||
return self.name
|
||||
|
||||
|
||||
class Aireplay(Thread):
|
||||
class Aireplay(Thread, Dependency):
|
||||
dependency_required = True
|
||||
dependency_name = 'aircrack-ng'
|
||||
dependency_url = 'https://www.aircrack-ng.org/install.html'
|
||||
|
||||
def __init__(self, target, attack_type, client_mac=None, replay_file=None):
|
||||
'''
|
||||
Starts aireplay process.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ..tools.ifconfig import Ifconfig
|
||||
from ..tools.iwconfig import Iwconfig
|
||||
from .dependency import Dependency
|
||||
from .ifconfig import Ifconfig
|
||||
from .iwconfig import Iwconfig
|
||||
from ..util.process import Process
|
||||
from ..util.color import Color
|
||||
from ..util.input import raw_input
|
||||
@@ -49,8 +50,12 @@ class AirmonIface(object):
|
||||
return s
|
||||
|
||||
|
||||
class Airmon(object):
|
||||
class Airmon(Dependency):
|
||||
''' Wrapper around the 'airmon-ng' program '''
|
||||
dependency_required = True
|
||||
dependency_name = 'airmon-ng'
|
||||
dependency_url = 'https://www.aircrack-ng.org/install.html'
|
||||
|
||||
base_interface = None
|
||||
killed_network_manager = False
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from .dependency import Dependency
|
||||
from .tshark import Tshark
|
||||
from .wash import Wash
|
||||
from ..util.process import Process
|
||||
@@ -10,8 +11,11 @@ from ..model.client import Client
|
||||
|
||||
import os, time
|
||||
|
||||
class Airodump(object):
|
||||
class Airodump(Dependency):
|
||||
''' Wrapper around airodump-ng program '''
|
||||
dependency_required = True
|
||||
dependency_name = 'airodump-ng'
|
||||
dependency_url = 'https://www.aircrack-ng.org/install.html'
|
||||
|
||||
def __init__(self, interface=None, channel=None, encryption=None,\
|
||||
wps=False, target_bssid=None, output_file_prefix='airodump',\
|
||||
|
||||
30
wifite/tools/dependency.py
Normal file
30
wifite/tools/dependency.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from ..util.process import Process
|
||||
from ..util.color import Color
|
||||
|
||||
class Dependency(object):
|
||||
required_attr_names = ['dependency_name', 'dependency_url', 'dependency_required']
|
||||
|
||||
# https://stackoverflow.com/a/49024227
|
||||
def __init_subclass__(cls):
|
||||
for attr_name in cls.required_attr_names:
|
||||
if not attr_name in cls.__dict__:
|
||||
raise NotImplementedError(
|
||||
"Attribute '{}' has not been overriden in class '{}'" \
|
||||
.format(attr_name, cls.__name__)
|
||||
)
|
||||
|
||||
|
||||
@classmethod
|
||||
def fails_dependency_check(cls):
|
||||
if Process.exists(cls.dependency_name):
|
||||
return False
|
||||
|
||||
if cls.dependency_required:
|
||||
Color.pl('{!} {R}error: required app {O}%s{R} was not found' % cls.dependency_name)
|
||||
Color.pl(' {W}install @ {C}%s{W}' % cls.dependency_url)
|
||||
return True
|
||||
|
||||
else:
|
||||
Color.pl('{!} {O}warning: recommended app {R}%s{O} was not found' % cls.dependency_name)
|
||||
Color.pl(' {W}install @ {C}%s{W}' % cls.dependency_url)
|
||||
return False
|
||||
Reference in New Issue
Block a user