From a8018a7956610263c91ceaa6fba764aa07614d86 Mon Sep 17 00:00:00 2001 From: vakaris_zilius Date: Wed, 9 Mar 2022 15:54:23 +0000 Subject: [PATCH] Agent: Add impacket_user decorator to the zerologon impacket_user decorator will awoid race conditions with other exploiters using wmi tools --- monkey/infection_monkey/exploit/zerologon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monkey/infection_monkey/exploit/zerologon.py b/monkey/infection_monkey/exploit/zerologon.py index 849e6935a..153b31bdd 100644 --- a/monkey/infection_monkey/exploit/zerologon.py +++ b/monkey/infection_monkey/exploit/zerologon.py @@ -18,6 +18,7 @@ from impacket.dcerpc.v5.dtypes import NULL from common.utils.exploit_enum import ExploitType from infection_monkey.credential_collectors import LMHash, NTHash, Username from infection_monkey.exploit.HostExploiter import HostExploiter +from infection_monkey.exploit.tools.wmi_tools import WmiTools from infection_monkey.exploit.zerologon_utils.dump_secrets import DumpSecrets from infection_monkey.exploit.zerologon_utils.options import OptionsForSecretsdump from infection_monkey.exploit.zerologon_utils.vuln_assessment import get_dc_details, is_exploitable @@ -47,6 +48,7 @@ class ZerologonExploiter(HostExploiter): def __del__(self): self._secrets_dir.cleanup() + @WmiTools.impacket_user def _exploit_host(self) -> ExploiterResultData: self.dc_ip, self.dc_name, self.dc_handle = get_dc_details(self.host)