Scripting API Tokens

What does this hook into?

Scripting tasking involves the following RESTful endpoints on an instance of Mythic. This means you need to create a new Mythic instance (i.e. mythic = Mythic(username="blah" ... ) and then call these functions like mythic.get_payloads():
1
async def get_apitokens(self) -> MythicResponse:
2
"""
3
Gets all of the user's API tokens in a List
4
:return:
5
"""
6
7
async def create_apitoken(self, token_type="User") -> MythicResponse:
8
"""
9
Creates an API token for the user
10
:param token_type:
11
must be either "User" or "C2"
12
:return:
13
"""
14
15
async def remove_apitoken(self, apitoken: Union[APIToken, Dict]) -> MythicResponse:
16
"""
17
Removes the specified API token and invalidates it going forward
18
:param apitoken:
19
if using the APIToken class, the following must be set:
20
id
21
:return:
22
"""
Copied!
Last modified 1yr ago
Copy link