From ab8b4f04aa669e2363f669a542b71c9f9ccb3f8e Mon Sep 17 00:00:00 2001 From: Thorsten Sick Date: Mon, 21 Jun 2021 13:45:47 +0200 Subject: [PATCH] Adding install function to attack plugins --- app/experimentcontrol.py | 3 +++ plugins/base/attack.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/app/experimentcontrol.py b/app/experimentcontrol.py index 03cb5c6..7b05189 100644 --- a/app/experimentcontrol.py +++ b/app/experimentcontrol.py @@ -203,6 +203,7 @@ class Experiment(): plugin.set_attacker_machine(self.attacker_1) plugin.set_logger(self.attack_logger) plugin.set_caldera(self.caldera_control) + plugin.install() # plugin.__set_logger__(self.attack_logger) plugin.__execute__([target]) @@ -220,6 +221,8 @@ class Experiment(): self.attack_logger.vprint(a_file, 2) zfh.write(a_file) + zfh.write(os.path.join(self.lootdir, "attack.json")) + @staticmethod def __get_results_files(root): """ Yields a list of potential result files diff --git a/plugins/base/attack.py b/plugins/base/attack.py index ada0854..3510ef9 100644 --- a/plugins/base/attack.py +++ b/plugins/base/attack.py @@ -136,6 +136,12 @@ class AttackPlugin(BasePlugin): """ raise NotImplementedError + def install(self): + """ Install and setup requirements for the attack + """ + + return None + def __execute__(self, targets): """ Execute the plugin. This is called by the code