jobs

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// CREATED is used to denote that job has been created
	CREATED = 1
	// SENT is used to denote that the job has been sent to the Agent
	SENT = 2
	// RETURNED is for when a chunk has been returned but the job hasn't finished running
	RETURNED = 3
	// COMPLETE is used to denote that the job has finished running and the Agent has sent back the results
	COMPLETE = 4
	// CANCELED is used to denoted jobs that were cancelled with the "clear" command
	CANCELED = 5
	// ACTIVE is used with SOCKS connections to show the connection between the SOCKS client and server is active
	ACTIVE = 6

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

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

Variables

This section is empty.

Functions

func String

func String(jobType int) string

String returns the text representation of a message constant

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 belong 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    int         // 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 added in v1.5.0

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

Jump to

Keyboard shortcuts

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