prelude

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: GPL-3.0 Imports: 24 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(session *clientpb.Session) *commonpb.Request

func RunCommand

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

RunCommand executes a given command

Types

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 AgentSession

type AgentSession struct {
	Conn    *net.Conn
	Session *clientpb.Session
	RPC     rpcpb.SliverRPCClient
	Beacon  Beacon
	Config  AgentConfig
}

func NewAgentSession

func NewAgentSession(c *net.Conn, s *clientpb.Session, rpc rpcpb.SliverRPCClient, b Beacon, conf AgentConfig) *AgentSession

func (*AgentSession) ReceiveLoop

func (a *AgentSession) ReceiveLoop()

type Beacon

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

type Configuration

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

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 OperatorConfig

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

type PreludeSessionMapper

type PreludeSessionMapper struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var SessionMapper *PreludeSessionMapper

func InitSessionMapper

func InitSessionMapper(conf *OperatorConfig) *PreludeSessionMapper

func (*PreludeSessionMapper) AddSession

func (p *PreludeSessionMapper) AddSession(s *clientpb.Session) error

func (*PreludeSessionMapper) GetConfig

func (p *PreludeSessionMapper) GetConfig() *OperatorConfig

func (*PreludeSessionMapper) RemoveSession

func (p *PreludeSessionMapper) RemoveSession(s *clientpb.Session) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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