From 17587802ff75d2a094077abf73aef698cb970fd1 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Thu, 23 Jul 2020 12:45:37 +0300 Subject: [PATCH] pywin32 is missing from the Monkey WMI package upgraded and required pywin32. because we have this package imported but not used in linux machines we downgraded --- monkey/common/utils/wmi_utils.py | 5 ++++- monkey/infection_monkey/requirements.txt | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/monkey/common/utils/wmi_utils.py b/monkey/common/utils/wmi_utils.py index 4df0e6886..22ccf112f 100644 --- a/monkey/common/utils/wmi_utils.py +++ b/monkey/common/utils/wmi_utils.py @@ -1,4 +1,7 @@ -import wmi +import sys + +if sys.platform.startswith("win"): + import wmi from .mongo_utils import MongoUtils diff --git a/monkey/infection_monkey/requirements.txt b/monkey/infection_monkey/requirements.txt index 374aef2fd..c9633b555 100644 --- a/monkey/infection_monkey/requirements.txt +++ b/monkey/infection_monkey/requirements.txt @@ -13,8 +13,4 @@ pyftpdlib==1.5.6 pymssql<3.0 pypykatz==0.3.12 requests>=2.24 -# Locking WMI since version 1.5 introduced breaking change on Linux agent compilation. -# See breaking change here: https://github.com/tjguk/wmi/commit/dcf8e3eca79bb8c0101ffb83e25c066b0ba9e16d -# Causes pip to error with: -# Could not find a version that satisfies the requirement pywin32 (from wmi->-r /src/infection_monkey/requirements.txt (line 12)) (from versions: none) -wmi==1.4.9 ; sys_platform == 'win32' +wmi==1.5.1 ; sys_platform == 'win32'