mirror of
https://github.com/Cronocide/wifipumpkin3.git
synced 2025-01-23 11:48:57 +00:00
added config plugins, show plugin status, fixed responder3
This commit is contained in:
parent
23c5be6378
commit
51baaebf5a
@ -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 = []
|
||||
|
@ -33,6 +33,7 @@ class ProxyModeController(PluginsUI, ControllerBlueprint):
|
||||
'Name' : k.Name,
|
||||
'Port' : k.getRunningPort(),
|
||||
'Description': k.Description,
|
||||
'Config' : k.getConfig
|
||||
}
|
||||
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user