Skip to content

Commit 10330b3

Browse files
committed
v0.1.7
added support for interactive tasking and better file tracking for tasks
1 parent ba76c57 commit 10330b3

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

mythic/graphql_queries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
)
2727
create_task = gql(
2828
"""
29-
mutation createTasking($callback_id: Int!, $command: String!, $params: String!, $token_id: Int, $tasking_location: String, $original_params: String, $parameter_group_name: String) {
30-
createTask(callback_id: $callback_id, command: $command, params: $params, token_id: $token_id, tasking_location: $tasking_location, original_params: $original_params, parameter_group_name: $parameter_group_name) {
29+
mutation createTasking($callback_id: Int!, $command: String!, $params: String!, $files: [String], $token_id: Int, $tasking_location: String, $original_params: String, $parameter_group_name: String, $is_interactive_task: Boolean, $interactive_task_type: Int, $parent_task_id: Int) {
30+
createTask(callback_id: $callback_id, command: $command, params: $params, files: $files, token_id: $token_id, tasking_location: $tasking_location, original_params: $original_params, parameter_group_name: $parameter_group_name, is_interactive_task: $is_interactive_task, interactive_task_type: $interactive_task_type, parent_task_id: $parent_task_id) {
3131
status
3232
id
3333
display_id

mythic/mythic.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,18 @@ async def issue_task(
576576
token_id: int = None,
577577
wait_for_complete: bool = False,
578578
custom_return_attributes: str = None,
579+
file_ids: [str] = None,
579580
timeout: int = None,
581+
is_interactive_task: bool = False,
582+
interactive_task_type: int = None,
583+
parent_task_id: int = None,
580584
) -> dict:
581585
"""
582586
Create a new task within Mythic for a specific callback.
583587
`return_on_status` indicates if this command should return immediately, mythic_classes.MythicStatus.Preprocessing, or wait for a certain status before returning.
584588
This can be helpful if you want ot make sure a task is completed before continuing
585589
If you have files that you need to upload and leverage as part of your tasking, use the `register_file` function to get back a file_id.
590+
Then supply those file ids in the `file_ids` array AND as their appropriate
586591
If you return immediately from this task, you'll get a dictionary with a status, error, and id field for your new task.
587592
If you return on another status, you can use your own custom attributes or use the defaults outlined in graphql_queries.task_fragment.
588593
"""
@@ -597,7 +602,11 @@ async def issue_task(
597602
"command": command_name,
598603
"params": parameter_string,
599604
"token_id": token_id,
605+
"is_interactive_task": is_interactive_task,
606+
"interactive_task_type": interactive_task_type,
607+
"parent_task_id": parent_task_id,
600608
"tasking_location": "command_line" if isinstance(parameters, str) else "scripting",
609+
"files": file_ids,
601610
},
602611
)
603612
if submission_status["createTask"]["status"] == "success":

mythic/mythic_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
self.http = "http://" if not ssl else "https://"
3636
self.ws = "ws://" if not ssl else "wss://"
3737
self.global_timeout = global_timeout if global_timeout is not None else -1
38-
self.scripting_version = "0.1.6"
38+
self.scripting_version = "0.1.7"
3939
self.current_operation_id = 0
4040
self.schema = schema
4141
self.log_level = log_level

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# This call to setup() does all the work
1212
setup(
1313
name="mythic",
14-
version="0.1.6",
14+
version="0.1.7",
1515
description="Interact with Mythic C2 Framework Instances",
1616
long_description=README,
1717
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)