The Docs for the TypedArray Parse Function state that it gets called if the argument value is a list of strings or a list of tuples with the first element set to empty string.
This also matches the code:
|
if len(arg.value) > 0 and arg.value[0][0] == "": |
|
elif len(arg.value) > 0 and isinstance(arg.value[0], str): |
The function is then called with a list of strings:
However, if I set a list of strings in parse_arguments to a arg of type TypedArray the validator of it will fail:
|
if len(val) > 0 and (not isinstance(val[0], tuple) and not isinstance(val[0], list)): |
|
raise ValueError("Value isn't a list of tuples") |
I had to call the typedarray_parse_function directly from parse_arguments to make it work.
Also,
|
command=command_class.cmd, |
|
parameter_name=arg.name, |
|
payload_type="", |
|
callback=message_json["callback"]["id"], |
|
input_array=[x[1] for x in arg.value] |
and
|
command=command_class.cmd, |
|
parameter_name=arg.name, |
|
payload_type="", |
|
callback=message_json["callback"]["id"], |
|
input_array=arg.value |
only set 5 out of the 6 parameters of PTRPCTypedArrayParseFunctionMessage:
|
def __init__(self, |
|
command: str, |
|
parameter_name: str, |
|
payload_type: str, |
|
command_payload_type: str, |
|
callback: int, |
|
input_array: list[str]): |
The Docs for the TypedArray Parse Function state that it gets called if the argument value is a list of strings or a list of tuples with the first element set to empty string.
This also matches the code:
MythicContainerPyPi/mythic_container/agent_utils.py
Line 180 in 307da3a
MythicContainerPyPi/mythic_container/agent_utils.py
Line 193 in 307da3a
The function is then called with a list of strings:
MythicContainerPyPi/mythic_container/MythicCommandBase.py
Line 326 in 307da3a
However, if I set a list of strings in
parse_argumentsto a arg of typeTypedArraythe validator of it will fail:MythicContainerPyPi/mythic_container/MythicCommandBase.py
Lines 665 to 666 in 307da3a
I had to call the
typedarray_parse_functiondirectly fromparse_argumentsto make it work.Also,
MythicContainerPyPi/mythic_container/agent_utils.py
Lines 182 to 186 in 307da3a
and
MythicContainerPyPi/mythic_container/agent_utils.py
Lines 195 to 199 in 307da3a
only set 5 out of the 6 parameters of
PTRPCTypedArrayParseFunctionMessage:MythicContainerPyPi/mythic_container/MythicCommandBase.py
Lines 320 to 326 in 307da3a