diff --git a/wifipumpkin3/core/controllers/mitmcontroller.py b/wifipumpkin3/core/controllers/mitmcontroller.py index fa8bf50..6133670 100644 --- a/wifipumpkin3/core/controllers/mitmcontroller.py +++ b/wifipumpkin3/core/controllers/mitmcontroller.py @@ -25,7 +25,8 @@ class MitmController(PluginsUI,ControllerBlueprint): self.mitm_infor[k.ID] = { 'ID': k.ID, 'Name' : k.Name, - 'Description': k.Description + 'Description': k.Description, + 'Config' : k.getConfig } self.m_name = [] diff --git a/wifipumpkin3/core/controllers/proxycontroller.py b/wifipumpkin3/core/controllers/proxycontroller.py index 30e591e..6d38c04 100644 --- a/wifipumpkin3/core/controllers/proxycontroller.py +++ b/wifipumpkin3/core/controllers/proxycontroller.py @@ -33,6 +33,7 @@ class ProxyModeController(PluginsUI, ControllerBlueprint): 'Name' : k.Name, 'Port' : k.getRunningPort(), 'Description': k.Description, + 'Config' : k.getConfig } diff --git a/wifipumpkin3/core/main.py b/wifipumpkin3/core/main.py index eb471d7..6c3dc12 100644 --- a/wifipumpkin3/core/main.py +++ b/wifipumpkin3/core/main.py @@ -237,7 +237,7 @@ class PumpkinShell(Qt.QObject, ConsoleUI): if (plugins_selected != []): self.conf.set('proxy_plugins', plugins_selected[0], True) for proxy in self.conf.get_all_childname('proxy_plugins'): - if proxy != plugins_selected[0]: + if proxy != plugins_selected[0] and not '_config' in proxy: self.conf.set('proxy_plugins', proxy, False) return return print(display_messages('unknown command: {} '.format(proxy_name),error=True)) @@ -250,7 +250,7 @@ class PumpkinShell(Qt.QObject, ConsoleUI): status_plugin = self.conf.get('proxy_plugins',plugin_name, format=bool) output_table.append( [ - plugin_name,setcolor('Yes',color='green') if + plugin_name,setcolor('True',color='green') if status_plugin else setcolor('False',color='red'), plugin_info['Port'], plugin_info['Description'][:50] + '...' @@ -273,20 +273,38 @@ class PumpkinShell(Qt.QObject, ConsoleUI): def do_plugins(self, args=str): - ''' show/edit all plugins available for attack ''' + ''' show all plugins available for attack ''' headers_table, output_table = ["Name", "Active", "Description"], [] + headers_plugins, output_plugins = ["Name", "Active"], [] + all_plugins,config_instance = None, None for plugin_name, plugin_info in self.mitmhandler.getInfo().items(): status_plugin = self.conf.get('mitm_modules',plugin_name, format=bool) output_table.append( - [ plugin_name,setcolor('Yes',color='green') if + [ plugin_name,setcolor('True',color='green') if status_plugin else setcolor('False',color='red'), plugin_info['Description'][:50] + '...' ]) - + if (self.mitmhandler.getInfo()[plugin_name]['Config'] != None and status_plugin): + config_instance = self.mitmhandler.getInfo()[plugin_name]['Config'] + all_plugins = self.mitmhandler.getInfo()[plugin_name]['Config'].get_all_childname('plugins') print(display_messages('Available Plugins:',info=True,sublime=True)) print(tabulate(output_table, headers_table,tablefmt="simple")) print('\n') + if not all_plugins: return + + for plugin_name in all_plugins: + status_plugin = config_instance.get('plugins', plugin_name,format=bool ) + output_plugins.append( + [ + plugin_name, + setcolor('True',color='green') if status_plugin + else setcolor('False',color='red') + ]) + print(display_messages('Plugins:',info=True,sublime=True)) + print(tabulate(output_plugins, headers_plugins,tablefmt="simple")) + print('\n') + def help_plugins(self): print('\n'.join([ 'usage: set plugin [module name ] [(True/False)]', 'wifipumpkin-ng: error: unrecognized arguments', diff --git a/wifipumpkin3/core/servers/mitm/mitmmode.py b/wifipumpkin3/core/servers/mitm/mitmmode.py index b2deb54..e137b6a 100644 --- a/wifipumpkin3/core/servers/mitm/mitmmode.py +++ b/wifipumpkin3/core/servers/mitm/mitmmode.py @@ -31,11 +31,13 @@ class MitmMode(Widget): LogFile = C.LOG_ALL ModSettings = False ModType = "proxy" # proxy or server + ConfigMitm = None Hidden = True _cmd_array = [] plugins = [] sendError = QtCore.pyqtSignal(str) sendSingal_disable = QtCore.pyqtSignal(object) + config = None def __init__(self,parent=None): super(MitmMode, self).__init__(parent) @@ -61,6 +63,10 @@ class MitmMode(Widget): self.logger.filename = self.LogFile self.loggermanager.add( self.ID, self.logger) + @property + def getConfig(self): + return self.config + def getModType(self): return self.ModType diff --git a/wifipumpkin3/core/servers/mitm/responder3.py b/wifipumpkin3/core/servers/mitm/responder3.py index 8379514..f09f41d 100644 --- a/wifipumpkin3/core/servers/mitm/responder3.py +++ b/wifipumpkin3/core/servers/mitm/responder3.py @@ -30,9 +30,12 @@ class Responder3(MitmMode): Author = "PumpkinDev" Description = "New and improved Responder for Python3" LogFile = C.LOG_RESPONDER3 + ConfigMitmPath = None _cmd_array = [] ModSettings = True ModType = "proxy" # proxy or server + config = None + def __init__(self,parent,FSettingsUI=None,main_method=None, **kwargs): super(Responder3, self).__init__(parent) self.setID(self.ID) diff --git a/wifipumpkin3/core/servers/proxy/proxymode.py b/wifipumpkin3/core/servers/proxy/proxymode.py index 5721254..6b9213b 100644 --- a/wifipumpkin3/core/servers/proxy/proxymode.py +++ b/wifipumpkin3/core/servers/proxy/proxymode.py @@ -32,6 +32,7 @@ class ProxyMode(Widget,ComponentBlueprint): addDock=QtCore.pyqtSignal(object) TypePlugin = 1 RunningPort = 80 + config = None def __init__(self,parent): @@ -81,6 +82,12 @@ class ProxyMode(Widget,ComponentBlueprint): for rules in self.defaults_rules[self.ID]: os.system(rules) + + + @property + def getConfig(self): + return self.config + def setRunningPort(self, value): self.RunningPort = value