From 894d3852ad34d9f6d5fb1ada589dcefd15134242 Mon Sep 17 00:00:00 2001 From: mh4x0f Date: Tue, 24 Mar 2020 19:24:45 -0300 Subject: [PATCH] added pumpkinproxy plugins visualization --- wifipumpkin3/core/main.py | 29 ++++++++++++++++++++++++- wifipumpkin3/core/utility/collection.py | 8 +++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/wifipumpkin3/core/main.py b/wifipumpkin3/core/main.py index bf3a00c..8738ea1 100644 --- a/wifipumpkin3/core/main.py +++ b/wifipumpkin3/core/main.py @@ -235,7 +235,7 @@ class PumpkinShell(Qt.QObject, ConsoleUI): print('\n') def do_set(self, args): - ''' set variable the ''' + ''' set variable proxy,plugin and access point ''' try: command,value = args.split()[0],args.split()[1] for func in self.parser_list_func: @@ -257,8 +257,18 @@ class PumpkinShell(Qt.QObject, ConsoleUI): def do_proxys(self, args): ''' show all proxys available for attack ''' headers_table, output_table = ["Proxy", "Active", 'Port', 'Description'], [] + plugin_info_activated = None + config_instance = None + headers_plugins, output_plugins = ["Name", "Active"], [] + for plugin_name, plugin_info in self.proxy.getInfo().items(): status_plugin = self.conf.get('proxy_plugins',plugin_name, format=bool) + + if (plugin_info['Config'] != None) and (plugin_info['Config']. + get_name_activated_plugin('plugins') != None): + plugin_info_activated = plugin_info + config_instance = plugin_info_activated['Config'] + output_table.append( [ plugin_name,setcolor('True',color='green') if @@ -271,6 +281,23 @@ class PumpkinShell(Qt.QObject, ConsoleUI): print(display_messages('Available Proxys:',info=True,sublime=True)) print(tabulate(output_table, headers_table,tablefmt="simple")) print('\n') + # check plugin none + if not plugin_info_activated: return + # check if plugin selected is iquals the plugin config + if (plugin_info_activated['ID'] != self.conf.get_name_activated_plugin('proxy_plugins')): + return + all_plugins = plugin_info_activated['Config'].get_all_childname('plugins') + 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:'.format(plugin_info_activated['Name']),info=True,sublime=True)) + print(tabulate(output_plugins, headers_plugins,tablefmt="simple")) + print('\n') def do_plugins(self, args=str): diff --git a/wifipumpkin3/core/utility/collection.py b/wifipumpkin3/core/utility/collection.py index 5ea98cc..dc13539 100644 --- a/wifipumpkin3/core/utility/collection.py +++ b/wifipumpkin3/core/utility/collection.py @@ -55,6 +55,14 @@ class SettingsINI(object): def get_all_childname(self,key): """ get list all childskeys on file config.ini """ return [x.split('/')[1] for x in self.get_all_keys() if x.split('/')[0] == key] + + def get_name_activated_plugin(self, key): + """ get status by plugin name """ + plugins = self.get_all_childname(key) + for plugin in plugins: + if self.get(key, plugin, format=bool): + return plugin + return None def get_all_keys(self): """ get all keys on settings"""