From 1da79f78bf0466e244124b6190f4e4eda0063698 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 24 Aug 2021 15:32:51 -0400 Subject: [PATCH] Agent: Use format strings in powershell exploiter log statements --- monkey/infection_monkey/exploit/powershell.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index 0f5aa5175..05cf01b34 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -57,16 +57,16 @@ class PowerShellExploiter(HostExploiter): client = self._authenticate(username, password) LOG.info( - "Successfully logged into {self.host.ip_addr} using Powershell. User: " - "{username}" + f"Successfully logged into {self.host.ip_addr} using Powershell. User: " + f"{username}" ) self.report_login_attempt(True, username, password) return client except Exception as ex: # noqa: F841 LOG.debug( - "Error logging into {self.host.ip_addr} using Powershell. User: " - "{username}, Error: {ex}" + f"Error logging into {self.host.ip_addr} using Powershell. User: " + f"{username}, Error: {ex}" ) self.report_login_attempt(False, username, password)