From 9f6db06846cdae9b0dcd405a1395f9c3bfe3aefe Mon Sep 17 00:00:00 2001 From: mpgn Date: Sun, 12 Feb 2023 16:03:38 -0500 Subject: [PATCH] Change output filename for winrm --- cme/protocols/winrm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cme/protocols/winrm.py b/cme/protocols/winrm.py index 4bb739df..d6637710 100644 --- a/cme/protocols/winrm.py +++ b/cme/protocols/winrm.py @@ -93,8 +93,6 @@ class winrm(connection): self.server_os = smb_conn.getServerOS() self.logger.extra['hostname'] = self.hostname - self.output_filename = os.path.expanduser('~/.cme/logs/{}_{}_{}'.format(self.hostname, self.host, datetime.now().strftime("%Y-%m-%d_%H%M%S"))) - try: smb_conn.logoff() except: @@ -109,6 +107,9 @@ class winrm(connection): if self.args.local_auth: self.domain = self.hostname + self.output_filename = os.path.expanduser('~/.cme/logs/{}_{}_{}'.format(self.hostname, self.host, datetime.now().strftime("%Y-%m-%d_%H%M%S"))) + self.output_filename = self.output_filename.replace(":", "-") + def laps_search(self, username, password, ntlm_hash, domain): ldapco = LDAPConnect(self.domain, "389", self.domain) connection = ldapco.plaintext_login(domain, username[0] if username else '', password[0] if password else '', ntlm_hash[0] if ntlm_hash else '' )