Closed
Description
Describe the bug
Windows package gathering fails on unpriviledged monkey:
2021-07-30 16:41:52,627 [39232:30808:INFO] windows_info_collector.get_installed_packages.51: Getting installed packages
2021-07-30 16:41:55,897 [39232:30808:ERROR] monkey.collect_system_info_if_configured.288: Exception encountered during system info collection: Command '['dism', '/online', '/get-packages']' returned non-zero exit status 740.
Traceback (most recent call last):
File "C:\Users\Vakaris\Desktop\infection_monkey\monkey\infection_monkey\monkey.py", line 285, in collect_system_info_if_configured
system_info = system_info_collector.get_info()
File "C:\Users\Vakaris\Desktop\infection_monkey\monkey\infection_monkey\system_info\__init__.py", line 46, in get_info
return self.collector.get_info()
File "C:\Users\Vakaris\Desktop\infection_monkey\monkey\infection_monkey\system_info\windows_info_collector.py", line 42, in get_info
self.get_installed_packages()
File "C:\Users\Vakaris\Desktop\infection_monkey\monkey\infection_monkey\system_info\windows_info_collector.py", line 53, in get_installed_packages
packages = subprocess.check_output(shlex.split("dism /online /get-packages"))
File "C:\Users\Vakaris\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "C:\Users\Vakaris\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['dism', '/online', '/get-packages']' returned non-zero exit status 740.
This results in system_info
telemetry not being sent.
To Reproduce
Steps to reproduce the behavior:
- Configure the Monkey to run system info collection
- Run monkey as unpriviledged user
- See error
Expected behavior
System info collection should expect monkey not always running as a privileged user. The package collection shouldn't kill system info collection, because that info is not even used in the reporting.
Screenshots
If applicable, add screenshots to help explain your problem.
Machine version (please complete the following information):
- OS: Windows
Tasks
- Remove functions (
get_installed_packages()
andget_wmi_info()
) and run tests. (0.25d)