agents

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is an aggregate structure that holds information about Agent's the server is communicating with

func NewAgent

func NewAgent(id uuid.UUID, secret []byte, opaque *opaque.Server, initial time.Time) (agent Agent, err error)

NewAgent is a factory to create and return an Agent structure based on the provided inputs

func (a *Agent) AddLink(link uuid.UUID)

AddLink adds a new child Agent to the list of linked Agents

func (*Agent) Alive

func (a *Agent) Alive() bool

Alive returns true if the Agent is actively in use and false if the agent has been killed or removed

func (*Agent) Authenticated

func (a *Agent) Authenticated() bool

Authenticated checks to see if the agent has successfully completed authentication

func (*Agent) Build

func (a *Agent) Build() Build

Build returns the Agent's embedded Build entity structure Contains the agent's build and version number

func (*Agent) Comms

func (a *Agent) Comms() Comms

Comms returns the Agent's embedded Comms entity structure Contains things like kill date, message padding size, transport protocol, skew, and sleep time

func (*Agent) Host

func (a *Agent) Host() Host

Host returns the Agent's embedded Host entity structure Contains information about the host the Agent is running on such as hostname, operating system, architecture, and IP addresses

func (*Agent) ID

func (a *Agent) ID() uuid.UUID

ID return's the Agent's unique ID

func (*Agent) Initial

func (a *Agent) Initial() time.Time

Initial returns the timestamp from when the Agent was first seen

func (a *Agent) Links() []uuid.UUID

Links returns a list of linked Agent IDs where this agent is the parent and the list of Agents are the children

func (*Agent) Listener

func (a *Agent) Listener() uuid.UUID

Listener returns the unique identifier of the Listener that the agent belongs to The associated listener determines Agent traffic encryption/encoding and delivery mechanism

func (*Agent) Log

func (a *Agent) Log(message string)

Log write the provided message to the Agent's log file

func (*Agent) Note

func (a *Agent) Note() string

Note returns the value of the Agent's note field

func (*Agent) OPAQUE

func (a *Agent) OPAQUE() *opaque.Server

OPAQUE returns the Agent's embedded OPAQUE server structure

func (*Agent) Padding

func (a *Agent) Padding() int

Padding returns the Agent's communication profile message padding size

func (*Agent) Process

func (a *Agent) Process() Process

Process returns the Agent's embedded Process entity structure Contains information about the process the Agent is running in/as such as process ID, name, username, domain, and integrity level

func (a *Agent) RemoveLink(link uuid.UUID)

RemoveLink deletes the child Agent link from the list of linked Agents

func (*Agent) ResetOPAQUE

func (a *Agent) ResetOPAQUE()

ResetOPAQUE resets the Agent's embedded OPAQUE server structure to nil

func (*Agent) Secret

func (a *Agent) Secret() []byte

Secret returns the Agent's secret key, typically used to encrypt/decrypt messages

func (*Agent) SetAuthenticated

func (a *Agent) SetAuthenticated(authenticated bool)

SetAuthenticated updates that Agent's authenticated field, typically once authentication has completed

func (*Agent) SetSecret

func (a *Agent) SetSecret(secret []byte)

SetSecret updates the Agent's secret key with the provided value

func (*Agent) StatusCheckin

func (a *Agent) StatusCheckin() time.Time

StatusCheckin returns a time stamp of when the agent last checked in

func (*Agent) UpdateAlive

func (a *Agent) UpdateAlive(alive bool)

UpdateAlive updates the Agent's alive status to the provided value

func (*Agent) UpdateAuthenticated

func (a *Agent) UpdateAuthenticated(authenticated bool)

UpdateAuthenticated updates the Agent's authentication status to the provided value

func (*Agent) UpdateBuild

func (a *Agent) UpdateBuild(build Build)

UpdateBuild updates the Agent's embedded Build entity structure with the provided structure

func (*Agent) UpdateComms

func (a *Agent) UpdateComms(comms Comms)

UpdateComms updates the Agent's embedded Comms entity structure with the provided structure

func (*Agent) UpdateHost

func (a *Agent) UpdateHost(host Host)

UpdateHost updates the Agent's embedded Host entity structure with the provided structure

func (*Agent) UpdateInitial

func (a *Agent) UpdateInitial(initial time.Time)

UpdateInitial updates the time stamp for when the Agent was first seen

func (*Agent) UpdateListener

func (a *Agent) UpdateListener(listener uuid.UUID)

UpdateListener updates the listener ID the Agent belongs to

func (*Agent) UpdateNote

func (a *Agent) UpdateNote(note string)

UpdateNote update the Agent's note field with the provided message

func (*Agent) UpdateOPAQUE

func (a *Agent) UpdateOPAQUE(opaque *opaque.Server)

UpdateOPAQUE updates the Agent's embedded OPAQUE server structure with the provided structure

func (*Agent) UpdateProcess

func (a *Agent) UpdateProcess(process Process)

UpdateProcess updates the Agent's embedded Process entity structure with the provided structure

func (*Agent) UpdateStatusCheckin

func (a *Agent) UpdateStatusCheckin(checkin time.Time)

UpdateStatusCheckin updates the time stamp for when the Agent last checked in

type Build

type Build struct {
	Build   string // The agent's build hash
	Version string // The agent's version number
}

Build is a structure that holds information about an Agent's compiled build hash and the Agent's version number

type Comms

type Comms struct {
	Failed  int    // The number of times the agent has failed to check in
	JA3     string // The ja3 signature applied to the agent's TLS client
	Kill    int64  // The epoch date and time that the agent will kill itself and quit running
	Padding int    // The maximum amount of padding that will be appended to the Base message
	Proto   string // The protocol the agent is using to communicate with the server
	Retry   int    // The maximum amount of times an agent will retry to check in before exiting
	Skew    int64  // The amount of skew, or jitter, used to calculate the check in time
	Wait    string // The amount of time the agent waits before trying to check in
}

Comms is a structure that holds information about an Agent's communication profile

type Host

type Host struct {
	Architecture string   // The operating system architecture the agent is running on (e.g., x86 or x64)
	Name         string   // The host name the agent is running on
	Platform     string   // The platform, or operating system, the agent is running on
	IPs          []string // A list of interface IP addresses on the host where the agent is running
}

Host is a structure that holds information about the Host operating system an Agent is running on

type Process

type Process struct {
	ID        int    // The process ID that the agent is running in
	Integrity int    // The integrity level of the process the agent is running in
	Name      string // The process name that the agent is running in
	UserGUID  string // The GUID of the user that the agent is running as
	UserName  string // The username that the agent is running as
	Domain    string // The domain the user running the process belongs to
}

Process is a structure that holds information about the Process the Agent is running in/as

type Repository

type Repository interface {
	Add(agent Agent) error
	Get(id uuid.UUID) (Agent, error)
	GetAll() (agents []Agent)
	Remove(id uuid.UUID) error
	Log(id uuid.UUID, message string) error
	Update(agent Agent) error
	UpdateAlive(id uuid.UUID, alive bool) error
	UpdateAuthenticated(id uuid.UUID, authenticated bool) error
	UpdateBuild(id uuid.UUID, build Build) error
	UpdateComms(id uuid.UUID, comms Comms) error
	UpdateHost(id uuid.UUID, host Host) error
	UpdateInitial(id uuid.UUID, t time.Time) (err error)
	UpdateListener(id, listener uuid.UUID) error
	UpdateProcess(id uuid.UUID, process Process) error
	UpdateNote(id uuid.UUID, note string) error
	UpdateStatusCheckin(id uuid.UUID, t time.Time) (err error)
	AddLinkedAgent(id uuid.UUID, link uuid.UUID) error
	RemoveLinkedAgent(id uuid.UUID, link uuid.UUID) error
}

Repository is an interface used to add, get, or update Agents from a data source

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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