commands

package
v0.0.0-...-efde48c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package commands holds all the Mythic command logic for issuing, receiving, and processing commands to Merlin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() (commands []structs.Command)

Commands returns a list of all the commands the Merlin agent payload supports

func ConvertMerlinJobToMythicTask

func ConvertMerlinJobToMythicTask(job jobs.Command, jobType jobs.Type) (bytes string, err error)

ConvertMerlinJobToMythicTask takes in a Merlin jobs.Job structure and converts it to a Mythic Job structure

func GetFile

func GetFile(task *structs.PTTaskMessageAllData) (data []byte, filename string, err error)

GetFile processes a Mythic task to retrieve a file and return its contents, filename, and any errors. The Mythic task must have a "filename" and "file" command arguments. The "filename" command argument references a file that has already been uploaded to Mythic. The "file" command argument reference is used when a new file was uploaded as part of the Mythic task.

func GetFileByName

func GetFileByName(name string, callback int) (contents []byte, err error)

GetFileByName queries the Mythic server for files that match the passed in name argument and returns the contents of the first match

func GetFileContents

func GetFileContents(fileID string) (contents []byte, err error)

GetFileContents retrieves the file content as bytes for the provided fileID string

func GetFileList

func GetFileList(msg structs.PTRPCDynamicQueryFunctionMessage) (files []string)

GetFileList queries the Mythic server for files it knows about and returns a list of those Mythic file objects This function is used as a DynamicQuery to populate Mythic Command Parameter dropdown lists

func GetFileName

func GetFileName(fileID string) (name string, err error)

GetFileName retrieves the file name for the provided fileID string

Types

type Command

type Command interface {
	Command() structs.Command
}

type Job

type Job struct {
	Type    int    `json:"type"`
	Payload string `json:"payload"`
}

Job structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL