From 94725cd64bf53a2008d7f4aebf40f6d23396f2dd Mon Sep 17 00:00:00 2001 From: ccsplit Date: Fri, 13 Oct 2017 19:24:42 -0500 Subject: [PATCH 1/2] Fix #749 - Add check for 'Agent' in self.module.options When attempting to switch Modules it will try to set the current Agent for the new module that will be used. However, this fails when switching from `external/generate_agent.py` because it does not have this option within the self.module.options. Therefore, I changed it to check if the Key exists within self.module.options and if it does not exist it will be set to ''. --- lib/common/empire.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/common/empire.py b/lib/common/empire.py index 08a07dc..758a5b7 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3394,7 +3394,10 @@ class ModuleMenu(cmd.Cmd): if module not in self.mainMenu.modules.modules: print helpers.color("[!] Error: invalid module") else: - module_menu = ModuleMenu(self.mainMenu, line, agent=self.module.options['Agent']['Value']) + _agent = '' + if 'Agent' in self.module.options: + _agent = self.module.options['Agent']['Value'] + module_menu = ModuleMenu(self.mainMenu, line, agent=_agent) module_menu.cmdloop() From 1474fa997583a699bcd000ab52990827ace59de2 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Sun, 15 Oct 2017 15:13:56 -0400 Subject: [PATCH 2/2] Added line strip of asterisks --- lib/common/empire.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common/empire.py b/lib/common/empire.py index 758a5b7..96be576 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3397,6 +3397,8 @@ class ModuleMenu(cmd.Cmd): _agent = '' if 'Agent' in self.module.options: _agent = self.module.options['Agent']['Value'] + + line = line.strip("*") module_menu = ModuleMenu(self.mainMenu, line, agent=_agent) module_menu.cmdloop()