guardicore / guardicore/monkey

Support different windows system languages

Open
#3,432 1 comment 0 reactions 0 assignees View on GitHub
Feature Reported by user
Dominant language
Python
Stars
7.1k
Forks
830
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
If the system language on windows is **not English** some CMD commands will fail. This happens due to the agent parsing the command line output as if it was English. Various other bugs will happen when trying to read non-english text, for example (monkey v2.2.0, French system language):
```
2023-06-16 16:21:08,127 [7516:MainThread:ERROR] main._run_agent.174: Exception thrown from monkey's start function. More info: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte
Traceback (most recent call last):
File "infection_monkey\main.py", line 172, in _run_agent
File "infection_monkey\monkey.py", line 295, in start
File "infection_monkey\monkey.py", line 334, in _setup
File "infection_monkey\network\firewall.py", line 60, in is_enabled
for line in out.decode().splitlines():
^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte
2023-06-16 16:21:08,128 [7516:MainThread:INFO] monkey.cleanup.503: Agent cleanup started
2023-06-16 16:21:08,223 [7516:MainThread:ERROR] monkey.cleanup.534: An error occurred while cleaning up the monkey agent: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte
Traceback (most recent call last):
File "infection_monkey\monkey.py", line 512, in cleanup
File "infection_monkey\network\firewall.py", line 60, in is_enabled
for line in out.decode().splitlines():
^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte
```

**Describe the solution you'd like**

Use more robust decoders and parse response values by position to support more different system languages for windows

**Describe alternatives you've considered**
- Agent checking system language to see if it's supported
- Keeping as is, just an entry in the readme that we don't support other system languages

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.