diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index ee855e5d8..36d10f709 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -89,11 +89,18 @@ class PowerShellExploiter(HostExploiter): return [credentials for credentials in self._config.get_exploit_user_password_pairs()] def _authenticate(self, username: Optional[str], password: Optional[str]) -> Client: + ssl = password != "" + auth = "negotiate" if password != "" else "basic" + encryption = "auto" if password != "" else "never" + with Client( self.host.ip_addr, username=username, password=password, cert_validation=False, + ssl=ssl, + auth=auth, + encryption=encryption, ) as client: # attempt to execute dir command to know if authentication was successful client.execute_cmd("dir")