From a8905f0b500b4454fe0d5785b64b3d9793fadcd9 Mon Sep 17 00:00:00 2001 From: Vince Rose Date: Wed, 18 Sep 2024 22:51:35 -0700 Subject: [PATCH 1/4] add openapi docs --- docs/SUMMARY.md | 1 + docs/openapi.yaml | 8000 ++++++++++++++++++++++++++++++++++ docs/restful-api/openapi.md | 122 + empire.py | 4 + empire/arguments.py | 1 + empire/scripts/api_export.py | 28 + empire/server/config.yaml | 2 +- empire/server/server.py | 10 +- 8 files changed, 8164 insertions(+), 4 deletions(-) create mode 100644 docs/openapi.yaml create mode 100644 docs/restful-api/openapi.md create mode 100644 empire/scripts/api_export.py diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 060e2bbed..f43827bd4 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -9,6 +9,7 @@ * [Server](quickstart/configuration/server.md) * [Client](quickstart/configuration/client.md) * [RESTful API](restful-api/README.md) + * [OpenAPI Spec](restful-api/openapi-spec.md) * [Listeners](listeners/README.md) * [Dropbox](listeners/dropbox.md) * [OneDrive](listeners/onedrive.md) diff --git a/docs/openapi.yaml b/docs/openapi.yaml new file mode 100644 index 000000000..75a81dfd0 --- /dev/null +++ b/docs/openapi.yaml @@ -0,0 +1,8000 @@ +openapi: 3.1.0 +info: + title: FastAPI + version: 0.1.0 +paths: + /api/v2/listener-templates: + get: + tags: + - listener-templates + summary: Get Listener Templates + operationId: get_listener_templates_api_v2_listener_templates_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListenerTemplates' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/listener-templates/{uid}: + get: + tags: + - listener-templates + summary: Get Listener Template + operationId: get_listener_template_api_v2_listener_templates__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListenerTemplate' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/listeners/{uid}/tags: + post: + tags: + - listeners + summary: Add Tag + operationId: add_tag_api_v2_listeners__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/listeners/{uid}/tags/{tag_id}: + put: + tags: + - listeners + summary: Update Tag + operationId: update_tag_api_v2_listeners__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - listeners + summary: Delete Tag + operationId: delete_tag_api_v2_listeners__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/listeners/{uid}: + get: + tags: + - listeners + summary: Read Listener + operationId: read_listener_api_v2_listeners__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Listener' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - listeners + summary: Update Listener + operationId: update_listener_api_v2_listeners__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ListenerUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Listener' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - listeners + summary: Delete Listener + operationId: delete_listener_api_v2_listeners__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/listeners: + get: + tags: + - listeners + summary: Read Listeners + operationId: read_listeners_api_v2_listeners_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Listeners' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - listeners + summary: Create Listener + description: 'Note: options[''Name''] will be overwritten by name. When v1 api + is eventually removed, it wil no longer be needed. + + :param listener_req: + + :param db + + :return:' + operationId: create_listener_api_v2_listeners_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListenerPostRequest' + required: true + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Listener' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/stager-templates: + get: + tags: + - stager-templates + summary: Get Stager Templates + operationId: get_stager_templates_api_v2_stager_templates_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StagerTemplates' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/stager-templates/{uid}: + get: + tags: + - stager-templates + summary: Get Stager Template + operationId: get_stager_template_api_v2_stager_templates__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StagerTemplate' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/stagers: + get: + tags: + - stagers + summary: Read Stagers + operationId: read_stagers_api_v2_stagers_get + security: + - OAuth2PasswordBearer: [] + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Stagers' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + post: + tags: + - stagers + summary: Create Stager + operationId: create_stager_api_v2_stagers_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: save + in: query + required: false + schema: + type: boolean + default: true + title: Save + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StagerPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Stager' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/stagers/{uid}: + get: + tags: + - stagers + summary: Read Stager + operationId: read_stager_api_v2_stagers__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Stager' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - stagers + summary: Update Stager + operationId: update_stager_api_v2_stagers__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StagerUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Stager' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - stagers + summary: Delete Stager + operationId: delete_stager_api_v2_stagers__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/{uid}/tags: + post: + tags: + - agents + - tasks + summary: Add Tag + operationId: add_tag_api_v2_agents__agent_id__tasks__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}: + put: + tags: + - agents + - tasks + summary: Update Tag + operationId: update_tag_api_v2_agents__agent_id__tasks__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - agents + - tasks + summary: Delete Tag + operationId: delete_tag_api_v2_agents__agent_id__tasks__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/tasks: + get: + tags: + - agents + - tasks + summary: Read Tasks All Agents + operationId: read_tasks_all_agents_api_v2_agents_tasks_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: include_full_input + in: query + required: false + schema: + type: boolean + default: false + title: Include Full Input + - name: include_original_output + in: query + required: false + schema: + type: boolean + default: false + title: Include Original Output + - name: include_output + in: query + required: false + schema: + type: boolean + default: true + title: Include Output + - name: since + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Since + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/AgentTaskOrderOptions' + default: id + title: Order By + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + - name: status + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/AgentTaskStatus' + - type: 'null' + title: Status + - name: agents + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + title: Agents + - name: users + in: query + required: false + schema: + anyOf: + - type: array + items: + type: integer + - type: 'null' + title: Users + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTasks' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks: + get: + tags: + - agents + - tasks + summary: Read Tasks + operationId: read_tasks_api_v2_agents__agent_id__tasks_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: include_full_input + in: query + required: false + schema: + type: boolean + default: false + title: Include Full Input + - name: include_original_output + in: query + required: false + schema: + type: boolean + default: false + title: Include Original Output + - name: include_output + in: query + required: false + schema: + type: boolean + default: true + title: Include Output + - name: since + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Since + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/AgentTaskOrderOptions' + default: id + title: Order By + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + - name: status + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/AgentTaskStatus' + - type: 'null' + title: Status + - name: users + in: query + required: false + schema: + anyOf: + - type: array + items: + type: integer + - type: 'null' + title: Users + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTasks' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/{uid}: + get: + tags: + - agents + - tasks + summary: Read Task + operationId: read_task_api_v2_agents__agent_id__tasks__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - agents + - tasks + summary: Delete Task + operationId: delete_task_api_v2_agents__agent_id__tasks__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/jobs: + post: + tags: + - agents + - tasks + summary: Create Task Jobs + operationId: create_task_jobs_api_v2_agents__agent_id__tasks_jobs_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/kill_job: + post: + tags: + - agents + - tasks + summary: Create Task Kill Job + operationId: create_task_kill_job_api_v2_agents__agent_id__tasks_kill_job_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/KillJobPostRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/shell: + post: + tags: + - agents + - tasks + summary: Create Task Shell + description: 'Executes a command on the agent. If literal is true, it will ignore + the built-in aliases + + such a whoami or ps and execute the command directly.' + operationId: create_task_shell_api_v2_agents__agent_id__tasks_shell_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ShellPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/module: + post: + tags: + - agents + - tasks + summary: Create Task Module + operationId: create_task_module_api_v2_agents__agent_id__tasks_module_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModulePostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/upload: + post: + tags: + - agents + - tasks + summary: Create Task Upload + operationId: create_task_upload_api_v2_agents__agent_id__tasks_upload_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UploadPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/download: + post: + tags: + - agents + - tasks + summary: Create Task Download + operationId: create_task_download_api_v2_agents__agent_id__tasks_download_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DownloadPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/script_import: + post: + tags: + - agents + - tasks + summary: Create Task Script Import + operationId: create_task_script_import_api_v2_agents__agent_id__tasks_script_import_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_create_task_script_import_api_v2_agents__agent_id__tasks_script_import_post' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/script_command: + post: + tags: + - agents + - tasks + summary: Create Task Script Command + description: 'For python agents, this will run a script on the agent. + + For Powershell agents, script_import must be run first and then this will + run the script. + + + :param script_command_request: + + :param db_agent: + + :param db: + + :param current_user: + + :return:' + operationId: create_task_script_command_api_v2_agents__agent_id__tasks_script_command_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ScriptCommandPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/sysinfo: + post: + tags: + - agents + - tasks + summary: Create Task Sysinfo + operationId: create_task_sysinfo_api_v2_agents__agent_id__tasks_sysinfo_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SysinfoPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/update_comms: + post: + tags: + - agents + - tasks + summary: Create Task Update Comms + operationId: create_task_update_comms_api_v2_agents__agent_id__tasks_update_comms_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CommsPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/sleep: + post: + tags: + - agents + - tasks + summary: Create Task Update Sleep + operationId: create_task_update_sleep_api_v2_agents__agent_id__tasks_sleep_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SleepPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/kill_date: + post: + tags: + - agents + - tasks + summary: Create Task Update Kill Date + operationId: create_task_update_kill_date_api_v2_agents__agent_id__tasks_kill_date_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/KillDatePostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/working_hours: + post: + tags: + - agents + - tasks + summary: Create Task Update Working Hours + operationId: create_task_update_working_hours_api_v2_agents__agent_id__tasks_working_hours_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WorkingHoursPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/directory_list: + post: + tags: + - agents + - tasks + summary: Create Task Update Directory List + operationId: create_task_update_directory_list_api_v2_agents__agent_id__tasks_directory_list_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DirectoryListPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/proxy_list: + post: + tags: + - agents + - tasks + summary: Create Task Update Proxy List + operationId: create_task_update_proxy_list_api_v2_agents__agent_id__tasks_proxy_list_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyListPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/exit: + post: + tags: + - agents + - tasks + summary: Create Task Exit + operationId: create_task_exit_api_v2_agents__agent_id__tasks_exit_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExitPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/tasks/socks: + post: + tags: + - agents + - tasks + summary: Create Task Socks + operationId: create_task_socks_api_v2_agents__agent_id__tasks_socks_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SocksPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{uid}/tags: + post: + tags: + - agents + summary: Add Tag + operationId: add_tag_api_v2_agents__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{uid}/tags/{tag_id}: + put: + tags: + - agents + summary: Update Tag + operationId: update_tag_api_v2_agents__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - agents + summary: Delete Tag + operationId: delete_tag_api_v2_agents__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/checkins: + get: + tags: + - agents + summary: Read Agent Checkins All + operationId: read_agent_checkins_all_api_v2_agents_checkins_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agents + in: query + required: false + schema: + type: array + items: + type: string + title: Agents + - name: limit + in: query + required: false + schema: + type: integer + default: 1000 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: start_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Start Date + - name: end_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: End Date + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentCheckIns' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/checkins/aggregate: + get: + tags: + - agents + summary: Read Agent Checkins Aggregate + operationId: read_agent_checkins_aggregate_api_v2_agents_checkins_aggregate_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agents + in: query + required: false + schema: + type: array + items: + type: string + title: Agents + - name: start_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Start Date + - name: end_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: End Date + - name: bucket_size + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/AggregateBucket' + - type: 'null' + default: day + title: Bucket Size + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentCheckInsAggregate' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{uid}: + get: + tags: + - agents + summary: Read Agent + operationId: read_agent_api_v2_agents__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - agents + summary: Update Agent + operationId: update_agent_api_v2_agents__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents: + get: + tags: + - agents + summary: Read Agents + operationId: read_agents_api_v2_agents_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: include_archived + in: query + required: false + schema: + type: boolean + default: false + title: Include Archived + - name: include_stale + in: query + required: false + schema: + type: boolean + default: true + title: Include Stale + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Agents' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{uid}/checkins: + get: + tags: + - agents + summary: Read Agent Checkins + operationId: read_agent_checkins_api_v2_agents__uid__checkins_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: start_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Start Date + - name: end_date + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: End Date + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentCheckIns' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/files/root: + get: + tags: + - agents + summary: Read File Root + operationId: read_file_root_api_v2_agents__agent_id__files_root_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/agents/{agent_id}/files/{uid}: + get: + tags: + - agents + summary: Read File + operationId: read_file_api_v2_agents__agent_id__files__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentFile' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /token: + post: + tags: + - users + summary: Login For Access Token + operationId: login_for_access_token_token_post + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Body_login_for_access_token_token_post' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/users/me: + get: + tags: + - users + summary: Read User Me + operationId: read_user_me_api_v2_users_me_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/users: + get: + tags: + - users + summary: Read Users + operationId: read_users_api_v2_users_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Users' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - users + summary: Create User + operationId: create_user_api_v2_users_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserPostRequest' + required: true + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/users/{uid}: + get: + tags: + - users + summary: Read User + operationId: read_user_api_v2_users__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - users + summary: Update User + operationId: update_user_api_v2_users__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/users/{uid}/password: + put: + tags: + - users + summary: Update User Password + operationId: update_user_password_api_v2_users__uid__password_put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdatePasswordRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/users/{uid}/avatar: + post: + tags: + - users + summary: Create Avatar + operationId: create_avatar_api_v2_users__uid__avatar_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_create_avatar_api_v2_users__uid__avatar_post' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/modules: + get: + tags: + - modules + summary: Read Modules + operationId: read_modules_api_v2_modules_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/modules/{uid}: + get: + tags: + - modules + summary: Read Module + operationId: read_module_api_v2_modules__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - modules + summary: Update Module + operationId: update_module_api_v2_modules__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModuleUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Module' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/modules/{uid}/script: + get: + tags: + - modules + summary: Read Module Script + operationId: read_module_script_api_v2_modules__uid__script_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ModuleScript' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/modules/bulk/enable: + put: + tags: + - modules + summary: Update Bulk Enable + operationId: update_bulk_enable_api_v2_modules_bulk_enable_put + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ModuleBulkUpdateRequest' + required: true + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/modules/reload: + post: + tags: + - modules + summary: Reload Modules + operationId: reload_modules_api_v2_modules_reload_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/modules/reset: + post: + tags: + - modules + summary: Reset Modules + operationId: reset_modules_api_v2_modules_reset_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/bypasses/{uid}: + get: + tags: + - bypasses + summary: Read Bypass + operationId: read_bypass_api_v2_bypasses__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Bypass' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - bypasses + summary: Update Bypass + operationId: update_bypass_api_v2_bypasses__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BypassUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Bypass' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - bypasses + summary: Delete Bypass + operationId: delete_bypass_api_v2_bypasses__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/bypasses: + get: + tags: + - bypasses + summary: Read Bypasses + operationId: read_bypasses_api_v2_bypasses_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Bypasses' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - bypasses + summary: Create Bypass + operationId: create_bypass_api_v2_bypasses_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BypassPostRequest' + required: true + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Bypass' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/bypasses/reset: + post: + tags: + - bypasses + summary: Reset Bypasses + operationId: reset_bypasses_api_v2_bypasses_reset_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/bypasses/reload: + post: + tags: + - bypasses + summary: Reload Bypasses + operationId: reload_bypasses_api_v2_bypasses_reload_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/obfuscation/keywords/{uid}: + get: + tags: + - keywords + summary: Read Keyword + operationId: read_keyword_api_v2_obfuscation_keywords__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Keyword' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - keywords + summary: Update Keyword + operationId: update_keyword_api_v2_obfuscation_keywords__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/KeywordUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Keyword' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - keywords + summary: Delete Keyword + operationId: delete_keyword_api_v2_obfuscation_keywords__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/obfuscation/keywords: + get: + tags: + - keywords + summary: Read Keywords + operationId: read_keywords_api_v2_obfuscation_keywords_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Keywords' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - keywords + summary: Create Keyword + operationId: create_keyword_api_v2_obfuscation_keywords_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KeywordPostRequest' + required: true + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Keyword' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/obfuscation/global: + get: + tags: + - keywords + summary: Read Obfuscation Configs + operationId: read_obfuscation_configs_api_v2_obfuscation_global_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ObfuscationConfigs' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/obfuscation/global/{language}: + get: + tags: + - keywords + summary: Read Obfuscation Config + operationId: read_obfuscation_config_api_v2_obfuscation_global__language__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: language + in: path + required: true + schema: + type: string + title: Language + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ObfuscationConfig' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - keywords + summary: Update Obfuscation Config + operationId: update_obfuscation_config_api_v2_obfuscation_global__language__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: language + in: path + required: true + schema: + type: string + title: Language + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ObfuscationConfigUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ObfuscationConfig' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/obfuscation/global/{language}/preobfuscate: + post: + tags: + - keywords + summary: Preobfuscate Modules + operationId: preobfuscate_modules_api_v2_obfuscation_global__language__preobfuscate_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: language + in: path + required: true + schema: + type: string + title: Language + - name: reobfuscate + in: query + required: false + schema: + type: boolean + default: false + title: Reobfuscate + responses: + '202': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - keywords + summary: Remove Preobfuscated Modules + operationId: remove_preobfuscated_modules_api_v2_obfuscation_global__language__preobfuscate_delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: language + in: path + required: true + schema: + type: string + title: Language + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/hosts/{host_id}/processes/{uid}: + get: + tags: + - hosts + summary: Read Process + operationId: read_process_api_v2_hosts__host_id__processes__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: host_id + in: path + required: true + schema: + type: integer + title: Host Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Process' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/hosts/{host_id}/processes: + get: + tags: + - hosts + summary: Read Processes + operationId: read_processes_api_v2_hosts__host_id__processes_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: host_id + in: path + required: true + schema: + type: integer + title: Host Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Processes' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/malleable-profiles/{uid}: + get: + tags: + - malleable-profiles + summary: Read Profile + operationId: read_profile_api_v2_malleable_profiles__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - malleable-profiles + summary: Update Profile + operationId: update_profile_api_v2_malleable_profiles__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - malleable-profiles + summary: Delete Profile + operationId: delete_profile_api_v2_malleable_profiles__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/malleable-profiles: + get: + tags: + - malleable-profiles + summary: Read Profiles + operationId: read_profiles_api_v2_malleable_profiles_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Profiles' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + post: + tags: + - malleable-profiles + summary: Create Profile + operationId: create_profile_api_v2_malleable_profiles_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfilePostRequest' + required: true + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - OAuth2PasswordBearer: [] + /api/v2/malleable-profiles/reload: + post: + tags: + - malleable-profiles + summary: Reload Profiles + operationId: reload_profiles_api_v2_malleable_profiles_reload_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/malleable-profiles/reset: + post: + tags: + - malleable-profiles + summary: Reset Profiles + operationId: reset_profiles_api_v2_malleable_profiles_reset_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/credentials/{uid}/tags: + post: + tags: + - credentials + summary: Add Tag + operationId: add_tag_api_v2_credentials__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/credentials/{uid}/tags/{tag_id}: + put: + tags: + - credentials + summary: Update Tag + operationId: update_tag_api_v2_credentials__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - credentials + summary: Delete Tag + operationId: delete_tag_api_v2_credentials__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/credentials/{uid}: + get: + tags: + - credentials + summary: Read Credential + operationId: read_credential_api_v2_credentials__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - credentials + summary: Update Credential + operationId: update_credential_api_v2_credentials__uid__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - credentials + summary: Delete Credential + operationId: delete_credential_api_v2_credentials__uid__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/credentials: + get: + tags: + - credentials + summary: Read Credentials + operationId: read_credentials_api_v2_credentials_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: search + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Search + - name: credtype + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Credtype + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Credentials' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + post: + tags: + - credentials + summary: Create Credential + operationId: create_credential_api_v2_credentials_post + security: + - OAuth2PasswordBearer: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CredentialPostRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/hosts/{uid}: + get: + tags: + - hosts + summary: Read Host + operationId: read_host_api_v2_hosts__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Host' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/hosts: + get: + tags: + - hosts + summary: Read Hosts + operationId: read_hosts_api_v2_hosts_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Hosts' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/downloads/{uid}/download: + get: + tags: + - downloads + summary: Download Download + operationId: download_download_api_v2_downloads__uid__download_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/downloads/{uid}/tags: + post: + tags: + - downloads + summary: Add Tag + operationId: add_tag_api_v2_downloads__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/downloads/{uid}/tags/{tag_id}: + put: + tags: + - downloads + summary: Update Tag + operationId: update_tag_api_v2_downloads__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - downloads + summary: Delete Tag + operationId: delete_tag_api_v2_downloads__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/downloads/{uid}: + get: + tags: + - downloads + summary: Read Download + operationId: read_download_api_v2_downloads__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Download' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/downloads: + get: + tags: + - downloads + summary: Read Downloads + operationId: read_downloads_api_v2_downloads_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/DownloadOrderOptions' + default: updated_at + title: Order By + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + - name: sources + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: '#/components/schemas/DownloadSourceFilter' + - type: 'null' + title: Sources + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Downloads' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + post: + tags: + - downloads + summary: Create Download + operationId: create_download_api_v2_downloads_post + security: + - OAuth2PasswordBearer: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_create_download_api_v2_downloads_post' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Download' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/meta/version: + get: + tags: + - meta + summary: Read Empire Version + operationId: read_empire_version_api_v2_meta_version_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/EmpireVersion' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/plugins/{plugin_id}/tasks/{uid}/tags: + post: + tags: + - plugins + - tasks + summary: Add Tag + operationId: add_tag_api_v2_plugins__plugin_id__tasks__uid__tags_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: plugin_id + in: path + required: true + schema: + type: string + title: Plugin Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}: + put: + tags: + - plugins + - tasks + summary: Update Tag + operationId: update_tag_api_v2_plugins__plugin_id__tasks__uid__tags__tag_id__put + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: plugin_id + in: path + required: true + schema: + type: string + title: Plugin Id + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - plugins + - tasks + summary: Delete Tag + operationId: delete_tag_api_v2_plugins__plugin_id__tasks__uid__tags__tag_id__delete + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: tag_id + in: path + required: true + schema: + type: integer + title: Tag Id + - name: plugin_id + in: path + required: true + schema: + type: string + title: Plugin Id + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/tasks: + get: + tags: + - plugins + - tasks + summary: Read Tasks All Plugins + operationId: read_tasks_all_plugins_api_v2_plugins_tasks_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: include_full_input + in: query + required: false + schema: + type: boolean + default: false + title: Include Full Input + - name: include_output + in: query + required: false + schema: + type: boolean + default: true + title: Include Output + - name: since + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Since + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/PluginTaskOrderOptions' + default: id + title: Order By + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + - name: status + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/PluginTaskStatus' + - type: 'null' + title: Status + - name: plugins + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + title: Plugins + - name: users + in: query + required: false + schema: + anyOf: + - type: array + items: + type: integer + - type: 'null' + title: Users + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PluginTasks' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/{plugin_id}/tasks: + get: + tags: + - plugins + - tasks + summary: Read Tasks + operationId: read_tasks_api_v2_plugins__plugin_id__tasks_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: plugin_id + in: path + required: true + schema: + type: string + title: Plugin Id + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: include_full_input + in: query + required: false + schema: + type: boolean + default: false + title: Include Full Input + - name: include_output + in: query + required: false + schema: + type: boolean + default: true + title: Include Output + - name: since + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Since + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/PluginTaskOrderOptions' + default: id + title: Order By + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: desc + title: Order Direction + - name: status + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/PluginTaskStatus' + - type: 'null' + title: Status + - name: users + in: query + required: false + schema: + anyOf: + - type: array + items: + type: integer + - type: 'null' + title: Users + - name: tags + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + pattern: ^[^:]+:[^:]+$ + - type: 'null' + title: Tags + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PluginTasks' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/{plugin_id}/tasks/{uid}: + get: + tags: + - plugins + - tasks + summary: Read Task + operationId: read_task_api_v2_plugins__plugin_id__tasks__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: integer + title: Uid + - name: plugin_id + in: path + required: true + schema: + type: string + title: Plugin Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PluginTask' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins: + get: + tags: + - plugins + summary: Read Plugins + operationId: read_plugins_api_v2_plugins_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Plugins' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/plugins/{uid}: + get: + tags: + - plugins + summary: Read Plugin + operationId: read_plugin_api_v2_plugins__uid__get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/{uid}/execute: + post: + tags: + - plugins + summary: Execute Plugin + operationId: execute_plugin_api_v2_plugins__uid__execute_post + security: + - OAuth2PasswordBearer: [] + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PluginExecutePostRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PluginExecuteResponse' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /api/v2/plugins/reload: + post: + tags: + - plugins + summary: Reload Plugins + operationId: reload_plugins_api_v2_plugins_reload_post + responses: + '204': + description: Successful Response + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + security: + - OAuth2PasswordBearer: [] + /api/v2/tags: + get: + tags: + - tags + summary: Get Tags + operationId: get_tags_api_v2_tags_get + security: + - OAuth2PasswordBearer: [] + parameters: + - name: limit + in: query + required: false + schema: + type: integer + default: -1 + title: Limit + - name: page + in: query + required: false + schema: + type: integer + default: 1 + title: Page + - name: order_direction + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + default: asc + title: Order Direction + - name: order_by + in: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/TagOrderOptions' + default: updated_at + title: Order By + - name: query + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Query + - name: sources + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: '#/components/schemas/TagSourceFilter' + - type: 'null' + title: Sources + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' +components: + schemas: + Agent: + properties: + session_id: + type: string + title: Session Id + name: + type: string + title: Name + listener: + type: string + title: Listener + host_id: + anyOf: + - type: integer + - type: 'null' + title: Host Id + hostname: + anyOf: + - type: string + - type: 'null' + title: Hostname + language: + anyOf: + - type: string + - type: 'null' + title: Language + language_version: + anyOf: + - type: string + - type: 'null' + title: Language Version + delay: + type: integer + title: Delay + jitter: + type: number + title: Jitter + external_ip: + anyOf: + - type: string + - type: 'null' + title: External Ip + internal_ip: + anyOf: + - type: string + - type: 'null' + title: Internal Ip + username: + anyOf: + - type: string + - type: 'null' + title: Username + high_integrity: + anyOf: + - type: boolean + - type: 'null' + title: High Integrity + process_id: + anyOf: + - type: integer + - type: 'null' + title: Process Id + process_name: + anyOf: + - type: string + - type: 'null' + title: Process Name + os_details: + anyOf: + - type: string + - type: 'null' + title: Os Details + nonce: + type: string + title: Nonce + checkin_time: + type: string + format: date-time + title: Checkin Time + lastseen_time: + type: string + format: date-time + title: Lastseen Time + parent: + anyOf: + - type: string + - type: 'null' + title: Parent + children: + anyOf: + - type: string + - type: 'null' + title: Children + servers: + anyOf: + - type: string + - type: 'null' + title: Servers + profile: + anyOf: + - type: string + - type: 'null' + title: Profile + functions: + anyOf: + - type: string + - type: 'null' + title: Functions + kill_date: + anyOf: + - type: string + - type: 'null' + title: Kill Date + working_hours: + anyOf: + - type: string + - type: 'null' + title: Working Hours + lost_limit: + type: integer + title: Lost Limit + notes: + anyOf: + - type: string + - type: 'null' + title: Notes + architecture: + anyOf: + - type: string + - type: 'null' + title: Architecture + archived: + type: boolean + title: Archived + stale: + type: boolean + title: Stale + proxies: + anyOf: + - type: object + - type: 'null' + title: Proxies + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - session_id + - name + - listener + - delay + - jitter + - nonce + - checkin_time + - lastseen_time + - lost_limit + - archived + - stale + - tags + title: Agent + AgentCheckIn: + properties: + agent_id: + type: string + title: Agent Id + checkin_time: + type: string + format: date-time + title: Checkin Time + type: object + required: + - agent_id + - checkin_time + title: AgentCheckIn + AgentCheckInAggregate: + properties: + count: + type: integer + title: Count + checkin_time: + type: string + format: date-time + title: Checkin Time + type: object + required: + - count + - checkin_time + title: AgentCheckInAggregate + AgentCheckIns: + properties: + records: + items: + $ref: '#/components/schemas/AgentCheckIn' + type: array + title: Records + limit: + type: integer + title: Limit + page: + type: integer + title: Page + total_pages: + type: integer + title: Total Pages + total: + type: integer + title: Total + type: object + required: + - records + - limit + - page + - total_pages + - total + title: AgentCheckIns + AgentCheckInsAggregate: + properties: + records: + items: + $ref: '#/components/schemas/AgentCheckInAggregate' + type: array + title: Records + start_date: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Start Date + end_date: + anyOf: + - type: string + format: date-time + - type: 'null' + title: End Date + bucket_size: + type: string + title: Bucket Size + type: object + required: + - records + - bucket_size + title: AgentCheckInsAggregate + AgentFile: + properties: + id: + type: integer + title: Id + session_id: + type: string + title: Session Id + name: + type: string + title: Name + path: + type: string + title: Path + is_file: + type: boolean + title: Is File + parent_id: + anyOf: + - type: integer + - type: 'null' + title: Parent Id + downloads: + items: + $ref: '#/components/schemas/DownloadDescription' + type: array + title: Downloads + children: + items: + $ref: '#/components/schemas/AgentFile' + type: array + title: Children + default: [] + type: object + required: + - id + - session_id + - name + - path + - is_file + - downloads + title: AgentFile + AgentTask: + properties: + id: + type: integer + title: Id + input: + type: string + title: Input + full_input: + anyOf: + - type: string + - type: 'null' + title: Full Input + output: + anyOf: + - type: string + - type: 'null' + title: Output + original_output: + anyOf: + - type: string + - type: 'null' + title: Original Output + user_id: + anyOf: + - type: integer + - type: 'null' + title: User Id + username: + anyOf: + - type: string + - type: 'null' + title: Username + agent_id: + type: string + title: Agent Id + downloads: + items: + $ref: '#/components/schemas/DownloadDescription' + type: array + title: Downloads + module_name: + anyOf: + - type: string + - type: 'null' + title: Module Name + task_name: + anyOf: + - type: string + - type: 'null' + title: Task Name + status: + $ref: '#/components/schemas/AgentTaskStatus' + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - id + - input + - agent_id + - downloads + - status + - created_at + - updated_at + - tags + title: AgentTask + AgentTaskOrderOptions: + type: string + enum: + - id + - updated_at + - status + - agent + title: AgentTaskOrderOptions + AgentTaskStatus: + type: string + enum: + - queued + - pulled + - completed + - error + - continuous + title: AgentTaskStatus + AgentTasks: + properties: + records: + items: + $ref: '#/components/schemas/AgentTask' + type: array + title: Records + limit: + type: integer + title: Limit + page: + type: integer + title: Page + total_pages: + type: integer + title: Total Pages + total: + type: integer + title: Total + type: object + required: + - records + - limit + - page + - total_pages + - total + title: AgentTasks + AgentUpdateRequest: + properties: + name: + type: string + title: Name + notes: + anyOf: + - type: string + - type: 'null' + title: Notes + type: object + required: + - name + title: AgentUpdateRequest + Agents: + properties: + records: + items: + $ref: '#/components/schemas/Agent' + type: array + title: Records + type: object + required: + - records + title: Agents + AggregateBucket: + type: string + enum: + - second + - minute + - hour + - day + title: AggregateBucket + Author: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + handle: + anyOf: + - type: string + - type: 'null' + title: Handle + link: + anyOf: + - type: string + - type: 'null' + title: Link + type: object + title: Author + BadRequestResponse: + properties: + detail: + type: string + title: Detail + type: object + required: + - detail + title: BadRequestResponse + Body_create_avatar_api_v2_users__uid__avatar_post: + properties: + file: + type: string + format: binary + title: File + type: object + required: + - file + title: Body_create_avatar_api_v2_users__uid__avatar_post + Body_create_download_api_v2_downloads_post: + properties: + file: + type: string + format: binary + title: File + type: object + required: + - file + title: Body_create_download_api_v2_downloads_post + Body_create_task_script_import_api_v2_agents__agent_id__tasks_script_import_post: + properties: + file: + type: string + format: binary + title: File + type: object + required: + - file + title: Body_create_task_script_import_api_v2_agents__agent_id__tasks_script_import_post + Body_login_for_access_token_token_post: + properties: + grant_type: + anyOf: + - type: string + pattern: password + - type: 'null' + title: Grant Type + username: + type: string + title: Username + password: + type: string + title: Password + scope: + type: string + title: Scope + default: '' + client_id: + anyOf: + - type: string + - type: 'null' + title: Client Id + client_secret: + anyOf: + - type: string + - type: 'null' + title: Client Secret + type: object + required: + - username + - password + title: Body_login_for_access_token_token_post + Bypass: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + authors: + items: + $ref: '#/components/schemas/Author' + type: array + title: Authors + language: + type: string + title: Language + code: + type: string + title: Code + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + type: object + required: + - id + - name + - authors + - language + - code + - created_at + - updated_at + title: Bypass + BypassPostRequest: + properties: + name: + type: string + title: Name + language: + type: string + title: Language + code: + type: string + title: Code + type: object + required: + - name + - language + - code + title: BypassPostRequest + BypassUpdateRequest: + properties: + name: + type: string + title: Name + language: + type: string + title: Language + code: + type: string + title: Code + type: object + required: + - name + - language + - code + title: BypassUpdateRequest + Bypasses: + properties: + records: + items: + $ref: '#/components/schemas/Bypass' + type: array + title: Records + type: object + required: + - records + title: Bypasses + CommsPostRequest: + properties: + new_listener_id: + type: integer + title: New Listener Id + type: object + required: + - new_listener_id + title: CommsPostRequest + Credential: + properties: + id: + type: integer + title: Id + credtype: + type: string + title: Credtype + domain: + type: string + title: Domain + username: + type: string + title: Username + password: + type: string + title: Password + host: + type: string + title: Host + os: + anyOf: + - type: string + - type: 'null' + title: Os + sid: + anyOf: + - type: string + - type: 'null' + title: Sid + notes: + anyOf: + - type: string + - type: 'null' + title: Notes + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - id + - credtype + - domain + - username + - password + - host + - created_at + - updated_at + - tags + title: Credential + CredentialPostRequest: + properties: + credtype: + type: string + title: Credtype + domain: + type: string + title: Domain + username: + type: string + title: Username + password: + type: string + title: Password + host: + type: string + title: Host + os: + anyOf: + - type: string + - type: 'null' + title: Os + sid: + anyOf: + - type: string + - type: 'null' + title: Sid + notes: + anyOf: + - type: string + - type: 'null' + title: Notes + type: object + required: + - credtype + - domain + - username + - password + - host + title: CredentialPostRequest + CredentialUpdateRequest: + properties: + credtype: + type: string + title: Credtype + domain: + type: string + title: Domain + username: + type: string + title: Username + password: + type: string + title: Password + host: + type: string + title: Host + os: + anyOf: + - type: string + - type: 'null' + title: Os + sid: + anyOf: + - type: string + - type: 'null' + title: Sid + notes: + anyOf: + - type: string + - type: 'null' + title: Notes + type: object + required: + - credtype + - domain + - username + - password + - host + title: CredentialUpdateRequest + Credentials: + properties: + records: + items: + $ref: '#/components/schemas/Credential' + type: array + title: Records + type: object + required: + - records + title: Credentials + CustomOptionSchema: + properties: + description: + type: string + title: Description + required: + type: boolean + title: Required + value: + type: string + title: Value + suggested_values: + items: + type: string + type: array + title: Suggested Values + strict: + type: boolean + title: Strict + value_type: + $ref: '#/components/schemas/ValueType' + type: object + required: + - description + - required + - value + - suggested_values + - strict + - value_type + title: CustomOptionSchema + DirectoryListPostRequest: + properties: + path: + type: string + title: Path + type: object + required: + - path + title: DirectoryListPostRequest + Download: + properties: + id: + type: integer + title: Id + location: + type: string + title: Location + filename: + type: string + title: Filename + size: + type: integer + title: Size + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - id + - location + - filename + - size + - created_at + - updated_at + - tags + title: Download + DownloadDescription: + properties: + id: + type: integer + title: Id + filename: + type: string + title: Filename + link: + type: string + title: Link + type: object + required: + - id + - filename + - link + title: DownloadDescription + DownloadOrderOptions: + type: string + enum: + - filename + - location + - size + - created_at + - updated_at + title: DownloadOrderOptions + DownloadPostRequest: + properties: + path_to_file: + type: string + title: Path To File + type: object + required: + - path_to_file + title: DownloadPostRequest + DownloadSourceFilter: + type: string + enum: + - upload + - stager + - agent_file + - agent_task + title: DownloadSourceFilter + Downloads: + properties: + records: + items: + $ref: '#/components/schemas/Download' + type: array + title: Records + limit: + type: integer + title: Limit + page: + type: integer + title: Page + total_pages: + type: integer + title: Total Pages + total: + type: integer + title: Total + type: object + required: + - records + - limit + - page + - total_pages + - total + title: Downloads + EmpireVersion: + properties: + version: + type: string + title: Version + type: object + required: + - version + title: EmpireVersion + ExitPostRequest: + properties: {} + type: object + title: ExitPostRequest + HTTPValidationError: + properties: + detail: + items: + $ref: '#/components/schemas/ValidationError' + type: array + title: Detail + type: object + title: HTTPValidationError + Host: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + internal_ip: + type: string + title: Internal Ip + type: object + required: + - id + - name + - internal_ip + title: Host + Hosts: + properties: + records: + items: + $ref: '#/components/schemas/Host' + type: array + title: Records + type: object + required: + - records + title: Hosts + Keyword: + properties: + id: + type: integer + title: Id + keyword: + type: string + title: Keyword + replacement: + type: string + title: Replacement + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + type: object + required: + - id + - keyword + - replacement + - created_at + - updated_at + title: Keyword + KeywordPostRequest: + properties: + keyword: + type: string + minLength: 3 + title: Keyword + replacement: + type: string + minLength: 3 + title: Replacement + type: object + required: + - keyword + - replacement + title: KeywordPostRequest + KeywordUpdateRequest: + properties: + keyword: + type: string + minLength: 3 + title: Keyword + replacement: + type: string + minLength: 3 + title: Replacement + type: object + required: + - keyword + - replacement + title: KeywordUpdateRequest + Keywords: + properties: + records: + items: + $ref: '#/components/schemas/Keyword' + type: array + title: Records + type: object + required: + - records + title: Keywords + KillDatePostRequest: + properties: + kill_date: + type: string + title: Kill Date + type: object + required: + - kill_date + title: KillDatePostRequest + KillJobPostRequest: + properties: + id: + type: integer + title: Id + type: object + required: + - id + title: KillJobPostRequest + LanguageEnum: + type: string + enum: + - python + - powershell + - csharp + - ironpython + - bof + title: LanguageEnum + Listener: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + enabled: + type: boolean + title: Enabled + template: + type: string + title: Template + options: + additionalProperties: + type: string + type: object + title: Options + created_at: + type: string + format: date-time + title: Created At + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - id + - name + - enabled + - template + - options + - created_at + - tags + title: Listener + ListenerPostRequest: + properties: + name: + type: string + title: Name + template: + type: string + title: Template + options: + additionalProperties: + type: string + type: object + title: Options + type: object + required: + - name + - template + - options + title: ListenerPostRequest + example: + name: MyListener + options: + BindIP: 0.0.0.0 + CertPath: '' + Cookie: '' + DefaultDelay: 5 + DefaultJitter: 0.0 + DefaultLostLimit: 60 + DefaultProfile: /admin/get.php,/news.php,/login/process.php|Mozilla/5.0 + (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko + Headers: Server:Microsoft-IIS/7.5 + Host: http://localhost:1336 + KillDate: '' + Launcher: 'powershell -noP -sta -w 1 -enc ' + Name: MyListener + Port: '1336' + Proxy: default + ProxyCreds: default + SlackURL: '' + StagerURI: '' + StagingKey: 2c103f2c4ed1e59c0b4e2e01821770fa + UserAgent: default + WorkingHours: '' + software: '' + tactics: + - '' + techniques: + - '' + template: http + ListenerTemplate: + properties: + id: + type: string + title: Id + name: + type: string + title: Name + authors: + items: + $ref: '#/components/schemas/Author' + type: array + title: Authors + description: + type: string + title: Description + category: + type: string + title: Category + comments: + items: + type: string + type: array + title: Comments + tactics: + items: + type: string + type: array + title: Tactics + techniques: + items: + type: string + type: array + title: Techniques + software: + anyOf: + - type: string + - type: 'null' + title: Software + options: + additionalProperties: + $ref: '#/components/schemas/CustomOptionSchema' + type: object + title: Options + type: object + required: + - id + - name + - authors + - description + - category + - comments + - tactics + - techniques + - options + title: ListenerTemplate + example: + authors: + - handle: '@harmj0y' + link: '' + name: '' + category: client_server + comments: [] + description: Starts a http[s] listener that uses a GET/POST approach. + id: http + name: HTTP[S] + options: + BindIP: + description: The IP to bind to on the control server. + required: true + strict: false + suggested_values: + - 0.0.0.0 + value: 0.0.0.0 + CertPath: + description: Certificate path for https listeners. + required: false + strict: false + suggested_values: [] + value: '' + Cookie: + description: Custom Cookie Name + required: false + strict: false + suggested_values: [] + value: xNQsvLdAysjkonT + DefaultDelay: + description: Agent delay/reach back interval (in seconds). + required: true + strict: false + suggested_values: [] + value: '5' + DefaultJitter: + description: Jitter in agent reachback interval (0.0-1.0). + required: true + strict: false + suggested_values: [] + value: '0.0' + DefaultLostLimit: + description: Number of missed checkins before exiting + required: true + strict: false + suggested_values: [] + value: '60' + DefaultProfile: + description: Default communication profile for the agent. + required: true + strict: false + suggested_values: [] + value: /admin/get.php,/news.php,/login/process.php|Mozilla/5.0 (Windows + NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko + Headers: + description: Headers for the control server. + required: true + strict: false + suggested_values: [] + value: Server:Microsoft-IIS/7.5 + Host: + description: Hostname/IP for staging. + required: true + strict: false + suggested_values: [] + value: http://192.168.0.20 + KillDate: + description: Date for the listener to exit (MM/dd/yyyy). + required: false + strict: false + suggested_values: [] + value: '' + Launcher: + description: Launcher string. + required: true + strict: false + suggested_values: [] + value: 'powershell -noP -sta -w 1 -enc ' + Name: + description: Name for the listener. + required: true + strict: false + suggested_values: [] + value: http + Port: + description: Port for the listener. + required: true + strict: false + suggested_values: + - '1335' + - '1336' + value: '' + Proxy: + description: Proxy to use for request (default, none, or other). + required: false + strict: false + suggested_values: [] + value: default + ProxyCreds: + description: Proxy credentials ([domain\]username:password) to use for + request (default, none, or other). + required: false + strict: false + suggested_values: [] + value: default + SlackURL: + description: Your Slack Incoming Webhook URL to communicate with your + Slack instance. + required: false + strict: false + suggested_values: [] + value: '' + StagerURI: + description: 'URI for the stager. Must use /download/. Example: /download/stager.php' + required: false + strict: false + suggested_values: [] + value: '' + StagingKey: + description: Staging key for initial agent negotiation. + required: true + strict: false + suggested_values: [] + value: '}q)jFnDKw&px/7QBhE9Y<6~[Z1>{+Ps@' + UserAgent: + description: User-agent string to use for the staging request (default, + none, or other). + required: false + strict: false + suggested_values: [] + value: default + WorkingHours: + description: Hours for the agent to operate (09:00-17:00). + required: false + strict: false + suggested_values: [] + value: '' + software: '' + tactics: [] + techniques: [] + ListenerTemplates: + properties: + records: + items: + $ref: '#/components/schemas/ListenerTemplate' + type: array + title: Records + type: object + required: + - records + title: ListenerTemplates + ListenerUpdateRequest: + properties: + name: + type: string + title: Name + enabled: + type: boolean + title: Enabled + options: + additionalProperties: + type: string + type: object + title: Options + type: object + required: + - name + - enabled + - options + title: ListenerUpdateRequest + Listeners: + properties: + records: + items: + $ref: '#/components/schemas/Listener' + type: array + title: Records + type: object + required: + - records + title: Listeners + Module: + properties: + id: + type: string + title: Id + name: + type: string + title: Name + enabled: + type: boolean + title: Enabled + authors: + items: + $ref: '#/components/schemas/Author' + type: array + title: Authors + description: + type: string + title: Description + background: + type: boolean + title: Background + language: + $ref: '#/components/schemas/LanguageEnum' + min_language_version: + anyOf: + - type: string + - type: 'null' + title: Min Language Version + needs_admin: + type: boolean + title: Needs Admin + opsec_safe: + type: boolean + title: Opsec Safe + techniques: + items: + type: string + type: array + title: Techniques + tactics: + items: + type: string + type: array + title: Tactics + software: + anyOf: + - type: string + - type: 'null' + title: Software + comments: + items: + type: string + type: array + title: Comments + options: + additionalProperties: + $ref: '#/components/schemas/CustomOptionSchema' + type: object + title: Options + type: object + required: + - id + - name + - enabled + - authors + - description + - background + - language + - needs_admin + - opsec_safe + - techniques + - tactics + - comments + - options + title: Module + ModuleBulkUpdateRequest: + properties: + modules: + items: + type: string + type: array + title: Modules + enabled: + type: boolean + title: Enabled + type: object + required: + - modules + - enabled + title: ModuleBulkUpdateRequest + ModulePostRequest: + properties: + module_id: + type: string + title: Module Id + ignore_language_version_check: + type: boolean + title: Ignore Language Version Check + default: false + ignore_admin_check: + type: boolean + title: Ignore Admin Check + default: false + options: + additionalProperties: + anyOf: + - type: string + - type: integer + - type: number + type: object + title: Options + modified_input: + anyOf: + - type: string + - type: 'null' + title: Modified Input + type: object + required: + - module_id + - options + title: ModulePostRequest + ModuleScript: + properties: + module_id: + type: string + title: Module Id + script: + type: string + title: Script + type: object + required: + - module_id + - script + title: ModuleScript + ModuleUpdateRequest: + properties: + enabled: + type: boolean + title: Enabled + type: object + required: + - enabled + title: ModuleUpdateRequest + NotFoundResponse: + properties: + detail: + type: string + title: Detail + type: object + required: + - detail + title: NotFoundResponse + ObfuscationConfig: + properties: + language: + type: string + title: Language + enabled: + type: boolean + title: Enabled + command: + type: string + title: Command + module: + type: string + title: Module + preobfuscatable: + type: boolean + title: Preobfuscatable + type: object + required: + - language + - enabled + - command + - module + - preobfuscatable + title: ObfuscationConfig + ObfuscationConfigUpdateRequest: + properties: + enabled: + type: boolean + title: Enabled + command: + type: string + title: Command + module: + type: string + title: Module + type: object + required: + - enabled + - command + - module + title: ObfuscationConfigUpdateRequest + ObfuscationConfigs: + properties: + records: + items: + $ref: '#/components/schemas/ObfuscationConfig' + type: array + title: Records + type: object + required: + - records + title: ObfuscationConfigs + OrderDirection: + type: string + enum: + - asc + - desc + title: OrderDirection + Plugin: + properties: + id: + type: string + title: Id + name: + type: string + title: Name + authors: + items: + $ref: '#/components/schemas/Author' + type: array + title: Authors + description: + type: string + title: Description + techniques: + items: + type: string + type: array + title: Techniques + default: [] + software: + anyOf: + - type: string + - type: 'null' + title: Software + comments: + items: + type: string + type: array + title: Comments + options: + additionalProperties: + $ref: '#/components/schemas/CustomOptionSchema' + type: object + title: Options + type: object + required: + - id + - name + - authors + - description + - comments + - options + title: Plugin + PluginExecutePostRequest: + properties: + options: + additionalProperties: + type: string + type: object + title: Options + type: object + required: + - options + title: PluginExecutePostRequest + PluginExecuteResponse: + properties: + detail: + type: string + title: Detail + default: '' + type: object + title: PluginExecuteResponse + PluginTask: + properties: + id: + type: integer + title: Id + input: + type: string + title: Input + full_input: + anyOf: + - type: string + - type: 'null' + title: Full Input + output: + anyOf: + - type: string + - type: 'null' + title: Output + user_id: + anyOf: + - type: integer + - type: 'null' + title: User Id + username: + anyOf: + - type: string + - type: 'null' + title: Username + plugin_id: + type: string + title: Plugin Id + downloads: + items: + $ref: '#/components/schemas/DownloadDescription' + type: array + title: Downloads + status: + anyOf: + - $ref: '#/components/schemas/PluginTaskStatus' + - type: 'null' + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + title: Tags + type: object + required: + - id + - input + - plugin_id + - downloads + - created_at + - updated_at + - tags + title: PluginTask + PluginTaskOrderOptions: + type: string + enum: + - id + - updated_at + - status + - plugin + title: PluginTaskOrderOptions + PluginTaskStatus: + type: string + enum: + - queued + - started + - completed + - error + - continuous + title: PluginTaskStatus + PluginTasks: + properties: + records: + items: + $ref: '#/components/schemas/PluginTask' + type: array + title: Records + limit: + type: integer + title: Limit + page: + type: integer + title: Page + total_pages: + type: integer + title: Total Pages + total: + type: integer + title: Total + type: object + required: + - records + - limit + - page + - total_pages + - total + title: PluginTasks + Plugins: + properties: + records: + items: + $ref: '#/components/schemas/Plugin' + type: array + title: Records + type: object + required: + - records + title: Plugins + Process: + properties: + process_id: + type: integer + title: Process Id + process_name: + type: string + title: Process Name + host_id: + type: integer + title: Host Id + architecture: + anyOf: + - type: string + - type: 'null' + title: Architecture + user: + anyOf: + - type: string + - type: 'null' + title: User + stale: + type: boolean + title: Stale + agent_id: + anyOf: + - type: string + - type: 'null' + title: Agent Id + type: object + required: + - process_id + - process_name + - host_id + - stale + title: Process + Processes: + properties: + records: + items: + $ref: '#/components/schemas/Process' + type: array + title: Records + type: object + required: + - records + title: Processes + Profile: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + file_path: + anyOf: + - type: string + - type: 'null' + title: File Path + category: + type: string + title: Category + data: + type: string + title: Data + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + type: object + required: + - id + - name + - category + - data + - created_at + - updated_at + title: Profile + ProfilePostRequest: + properties: + name: + type: string + title: Name + category: + type: string + title: Category + data: + type: string + title: Data + type: object + required: + - name + - category + - data + title: ProfilePostRequest + ProfileUpdateRequest: + properties: + data: + type: string + title: Data + type: object + required: + - data + title: ProfileUpdateRequest + Profiles: + properties: + records: + items: + $ref: '#/components/schemas/Profile' + type: array + title: Records + type: object + required: + - records + title: Profiles + ProxyEnum: + type: string + enum: + - SOCKS4 + - SOCKS5 + - HTTP + - SSL + - SSL_WEAK + - SSL_ANON + - TOR + - HTTPS + - HTTP_CONNECT + - HTTPS_CONNECT + title: ProxyEnum + ProxyItem: + properties: + proxy_type: + $ref: '#/components/schemas/ProxyEnum' + host: + type: string + title: Host + port: + type: integer + title: Port + type: object + required: + - proxy_type + - host + - port + title: ProxyItem + ProxyListPostRequest: + properties: + proxies: + items: + $ref: '#/components/schemas/ProxyItem' + type: array + title: Proxies + type: object + required: + - proxies + title: ProxyListPostRequest + ScriptCommandPostRequest: + properties: + command: + type: string + title: Command + type: object + required: + - command + title: ScriptCommandPostRequest + ShellPostRequest: + properties: + command: + type: string + title: Command + literal: + type: boolean + title: Literal + default: false + type: object + required: + - command + title: ShellPostRequest + SleepPostRequest: + properties: + delay: + type: integer + minimum: 0.0 + title: Delay + jitter: + type: number + maximum: 1.0 + minimum: 0.0 + title: Jitter + type: object + required: + - delay + - jitter + title: SleepPostRequest + SocksPostRequest: + properties: + port: + type: integer + title: Port + type: object + required: + - port + title: SocksPostRequest + Stager: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + template: + type: string + title: Template + one_liner: + type: boolean + title: One Liner + downloads: + items: + $ref: '#/components/schemas/DownloadDescription' + type: array + title: Downloads + options: + additionalProperties: + type: string + type: object + title: Options + user_id: + type: integer + title: User Id + created_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Created At + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Updated At + type: object + required: + - id + - name + - template + - one_liner + - downloads + - options + - user_id + title: Stager + StagerPostRequest: + properties: + name: + type: string + title: Name + template: + type: string + title: Template + options: + additionalProperties: + type: string + type: object + title: Options + type: object + required: + - name + - template + - options + title: StagerPostRequest + example: + name: MyStager + options: + Base64: 'True' + Bypasses: mattifestation etw + Language: powershell + Listener: '' + Obfuscate: 'False' + ObfuscateCommand: Token\All\1 + OutFile: '' + Proxy: default + ProxyCreds: default + SafeChecks: 'True' + StagerRetries: '0' + UserAgent: default + template: multi_launcher + StagerTemplate: + properties: + id: + type: string + title: Id + name: + type: string + title: Name + authors: + items: + $ref: '#/components/schemas/Author' + type: array + title: Authors + description: + type: string + title: Description + comments: + items: + type: string + type: array + title: Comments + options: + additionalProperties: + $ref: '#/components/schemas/CustomOptionSchema' + type: object + title: Options + type: object + required: + - id + - name + - authors + - description + - comments + - options + title: StagerTemplate + example: + authors: + - '@harmj0y' + comments: + - '' + description: Generates a one-liner stage0 launcher for Empire. + id: multi_launcher + name: Launcher + options: + Base64: + description: Switch. Base64 encode the output. + required: true + strict: true + suggested_values: + - 'True' + - 'False' + value: 'True' + Bypasses: + description: Bypasses as a space separated list to be prepended to the + launcher + required: false + strict: false + suggested_values: [] + value: mattifestation etw + Language: + description: Language of the stager to generate. + required: true + strict: true + suggested_values: + - powershell + - python + value: powershell + Listener: + description: Listener to generate stager for. + required: true + strict: false + suggested_values: [] + value: '' + Obfuscate: + description: Switch. Obfuscate the launcher powershell code, uses the + ObfuscateCommand for obfuscation types. For powershell only. + required: false + strict: true + suggested_values: + - 'True' + - 'False' + value: 'False' + ObfuscateCommand: + description: The Invoke-Obfuscation command to use. Only used if Obfuscate + switch is True. For powershell only. + required: false + strict: false + suggested_values: [] + value: Token\All\1 + OutFile: + description: Filename that should be used for the generated output. + required: false + strict: false + suggested_values: [] + value: '' + Proxy: + description: Proxy to use for request (default, none, or other). + required: false + strict: false + suggested_values: [] + value: default + ProxyCreds: + description: Proxy credentials ([domain\]username:password) to use for + request (default, none, or other). + required: false + strict: false + suggested_values: [] + value: default + SafeChecks: + description: Switch. Checks for LittleSnitch or a SandBox, exit the staging + process if True. Defaults to True. + required: true + strict: true + suggested_values: + - 'True' + - 'False' + value: 'True' + StagerRetries: + description: Times for the stager to retry connecting. + required: false + strict: false + suggested_values: [] + value: '0' + UserAgent: + description: User-agent string to use for the staging request (default, + none, or other). + required: false + strict: false + suggested_values: [] + value: default + StagerTemplates: + properties: + records: + items: + $ref: '#/components/schemas/StagerTemplate' + type: array + title: Records + type: object + required: + - records + title: StagerTemplates + StagerUpdateRequest: + properties: + name: + type: string + title: Name + options: + additionalProperties: + type: string + type: object + title: Options + type: object + required: + - name + - options + title: StagerUpdateRequest + Stagers: + properties: + records: + items: + $ref: '#/components/schemas/Stager' + type: array + title: Records + type: object + required: + - records + title: Stagers + SysinfoPostRequest: + properties: {} + type: object + title: SysinfoPostRequest + Tag: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + value: + type: string + title: Value + label: + type: string + title: Label + color: + anyOf: + - type: string + - type: 'null' + title: Color + type: object + required: + - id + - name + - value + - label + title: Tag + TagOrderOptions: + type: string + enum: + - name + - created_at + - updated_at + title: TagOrderOptions + TagRequest: + properties: + name: + type: string + pattern: ^[^:]+$ + title: Name + value: + type: string + pattern: ^[^:]+$ + title: Value + color: + anyOf: + - type: string + - type: 'null' + title: Color + type: object + required: + - name + - value + title: TagRequest + TagSourceFilter: + type: string + enum: + - listener + - agent + - agent_task + - plugin_task + - download + - credential + title: TagSourceFilter + Token: + properties: + access_token: + type: string + title: Access Token + token_type: + type: string + title: Token Type + type: object + required: + - access_token + - token_type + title: Token + UploadPostRequest: + properties: + path_to_file: + type: string + title: Path To File + file_id: + type: integer + title: File Id + type: object + required: + - path_to_file + - file_id + title: UploadPostRequest + User: + properties: + id: + type: integer + title: Id + username: + type: string + title: Username + enabled: + type: boolean + title: Enabled + is_admin: + type: boolean + title: Is Admin + avatar: + anyOf: + - $ref: '#/components/schemas/DownloadDescription' + - type: 'null' + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + type: object + required: + - id + - username + - enabled + - is_admin + - created_at + - updated_at + title: User + UserPostRequest: + properties: + username: + type: string + title: Username + password: + type: string + title: Password + is_admin: + type: boolean + title: Is Admin + type: object + required: + - username + - password + - is_admin + title: UserPostRequest + UserUpdatePasswordRequest: + properties: + password: + type: string + title: Password + type: object + required: + - password + title: UserUpdatePasswordRequest + UserUpdateRequest: + properties: + username: + type: string + title: Username + enabled: + type: boolean + title: Enabled + is_admin: + type: boolean + title: Is Admin + type: object + required: + - username + - enabled + - is_admin + title: UserUpdateRequest + Users: + properties: + records: + items: + $ref: '#/components/schemas/User' + type: array + title: Records + type: object + required: + - records + title: Users + ValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + type: array + title: Location + msg: + type: string + title: Message + type: + type: string + title: Error Type + type: object + required: + - loc + - msg + - type + title: ValidationError + ValueType: + type: string + enum: + - STRING + - FLOAT + - INTEGER + - BOOLEAN + - FILE + title: ValueType + WorkingHoursPostRequest: + properties: + working_hours: + type: string + title: Working Hours + type: object + required: + - working_hours + title: WorkingHoursPostRequest + securitySchemes: + OAuth2PasswordBearer: + type: oauth2 + flows: + password: + scopes: {} + tokenUrl: token diff --git a/docs/restful-api/openapi.md b/docs/restful-api/openapi.md new file mode 100644 index 000000000..ef0427f72 --- /dev/null +++ b/docs/restful-api/openapi.md @@ -0,0 +1,122 @@ +{% swagger src="openapi.yaml" path="/api/v2/listener-templates" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listener-templates/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/listeners" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stager-templates" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stager-templates/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stagers" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stagers" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/tasks" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/jobs" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_job" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/shell" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/module" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/upload" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/download" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_import" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_command" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sysinfo" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/update_comms" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sleep" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_date" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/working_hours" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/directory_list" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/proxy_list" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/exit" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/socks" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/checkins" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/checkins/aggregate" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/checkins" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/files/root" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/files/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/token" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users/me" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users/{uid}/password" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/users/{uid}/avatar" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}/script" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/bulk/enable" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/reload" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/modules/reset" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses/reset" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/bypasses/reload" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/hosts/{host_id}/processes/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/hosts/{host_id}/processes" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/reload" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/reset" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/credentials" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/hosts/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/hosts" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/download" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/downloads" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/meta/version" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/tasks" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{uid}" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/{uid}/execute" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/plugins/reload" method="post" %} openapi.yaml {% endswagger %} +{% swagger src="openapi.yaml" path="/api/v2/tags" method="get" %} openapi.yaml {% endswagger %} diff --git a/empire.py b/empire.py index a9687dec4..fca30fb82 100644 --- a/empire.py +++ b/empire.py @@ -11,6 +11,10 @@ from empire.server import server server.run(args) + elif args.subparser_name == "api_export": + from empire.scripts.api_export import api_export + + api_export(args) elif args.subparser_name == "sync-starkiller": import yaml diff --git a/empire/arguments.py b/empire/arguments.py index d8f8ebedf..74ec9be88 100644 --- a/empire/arguments.py +++ b/empire/arguments.py @@ -10,6 +10,7 @@ subparsers = parent_parser.add_subparsers(dest="subparser_name") server_parser = subparsers.add_parser("server", help="Launch Empire Server") +api_export_parser = subparsers.add_parser("api_export", help="Export the OpenAPI spec") client_parser = subparsers.add_parser("client", help="Launch Empire CLI") sync_starkiller_parser = subparsers.add_parser( "sync-starkiller", help="Sync Starkiller submodule with the config" diff --git a/empire/scripts/api_export.py b/empire/scripts/api_export.py new file mode 100644 index 000000000..029a1327f --- /dev/null +++ b/empire/scripts/api_export.py @@ -0,0 +1,28 @@ +from pathlib import Path + +import yaml + +from empire.server.api.app import initialize +from empire.server.server import set_main + + +def api_export(args): + set_main(args) + app = initialize(run=False) + openapi = app.openapi() + version = openapi.get("openapi", "unknown version") + + print(f"writing openapi spec v{version}") + file_path = Path("docs/openapi.yaml") + + file_path.write_text(yaml.dump(openapi, sort_keys=False)) + print(f"spec written to {file_path}") + + gitbook_page = Path("docs/restful-api/openapi.md") + with gitbook_page.open("w") as f: + for path, data in openapi["paths"].items(): + for method, _ in data.items(): + # {% swagger src="sample.yaml" path="/stars" method="post" %} sample.yaml {% endswagger %} + f.write(f"{{% swagger src=\"openapi.yaml\" path=\"{path}\" method=\"{method}\" %}} openapi.yaml {{% endswagger %}}\n") + + print(f"gitbook page written to {gitbook_page}") diff --git a/empire/server/config.yaml b/empire/server/config.yaml index 1825b9db0..85dedd6a3 100644 --- a/empire/server/config.yaml +++ b/empire/server/config.yaml @@ -3,7 +3,7 @@ api: port: 1337 cert_path: empire/server/data/ database: - use: mysql + use: sqlite mysql: url: localhost:3306 username: empire_user diff --git a/empire/server/server.py b/empire/server/server.py index bfeb69cd2..20fe7f41a 100755 --- a/empire/server/server.py +++ b/empire/server/server.py @@ -157,7 +157,12 @@ def check_recommended_configuration(): log.warning("Consider using MySQL instead.") -def run(args): +def set_main(args): + global main # noqa: PLW0603 + main = empire.MainMenu(args=args) + + +def run(args): # noqa: PLR0912 setup_logging(args) if empire_config.submodules.auto_update: @@ -195,13 +200,12 @@ def run(args): else: base.startup_db() - global main # noqa: PLW0603 # Calling run more than once, such as in the test suite # Will generate more instances of MainMenu, which then # causes shutdown failure. if main is None: - main = empire.MainMenu(args=args) + set_main(args) if not (Path(empire_config.api.cert_path) / "empire-chain.pem").exists(): log.info("Certificate not found. Generating...") From 3613f3cfbe6ec7a3d4a2847eba4c723b42e388e6 Mon Sep 17 00:00:00 2001 From: Vince Rose Date: Wed, 18 Sep 2024 22:58:34 -0700 Subject: [PATCH 2/4] mv file --- docs/{ => restful-api}/openapi.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{ => restful-api}/openapi.yaml (100%) diff --git a/docs/openapi.yaml b/docs/restful-api/openapi.yaml similarity index 100% rename from docs/openapi.yaml rename to docs/restful-api/openapi.yaml From bb20a7a2610441948e388ad921232392ef50249c Mon Sep 17 00:00:00 2001 From: Vince Rose Date: Wed, 18 Sep 2024 23:04:22 -0700 Subject: [PATCH 3/4] change pathing --- docs/restful-api/openapi.md | 244 +++++++++++++++++------------------ empire/scripts/api_export.py | 2 +- 2 files changed, 123 insertions(+), 123 deletions(-) diff --git a/docs/restful-api/openapi.md b/docs/restful-api/openapi.md index ef0427f72..539bd8850 100644 --- a/docs/restful-api/openapi.md +++ b/docs/restful-api/openapi.md @@ -1,122 +1,122 @@ -{% swagger src="openapi.yaml" path="/api/v2/listener-templates" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listener-templates/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/listeners" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stager-templates" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stager-templates/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stagers" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stagers" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/stagers/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/tasks" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/jobs" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_job" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/shell" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/module" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/upload" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/download" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_import" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_command" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sysinfo" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/update_comms" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sleep" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_date" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/working_hours" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/directory_list" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/proxy_list" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/exit" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/socks" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/checkins" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/checkins/aggregate" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{uid}/checkins" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/files/root" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/agents/{agent_id}/files/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/token" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users/me" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users/{uid}/password" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/users/{uid}/avatar" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/{uid}/script" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/bulk/enable" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/reload" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/modules/reset" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses/reset" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/bypasses/reload" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/keywords" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/hosts/{host_id}/processes/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/hosts/{host_id}/processes" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/reload" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/malleable-profiles/reset" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials/{uid}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/credentials" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/hosts/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/hosts" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/download" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/downloads" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/meta/version" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="put" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/tasks" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{uid}" method="get" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/{uid}/execute" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/plugins/reload" method="post" %} openapi.yaml {% endswagger %} -{% swagger src="openapi.yaml" path="/api/v2/tags" method="get" %} openapi.yaml {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listener-templates" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listener-templates/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/listeners" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stager-templates" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stager-templates/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stagers" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stagers" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/jobs" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_job" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/shell" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/module" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/upload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/download" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_import" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_command" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sysinfo" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/update_comms" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sleep" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_date" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/working_hours" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/directory_list" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/proxy_list" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/exit" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/socks" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/checkins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/checkins/aggregate" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/checkins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/files/root" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/files/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/token" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users/me" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}/password" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}/avatar" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}/script" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/bulk/enable" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/modules/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/bypasses/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/hosts/{host_id}/processes/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/hosts/{host_id}/processes" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/credentials" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/hosts/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/hosts" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/download" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/downloads" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/meta/version" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/{uid}/execute" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/plugins/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="./openapi.yaml" path="/api/v2/tags" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} diff --git a/empire/scripts/api_export.py b/empire/scripts/api_export.py index 029a1327f..f103f0e55 100644 --- a/empire/scripts/api_export.py +++ b/empire/scripts/api_export.py @@ -23,6 +23,6 @@ def api_export(args): for path, data in openapi["paths"].items(): for method, _ in data.items(): # {% swagger src="sample.yaml" path="/stars" method="post" %} sample.yaml {% endswagger %} - f.write(f"{{% swagger src=\"openapi.yaml\" path=\"{path}\" method=\"{method}\" %}} openapi.yaml {{% endswagger %}}\n") + f.write(f"{{% swagger src=\"./openapi.yaml\" path=\"{path}\" method=\"{method}\" %}} [./openapi.yaml](./openapi.yaml) {{% endswagger %}}\n") print(f"gitbook page written to {gitbook_page}") From f3e14606c914e9da160a335fa157c9f2bc197969 Mon Sep 17 00:00:00 2001 From: Vince Rose Date: Wed, 18 Sep 2024 23:10:15 -0700 Subject: [PATCH 4/4] attempt changing pathing --- .../assets}/openapi.yaml | 0 docs/restful-api/openapi.md | 488 +++++++++++++----- empire/scripts/api_export.py | 6 +- 3 files changed, 370 insertions(+), 124 deletions(-) rename docs/{restful-api => .gitbook/assets}/openapi.yaml (100%) diff --git a/docs/restful-api/openapi.yaml b/docs/.gitbook/assets/openapi.yaml similarity index 100% rename from docs/restful-api/openapi.yaml rename to docs/.gitbook/assets/openapi.yaml diff --git a/docs/restful-api/openapi.md b/docs/restful-api/openapi.md index 539bd8850..2cbe10ec2 100644 --- a/docs/restful-api/openapi.md +++ b/docs/restful-api/openapi.md @@ -1,122 +1,366 @@ -{% swagger src="./openapi.yaml" path="/api/v2/listener-templates" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listener-templates/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/listeners" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stager-templates" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stager-templates/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stagers" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stagers" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/stagers/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/jobs" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_job" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/shell" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/module" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/upload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/download" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_import" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_command" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sysinfo" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/update_comms" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sleep" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_date" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/working_hours" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/directory_list" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/proxy_list" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/exit" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/socks" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/checkins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/checkins/aggregate" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{uid}/checkins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/files/root" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/agents/{agent_id}/files/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/token" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users/me" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}/password" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/users/{uid}/avatar" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/{uid}/script" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/bulk/enable" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/modules/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/bypasses/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/keywords" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/hosts/{host_id}/processes/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/hosts/{host_id}/processes" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/malleable-profiles/reset" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials/{uid}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/credentials" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/hosts/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/hosts" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/download" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/downloads" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/meta/version" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="put" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{uid}" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/{uid}/execute" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/plugins/reload" method="post" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} -{% swagger src="./openapi.yaml" path="/api/v2/tags" method="get" %} [./openapi.yaml](./openapi.yaml) {% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listener-templates" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listener-templates/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/listeners" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stager-templates" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stager-templates/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stagers" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stagers" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stagers/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stagers/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/stagers/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/tasks" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/jobs" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_job" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/shell" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/module" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/upload" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/download" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_import" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/script_command" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sysinfo" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/update_comms" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/sleep" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/kill_date" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/working_hours" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/directory_list" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/proxy_list" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/exit" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/tasks/socks" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/checkins" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/checkins/aggregate" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{uid}/checkins" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/files/root" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/agents/{agent_id}/files/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/token" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users/me" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users/{uid}/password" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/users/{uid}/avatar" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/{uid}/script" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/bulk/enable" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/reload" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/modules/reset" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses/reset" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/bypasses/reload" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/keywords/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/keywords" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/keywords" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/global" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/global/{language}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/obfuscation/global/{language}/preobfuscate" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/hosts/{host_id}/processes/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/hosts/{host_id}/processes" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles/reload" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/malleable-profiles/reset" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials/{uid}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/credentials" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/hosts/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/hosts" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads/{uid}/download" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/downloads" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/meta/version" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="put" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}/tags/{tag_id}" method="delete" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/tasks" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{plugin_id}/tasks/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{uid}" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/{uid}/execute" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/plugins/reload" method="post" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} +{% swagger src="../.gitbook/assets/openapi.yaml" path="/api/v2/tags" method="get" %} +[openapi.yaml](../.gitbook/assets/openapi.yaml) +{% endswagger %} diff --git a/empire/scripts/api_export.py b/empire/scripts/api_export.py index f103f0e55..720199dfe 100644 --- a/empire/scripts/api_export.py +++ b/empire/scripts/api_export.py @@ -13,7 +13,7 @@ def api_export(args): version = openapi.get("openapi", "unknown version") print(f"writing openapi spec v{version}") - file_path = Path("docs/openapi.yaml") + file_path = Path("docs/.gitbook/assets/openapi.yaml") file_path.write_text(yaml.dump(openapi, sort_keys=False)) print(f"spec written to {file_path}") @@ -23,6 +23,8 @@ def api_export(args): for path, data in openapi["paths"].items(): for method, _ in data.items(): # {% swagger src="sample.yaml" path="/stars" method="post" %} sample.yaml {% endswagger %} - f.write(f"{{% swagger src=\"./openapi.yaml\" path=\"{path}\" method=\"{method}\" %}} [./openapi.yaml](./openapi.yaml) {{% endswagger %}}\n") + f.write(f"{{% swagger src=\"../.gitbook/assets/openapi.yaml\" path=\"{path}\" method=\"{method}\" %}}\n") + f.write("[openapi.yaml](../.gitbook/assets/openapi.yaml)\n") + f.write("{% endswagger %}\n") print(f"gitbook page written to {gitbook_page}")