Agent: Use OperatingSystem.WINDOWS in Powershell

This commit is contained in:
Ilija Lazoroski 2022-06-24 11:18:39 +02:00
parent b605f16c4f
commit e1d5d25e9c
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import logging
from pathlib import Path, PurePath
from typing import List, Optional
from common import OperatingSystems
from infection_monkey.exploit.HostExploiter import HostExploiter
from infection_monkey.exploit.powershell_utils.auth_options import AuthOptions, get_auth_options
from infection_monkey.exploit.powershell_utils.credentials import (
@ -162,7 +163,7 @@ class PowerShellExploiter(HostExploiter):
temp_monkey_binary_filepath.unlink()
def _create_local_agent_file(self, binary_path):
agent_binary_bytes = self.agent_repository.get_agent_binary("windows")
agent_binary_bytes = self.agent_repository.get_agent_binary(OperatingSystems.WINDOWS)
with open(binary_path, "wb") as f:
f.write(agent_binary_bytes.getvalue())