prelude

package
v1.5.28 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: GPL-3.0 Imports: 26 Imported by: 2

README

Prelude

The prelude package handles the connection with Prelude's Operator platform.

Documentation

Index

Constants

View Source
const (
	ErrorExitStatus   = -1
	SuccessExitStatus = 0
)

Variables

This section is empty.

Functions

func MakeRequest

func MakeRequest(a ActiveImplant) *commonpb.Request

func RunCommand

func RunCommand(message string, executor string, payload []byte, agentSession *OperatorImplantBridge, onFinish func(string, int, int)) (string, int, int)

RunCommand executes a given command

Types

type ActiveImplant added in v1.5.9

type ActiveImplant interface {
	GetID() string
	GetHostname() string
	GetPID() int32
	GetOS() string
	GetArch() string
	GetFilename() string
	GetReconnectInterval() int64
}

ActiveImplant exposes common methods between Sliver clientpb.Session and clientpb.Beacon that are required by Operator implants

type AgentConfig

type AgentConfig struct {
	Name           string
	AESKey         string
	Range          string
	Contact        string
	Address        string
	Useragent      string
	Sleep          int
	KillSleep      int
	CommandJitter  int
	CommandTimeout int
	Pid            int
	Proxy          string
	Debug          bool
	Executing      map[string]Instruction
}

func (*AgentConfig) BuildExecutingHash

func (c *AgentConfig) BuildExecutingHash() string

func (*AgentConfig) EndInstruction

func (c *AgentConfig) EndInstruction(instruction Instruction)

func (*AgentConfig) StartInstruction

func (c *AgentConfig) StartInstruction(instruction Instruction) bool

func (*AgentConfig) StartInstructions

func (c *AgentConfig) StartInstructions(instructions []Instruction) (ret []Instruction)

type Configuration

type Configuration interface {
	ApplyConfig(ac map[string]interface{})
	BuildBeacon() OperatorBeacon
}

type Instruction

type Instruction struct {
	ID       string `json:"ID"`
	Executor string `json:"Executor"`
	Payload  string `json:"Payload"`
	Request  string `json:"Request"`
	Response string
	Status   int
	Pid      int
}

type OperatorBeacon added in v1.5.9

type OperatorBeacon struct {
	Name      string
	Target    string
	Hostname  string
	Location  string
	Platform  string
	Executors []string
	Range     string
	Sleep     int
	Pwd       string
	Executing string
	Links     []Instruction
}

type OperatorConfig

type OperatorConfig struct {
	Range       string
	OperatorURL string
	RPC         rpcpb.SliverRPCClient
	AESKey      string
}

type OperatorImplantBridge added in v1.5.9

type OperatorImplantBridge struct {
	Conn           *net.Conn
	Implant        ActiveImplant
	RPC            rpcpb.SliverRPCClient
	PBeacon        OperatorBeacon
	BeaconCallback func(string, func(*clientpb.BeaconTask))
	Config         AgentConfig
	// contains filtered or unexported fields
}

OperatorImplantBridge maps the Sliver implants (whether it be a beacon or a session) to a Prelude Operator implant with a TCP transport.

func NewImplantBridge added in v1.5.9

func NewImplantBridge(c *net.Conn, a ActiveImplant, rpc rpcpb.SliverRPCClient, pbeacon OperatorBeacon, conf AgentConfig, callback func(string, func(*clientpb.BeaconTask))) *OperatorImplantBridge

func (*OperatorImplantBridge) ReceiveLoop added in v1.5.9

func (a *OperatorImplantBridge) ReceiveLoop()

type OperatorImplantMapper added in v1.5.9

type OperatorImplantMapper struct {
	sync.Mutex
	// contains filtered or unexported fields
}

OperatorImplantMapper maps an OperatorConfig with active Sliver implant sessions/beacons

var ImplantMapper *OperatorImplantMapper

func InitImplantMapper added in v1.5.9

func InitImplantMapper(conf *OperatorConfig) *OperatorImplantMapper

func (*OperatorImplantMapper) AddImplant added in v1.5.9

func (p *OperatorImplantMapper) AddImplant(a ActiveImplant, callback func(string, func(*clientpb.BeaconTask))) error

func (*OperatorImplantMapper) GetConfig added in v1.5.9

func (p *OperatorImplantMapper) GetConfig() *OperatorConfig

func (*OperatorImplantMapper) RemoveImplant added in v1.5.9

func (p *OperatorImplantMapper) RemoveImplant(imp ActiveImplant) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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