From 98f8a5b48aa01bd94276c049a5db67ebff3af5a0 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 8 Mar 2022 15:15:37 -0500 Subject: [PATCH] Agent: Fix malformed WMI query in WMIExploiter --- monkey/infection_monkey/exploit/wmiexec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/wmiexec.py b/monkey/infection_monkey/exploit/wmiexec.py index cbf34d448..e98cfa62f 100644 --- a/monkey/infection_monkey/exploit/wmiexec.py +++ b/monkey/infection_monkey/exploit/wmiexec.py @@ -65,7 +65,7 @@ class WmiExploiter(HostExploiter): wmi_connection, "Win32_Process", fields=("Caption",), - where="Name='{0}'".format(self.options["dropper_target_path_win_64"]), + where=f"Name='{ntpath.split(self.options['dropper_target_path_win_64'])[-1]}'", ) if process_list: wmi_connection.close()