Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monkey breaks on German system language #1175

Closed
1 of 2 tasks
VakarisZ opened this issue May 17, 2021 · 3 comments · Fixed by #1403
Closed
1 of 2 tasks

Monkey breaks on German system language #1175

VakarisZ opened this issue May 17, 2021 · 3 comments · Fixed by #1403
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Complexity: Low Impact: Medium sp/2

Comments

@VakarisZ
Copy link
Contributor

VakarisZ commented May 17, 2021

Describe the bug

If the system language is German, running the monkey gives this error:

2021-05-17 08:28:57,836 [6184:6172:INFO] monkey.start.168: Trying to get OS fingerprint from VictimHost('192.168.99.21') with module PingScanner
2021-05-17 08:28:57,919 [6184:6172:ERROR] main.main.137: Exception thrown from monkey's start function. More info: not enough arguments for format string
Traceback (most recent call last):
  File "infection_monkey\monkey.py", line 170, in start
    finger.get_host_fingerprint(machine)
  File "infection_monkey\network\ping_scanner.py", line 56, in get_host_fingerprint
    output = " ".join(sub_proc.communicate())
  File "subprocess.py", line 964, in communicate
  File "subprocess.py", line 1317, in _communicate
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "infection_monkey\main.py", line 128, in main
    monkey.start()
  File "infection_monkey\monkey.py", line 172, in start
    LOG.error("Failed to run fingerprinter %s, exception %s" % finger.__class__.__name__,
TypeError: not enough arguments for format string
2021-05-17 08:28:58,079 [6184:6172:INFO] monkey.cleanup.275: Monkey cleanup started

To Reproduce

Steps to reproduce the behavior:

  1. Configure your environment to get similar response from ping command:
C:\Users\localadm>ping -n 1 -w 1000 192.168.99.21
 
Ping wird ausgeführt für 192.168.99.21 mit 32 Bytes Daten:
Antwort von 192.168.99.21: Bytes=32 Zeit<1ms TTL=128
 
Ping-Statistik für 192.168.99.21:
    Pakete: Gesendet = 1, Empfangen = 1, Verloren = 0
    (0% Verlust),
Ca. Zeitangaben in Millisek.:
    Minimum = 0ms, Maximum = 0ms, Mittelwert = 0ms
  1. Run the monkey
  2. See error

Expected behavior

We should document that we only support English system language and maybe consider supporting other languages in the future.

Machine version (please complete the following information):

  • OS: Windows

Tasks

@VakarisZ VakarisZ added Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Impact: High Complexity: Low labels May 17, 2021
@VakarisZ VakarisZ changed the title Monkey break on German system language Monkey breaks on German system language May 21, 2021
@TRGamer-tech
Copy link
Contributor

Just to be curious, how has it been going with this issue? :)

@VakarisZ
Copy link
Contributor Author

VakarisZ commented Jun 8, 2021

@TRGamer-tech thanks for checking in. We can't prioritize the different system language support right now, so we'll probably only add an entry in the documentation hub, stating, that monkey only supports English system language. If you wanna help and fix bugs occurring on foreign system languages ping me on slack, I'll help you get set up.

@TRGamer-tech
Copy link
Contributor

TRGamer-tech commented Aug 5, 2021

One solution I found for this problem was to add the correct encoding to the code, so the file ping-scanner.py looks like this:

image

Encoding = 'cp850'
sub_proc = subprocess.Popen(
	["ping", PING_COUNT_FLAG, "1", PING_TIMEOUT_FLAG, str(timeout), host.ip_addr],
	stdout=subprocess.PIPE,
	stderr=subprocess.PIPE,
	text=True,
	encoding=Encoding
)

And it works, even when I change it back to english.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Complexity: Low Impact: Medium sp/2
Projects
None yet
3 participants