jobs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: GPL-3.0 Imports: 2 Imported by: 10

Documentation

Overview

Package jobs holds the structures for Agent jobs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string   `json:"command"`
	Args    []string `json:"args"`
}

Command is the structure to send a task for the agent to execute

type FileTransfer

type FileTransfer struct {
	FileLocation string `json:"dest"`
	FileBlob     string `json:"blob"`
	IsDownload   bool   `json:"download"`
}

FileTransfer is the JSON payload to transfer files between the server and agent

type Job

type Job struct {
	AgentID uuid.UUID   // ID of the agent the job belongs to
	ID      string      // Unique identifier for each job
	Token   uuid.UUID   // A unique token for each task that acts like a CSRF token to prevent multiple job messages
	Type    Type        // The type of job it is (e.g., FileTransfer
	Payload interface{} // Embedded messages of various types
}

Job is used to task an agent to run a command

type Results

type Results struct {
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
}

Results is a JSON payload that contains the results of an executed command from an agent

type Shellcode

type Shellcode struct {
	Method string `json:"method"`
	Bytes  string `json:"bytes"`         // Base64 string of shellcode bytes
	PID    uint32 `json:"pid,omitempty"` // Process ID for remote injection
}

Shellcode is a JSON payload containing shellcode and the method for execution

type Socks

type Socks struct {
	ID    uuid.UUID `json:"id"`
	Index int       `json:"index"`
	Data  []byte    `json:"data"`
	Close bool      `json:"close"`
}

Socks is used to transfer data from a SOCKS client through the server to the agent and back

type Type

type Type int

Type is a type for job type constants

const (
	// UNDEFINED is the default value when a Type was not set
	UNDEFINED Type = iota

	// CMD is used to send CmdPayload messages
	CMD // CmdPayload
	// CONTROL is used to send AgentControl messages
	CONTROL // AgentControl
	// SHELLCODE is used to send shellcode messages
	SHELLCODE // Shellcode
	// NATIVE is used to send NativeCmd messages
	NATIVE // NativeCmd
	// FILETRANSFER is used to send FileTransfer messages for upload/download operations
	FILETRANSFER // FileTransfer
	// OK is used to signify that there is nothing to do, or to idle
	OK // ServerOK
	// MODULE is used to send Module messages
	MODULE // Module
	// SOCKS is used for SOCKS5 traffic between the server and agent
	SOCKS // SOCKS

	// RESULT is used by the Agent to return a result message
	RESULT
	// AGENTINFO is used by the Agent to return information about its configuration
	AGENTINFO
)

func IntToType added in v1.3.0

func IntToType(job int) Type

IntToType converts an integer to a Type Used with third-party clients to convert to a Merlin message

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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