Skip to content

Commit

Permalink
added cache to build, version command
Browse files Browse the repository at this point in the history
  • Loading branch information
spenceradolph committed Apr 15, 2024
1 parent 8dbbc97 commit 3eb279b
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push the server container image (implant)
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images
Expand All @@ -89,6 +91,8 @@ jobs:
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

update_files:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# setup for local testing
rabbitmq_config.json
rabbitmq_config.json.kali
rabbitmq_config.json.ubuntu

__pycache__/
mythic_go_services*
17 changes: 17 additions & 0 deletions Payload_Type/sliverapi/sliverapi/SliverRequests/SliverAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ async def jobs_list(taskData: PTTaskMessageAllData):

return f"{jobs}"

async def version(taskData: PTTaskMessageAllData):
client = await create_sliver_client(taskData)
version_results = await client.version()

# TODO: match sliver formatting

# [*] Client v1.5.42 - 85b0e870d05ec47184958dbcb871ddee2eb9e3df - linux/amd64
# Compiled at 2024-02-28 13:46:53 -0600 CST
# Compiled with go version go1.20.7 linux/amd64


# [*] Server v1.5.42 - 85b0e870d05ec47184958dbcb871ddee2eb9e3df - linux/amd64
# Compiled at 2024-02-28 13:46:53 -0600 CST

return f"{version_results}"


async def jobs_kill(taskData: PTTaskMessageAllData, job_id: int):
client = await create_sliver_client(taskData)
kill_response = await client.kill_job(job_id=job_id)
Expand Down
57 changes: 57 additions & 0 deletions Payload_Type/sliverapi/sliverapi/agent_functions/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from ..SliverRequests import SliverAPI

from mythic_container.MythicCommandBase import *
from mythic_container.MythicRPC import *
from mythic_container.PayloadBuilder import *


class VersionArguments(TaskArguments):
def __init__(self, command_line, **kwargs):
super().__init__(command_line, **kwargs)
self.args = []

async def parse_arguments(self):
pass


class Version(CommandBase):
cmd = "version"
needs_admin = False
help_cmd = "version"
description = "Display version information"
version = 1
author = "Spencer Adolph"
argument_class = VersionArguments
attackmapping = []

async def create_go_tasking(self, taskData: MythicCommandBase.PTTaskMessageAllData) -> MythicCommandBase.PTTaskCreateTaskingMessageResponse:
# Display version information

# Usage:
# ======
# version [flags]

# Flags:
# ======
# TODO: -h, --help display help
# TODO: -t, --timeout int command timeout in seconds (default: 60)

response = await SliverAPI.version(taskData)

await SendMythicRPCResponseCreate(MythicRPCResponseCreateMessage(
TaskID=taskData.Task.ID,
Response=response.encode("UTF8"),
))

taskResponse = MythicCommandBase.PTTaskCreateTaskingMessageResponse(
TaskID=taskData.Task.ID,
Success=True,
Completed=True,
)

return taskResponse

async def process_response(self, task: PTTaskMessageAllData, response: any) -> PTTaskProcessResponseMessageResponse:
resp = PTTaskProcessResponseMessageResponse(TaskID=task.Task.ID, Success=True)
return resp

0 comments on commit 3eb279b

Please sign in to comment.