From 1564f3a42b29e3272208396d05a9859eecf6a64c Mon Sep 17 00:00:00 2001 From: Thorsten Sick Date: Tue, 1 Jun 2021 15:01:32 +0200 Subject: [PATCH] Simpler access to machine data 2 --- app/experimentcontrol.py | 8 ++++---- machine_control.py | 4 ++-- plugins/default/kali/hydra/hydra_plugin.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/experimentcontrol.py b/app/experimentcontrol.py index 89710fe..5f7bf11 100644 --- a/app/experimentcontrol.py +++ b/app/experimentcontrol.py @@ -37,9 +37,9 @@ class Experiment(): self.attack_logger = AttackLog(verbosity) self.plugin_manager = PluginManager(self.attack_logger) self.__start_attacker() - caldera_url = "http://" + self.attacker_1.getip() + ":8888" + caldera_url = "http://" + self.attacker_1.get_ip() + ":8888" self.caldera_control = CalderaControl(caldera_url, attack_logger=self.attack_logger, config=self.experiment_config) - # self.caldera_control = CalderaControl("http://" + self.attacker_1.getip() + ":8888", self.attack_logger, + # self.caldera_control = CalderaControl("http://" + self.attacker_1.get_ip() + ":8888", self.attack_logger, # config=self.experiment_config) # Deleting all currently registered Caldera gents self.attack_logger.vprint(self.caldera_control.kill_all_agents(), 3) @@ -59,7 +59,7 @@ class Experiment(): self.attack_logger.vprint(f"{CommandlineColors.OKBLUE}preparing target {tname} ....{CommandlineColors.ENDC}", 1) target_1 = Machine(target_conf, attack_logger=self.attack_logger) - target_1.set_caldera_server(self.attacker_1.getip()) + target_1.set_caldera_server(self.attacker_1.get_ip()) try: if not target_conf.use_existing_machine(): target_1.destroy() @@ -159,7 +159,7 @@ class Experiment(): for attack in kali_attacks: # TODO: Work with snapshots self.attack_logger.vprint(f"Attacking machine with PAW: {target_1.get_paw()} with attack: {attack}", 1) - # self.attacker_1.kali_attack(attack, target_1.getip(), self.experiment_config) + # self.attacker_1.kali_attack(attack, target_1.get_ip(), self.experiment_config) self.attack(target_1, attack) self.attack_logger.vprint(f"Pausing before next attack (config: nap_time): {self.experiment_config.get_nap_time()}", 3) time.sleep(self.experiment_config.get_nap_time()) diff --git a/machine_control.py b/machine_control.py index d282315..b704edf 100644 --- a/machine_control.py +++ b/machine_control.py @@ -38,7 +38,7 @@ def create_machines(arguments): print("Attacker done") target_.destroy() - target_.set_caldera_server(attacker_1.getip()) + target_.set_caldera_server(attacker_1.get_ip()) target_.install_caldera_service() target_.create() print("Target up") @@ -46,7 +46,7 @@ def create_machines(arguments): target_.start_caldera_client() print("Target done") - print("Caldera server running at: http://{}:8888/".format(attacker_1.getip())) + print("Caldera server running at: http://{}:8888/".format(attacker_1.get_ip())) # target_.install_caldera_client(attacker_1.getip(), "target1elf") diff --git a/plugins/default/kali/hydra/hydra_plugin.py b/plugins/default/kali/hydra/hydra_plugin.py index 8256e36..5259bf6 100644 --- a/plugins/default/kali/hydra/hydra_plugin.py +++ b/plugins/default/kali/hydra/hydra_plugin.py @@ -33,7 +33,7 @@ class HydraPlugin(AttackPlugin): cmd += "sudo apt -y install hydra;" for t in targets: for p in self.conf['protocols']: - cmd += f"hydra -L {self.conf['userfile']} -P {self.conf['pwdfile']} {p}://{t.getip()};" + cmd += f"hydra -L {self.conf['userfile']} -P {self.conf['pwdfile']} {p}://{t.get_ip()};" res = self.attacker_run_cmd(cmd) or ""