create_go_tasking
function will finish completing like normal (it doesn’t wait for subtasks to finish).
When a task has outstanding subtasks, its status will change to “delegating” while it waits for them all to finish.
psexec
command actually involves a lot of moving pieces from making sure that you:
create_go_tasking
or even task callbacks (in the next section). We’re specifying the name of the command to run along with the parameters to issue (as a string). We can even specify a SubtaskCallbackFunction
to get called within our current task when the subtask finishes. It’s a way for the parent task to say “when this subtask is done, call this function so I can make more decisions based on what happened”. These callback functions look like this:Token=taskData.Task.TokenID
). Mythic doesn’t assume subtasks also need the token applied.shell
, that issues a subtask called run
and registers two completion handlers - one for when run
completes and another for when shell
completes. Notice how execution of shell
’s create tasking function continues even after it issues the subtask run
. That’s because this is all asynchronous - the result you get back from issuing a subtask is only an indicator of if Mythic successfully registered the task to not, not the final execution of the task.
completed_functions
attribute like:
key
is the same name of the function specified and the value
is the actual reference to the function to call.
create_tasking
function (or any other function - i.e. you can issue more sub-tasks from within task callback functions). Let’s look at what a callback function looks like:
formulate_output
function simply just displays a message to the user that the task is done. In more interesting examples though, you could use the get_responses
RPC call like we saw above to get information about all of the output subtasks have sent to the user for follow-on processing.