agents

package
v0.0.0-...-5262aa1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Agents = make(map[uuid.UUID]*Agent)

Agents contains all of the instantiated agent object that are accessed by other modules

Functions

func GetAgentFieldValue

func GetAgentFieldValue(agentID uuid.UUID, field string) (string, error)

GetAgentFieldValue returns a string value for the field value belonging to the specified Agent

func GetEncryptionKey

func GetEncryptionKey(agentID uuid.UUID) ([]byte, error)

GetEncryptionKey retrieves the per-agent payload encryption key used to decrypt messages for any protocol

func GetLifetime

func GetLifetime(agentID uuid.UUID) (time.Duration, error)

GetLifetime returns the amount an agent could live without successfully communicating with the server

func KeyExchange

func KeyExchange(m messages.Base) (messages.Base, error)

KeyExchange is used to exchange public keys between the server and agent

func RemoveAgent

func RemoveAgent(agentID uuid.UUID) error

RemoveAgent deletes the agent object from Agents map by its ID

func SetMaxRetry

func SetMaxRetry(agentID uuid.UUID, retry string) error

SetMaxRetry updates an Agent's MaxRetry limit

func SetWaitTime

func SetWaitTime(agentID uuid.UUID, wait string) error

SetWaitTime updates an Agent's sleep amount or Wait Time

Types

type Agent

type Agent struct {
	ID           uuid.UUID
	Platform     string
	Architecture string
	UserName     string
	UserGUID     string
	HostName     string
	Ips          []string
	Pid          int

	InitialCheckIn time.Time
	StatusCheckIn  time.Time
	Version        string
	Build          string
	WaitTime       string
	PaddingMax     int
	MaxRetry       int
	FailedCheckin  int
	Skew           int64
	Proto          string
	KillDate       int64
	RSAKeys        *rsa.PrivateKey // RSA Private/Public key pair; Private key used to decrypt messages
	PublicKey      rsa.PublicKey   // Public key used to encrypt messages
	Secret         []byte          // secret is used to perform symmetric encryption operations
	OPAQUE         *opaque.Server  // Holds information about OPAQUE Registration and Authentication
	JA3            string          // The JA3 signature applied to the agent's TLS client
	// contains filtered or unexported fields
}

Agent is a server side structure that holds information about a Merlin Agent

func New

func New(agentID uuid.UUID) (Agent, error)

New creates a new Agent and returns the object but does not add it to the global agents map

func (*Agent) Log

func (a *Agent) Log(logMessage string)

Log is used to write log messages to the agent's log file

func (*Agent) UpdateInfo

func (a *Agent) UpdateInfo(info messages.AgentInfo)

UpdateInfo is used to update an agent's information with the passed in message data

Jump to

Keyboard shortcuts

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