pb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_c2_pb_agent_proto protoreflect.FileDescriptor
View Source
var File_c2_pb_channel_proto protoreflect.FileDescriptor

Functions

func DefaultDeleteAgent

func DefaultDeleteAgent(ctx context.Context, in *Agent, db *gorm.DB) error

func DefaultDeleteAgentSet

func DefaultDeleteAgentSet(ctx context.Context, in []*Agent, db *gorm.DB) error

func DefaultDeleteChannel

func DefaultDeleteChannel(ctx context.Context, in *Channel, db *gorm.DB) error

func DefaultDeleteChannelSet

func DefaultDeleteChannelSet(ctx context.Context, in []*Channel, db *gorm.DB) error

func DefaultDeleteTask

func DefaultDeleteTask(ctx context.Context, in *Task, db *gorm.DB) error

func DefaultDeleteTaskSet

func DefaultDeleteTaskSet(ctx context.Context, in []*Task, db *gorm.DB) error

Types

type Agent

type Agent struct {

	// @gotags: display:"ID" readonly:"true" strict:"yes"
	Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty" display:"ID" readonly:"true" strict:"yes"`
	// @gotags: display:"Created at" readonly:"true" xml:"-"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty" display:"Created at" readonly:"true" xml:"-"`
	// @gotags: display:"Updated at" readonly:"true" xml:"-"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty" display:"Updated at" readonly:"true" xml:"-"`
	// Core
	Host    *pb.Host `protobuf:"bytes,9,opt,name=Host,proto3" json:"Host,omitempty"`
	Name    string   `protobuf:"bytes,10,opt,name=Name,proto3" json:"Name,omitempty"`
	Runtime string   `protobuf:"bytes,11,opt,name=Runtime,proto3" json:"Runtime,omitempty"`
	Tool    string   `protobuf:"bytes,12,opt,name=Tool,proto3" json:"Tool,omitempty"`
	Burned  bool     `protobuf:"varint,13,opt,name=Burned,proto3" json:"Burned,omitempty"`
	IsDead  bool     `protobuf:"varint,14,opt,name=IsDead,proto3" json:"IsDead,omitempty"`
	Arch    string   `protobuf:"bytes,15,opt,name=Arch,proto3" json:"Arch,omitempty"`
	// Source - The provenance record for this agent (Tool=<C2 framework>, Type=C2). Stamped
	// onto the host/user/process objects the agent contributes.
	Source *pb1.Source `protobuf:"bytes,16,opt,name=Source,proto3" json:"Source,omitempty"`
	// System
	Locale   string      `protobuf:"bytes,30,opt,name=Locale,proto3" json:"Locale,omitempty"`
	Filename string      `protobuf:"bytes,31,opt,name=Filename,proto3" json:"Filename,omitempty"` // Argv[0]
	User     *pb.User    `protobuf:"bytes,32,opt,name=User,proto3" json:"User,omitempty"`
	Process  *pb.Process `protobuf:"bytes,34,opt,name=Process,proto3" json:"Process,omitempty"`
	// Communications
	FirstContact int64      `protobuf:"varint,50,opt,name=FirstContact,proto3" json:"FirstContact,omitempty"`
	LastCheckin  int64      `protobuf:"varint,51,opt,name=LastCheckin,proto3" json:"LastCheckin,omitempty"`
	NextCheckin  int64      `protobuf:"varint,52,opt,name=NextCheckin,proto3" json:"NextCheckin,omitempty"`
	Channels     []*Channel `protobuf:"bytes,53,rep,name=Channels,proto3" json:"Channels,omitempty"`
	// Others
	Tasks               []*Task `protobuf:"bytes,90,rep,name=Tasks,proto3" json:"Tasks,omitempty"`
	TasksCount          int64   `protobuf:"varint,91,opt,name=TasksCount,proto3" json:"TasksCount,omitempty"`
	TasksCountCompleted int64   `protobuf:"varint,92,opt,name=TasksCountCompleted,proto3" json:"TasksCountCompleted,omitempty"`
	WorkingDirectory    string  `protobuf:"bytes,93,opt,name=WorkingDirectory,proto3" json:"WorkingDirectory,omitempty"`
	// contains filtered or unexported fields
}

Agent represents a C2 agent/implant program, irrespective of the communication channels and behavior it makes use of.

func DefaultApplyFieldMaskAgent

func DefaultApplyFieldMaskAgent(ctx context.Context, patchee *Agent, patcher *Agent, updateMask *field_mask.FieldMask, prefix string, db *gorm.DB) (*Agent, error)

DefaultApplyFieldMaskAgent patches an pbObject with patcher according to a field mask.

func DefaultCreateAgent

func DefaultCreateAgent(ctx context.Context, in *Agent, db *gorm.DB) (*Agent, error)

DefaultCreateAgent executes a basic gorm create call

func DefaultListAgent

func DefaultListAgent(ctx context.Context, db *gorm.DB) ([]*Agent, error)

DefaultListAgent executes a gorm list call

func DefaultPatchAgent

func DefaultPatchAgent(ctx context.Context, in *Agent, updateMask *field_mask.FieldMask, db *gorm.DB) (*Agent, error)

DefaultPatchAgent executes a basic gorm update call with patch behavior

func DefaultPatchSetAgent

func DefaultPatchSetAgent(ctx context.Context, objects []*Agent, updateMasks []*field_mask.FieldMask, db *gorm.DB) ([]*Agent, error)

DefaultPatchSetAgent executes a bulk gorm update call with patch behavior

func DefaultReadAgent

func DefaultReadAgent(ctx context.Context, in *Agent, db *gorm.DB) (*Agent, error)

func DefaultStrictUpdateAgent

func DefaultStrictUpdateAgent(ctx context.Context, in *Agent, db *gorm.DB) (*Agent, error)

DefaultStrictUpdateAgent clears / replaces / appends first level 1:many children and then executes a gorm update call

func (*Agent) Descriptor deprecated

func (*Agent) Descriptor() ([]byte, []int)

Deprecated: Use Agent.ProtoReflect.Descriptor instead.

func (*Agent) GetArch

func (x *Agent) GetArch() string

func (*Agent) GetBurned

func (x *Agent) GetBurned() bool

func (*Agent) GetChannels

func (x *Agent) GetChannels() []*Channel

func (*Agent) GetCreatedAt

func (x *Agent) GetCreatedAt() *timestamppb.Timestamp

func (*Agent) GetFilename

func (x *Agent) GetFilename() string

func (*Agent) GetFirstContact

func (x *Agent) GetFirstContact() int64

func (*Agent) GetHost

func (x *Agent) GetHost() *pb.Host

func (*Agent) GetId

func (x *Agent) GetId() string

func (*Agent) GetIsDead

func (x *Agent) GetIsDead() bool

func (*Agent) GetLastCheckin

func (x *Agent) GetLastCheckin() int64

func (*Agent) GetLocale

func (x *Agent) GetLocale() string

func (*Agent) GetName

func (x *Agent) GetName() string

func (*Agent) GetNextCheckin

func (x *Agent) GetNextCheckin() int64

func (*Agent) GetProcess

func (x *Agent) GetProcess() *pb.Process

func (*Agent) GetRuntime

func (x *Agent) GetRuntime() string

func (*Agent) GetSource

func (x *Agent) GetSource() *pb1.Source

func (*Agent) GetTasks

func (x *Agent) GetTasks() []*Task

func (*Agent) GetTasksCount

func (x *Agent) GetTasksCount() int64

func (*Agent) GetTasksCountCompleted

func (x *Agent) GetTasksCountCompleted() int64

func (*Agent) GetTool

func (x *Agent) GetTool() string

func (*Agent) GetUpdatedAt

func (x *Agent) GetUpdatedAt() *timestamppb.Timestamp

func (*Agent) GetUser

func (x *Agent) GetUser() *pb.User

func (*Agent) GetWorkingDirectory

func (x *Agent) GetWorkingDirectory() string

func (*Agent) ProtoMessage

func (*Agent) ProtoMessage()

func (*Agent) ProtoReflect

func (x *Agent) ProtoReflect() protoreflect.Message

func (*Agent) Reset

func (x *Agent) Reset()

func (*Agent) String

func (x *Agent) String() string

func (*Agent) ToORM

func (m *Agent) ToORM(ctx context.Context) (AgentORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type AgentORM

type AgentORM struct {
	Arch                string
	Burned              bool
	Channels            []*ChannelORM `gorm:"foreignKey:AgentId;references:Id"`
	CreatedAt           *time.Time
	Filename            string
	FirstContact        int64
	Host                *pb.HostORM `gorm:"foreignKey:HostId;references:Id"`
	HostId              *string
	Id                  string `gorm:"type:uuid;primaryKey"`
	IsDead              bool
	LastCheckin         int64
	Locale              string
	Name                string
	NextCheckin         int64
	Process             *pb.ProcessORM `gorm:"foreignKey:ProcessId;references:Id"`
	ProcessId           *string
	Runtime             string
	Source              *pb1.SourceORM `gorm:"foreignKey:SourceId;references:Id"`
	SourceId            *string
	Tasks               []*TaskORM `gorm:"foreignKey:AgentId;references:Id"`
	TasksCount          int64
	TasksCountCompleted int64
	Tool                string
	UpdatedAt           *time.Time
	User                *pb.UserORM `gorm:"foreignKey:UserId;references:Id"`
	UserId              *string
	WorkingDirectory    string
}

func (*AgentORM) BeforeCreate

func (agent *AgentORM) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM-specific autogenerated helpers.

func (AgentORM) TableName

func (AgentORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*AgentORM) ToPB

func (m *AgentORM) ToPB(ctx context.Context) (Agent, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type AgentORMWithAfterCreate_

type AgentORMWithAfterCreate_ interface {
	AfterCreate_(context.Context, *gorm.DB) error
}

type AgentORMWithAfterDeleteSet

type AgentORMWithAfterDeleteSet interface {
	AfterDeleteSet(context.Context, []*Agent, *gorm.DB) error
}

type AgentORMWithAfterDelete_

type AgentORMWithAfterDelete_ interface {
	AfterDelete_(context.Context, *gorm.DB) error
}

type AgentORMWithAfterListFind

type AgentORMWithAfterListFind interface {
	AfterListFind(context.Context, *gorm.DB, *[]AgentORM) error
}

type AgentORMWithAfterReadFind

type AgentORMWithAfterReadFind interface {
	AfterReadFind(context.Context, *gorm.DB) error
}

type AgentORMWithAfterStrictUpdateSave

type AgentORMWithAfterStrictUpdateSave interface {
	AfterStrictUpdateSave(context.Context, *gorm.DB) error
}

type AgentORMWithBeforeCreate_

type AgentORMWithBeforeCreate_ interface {
	BeforeCreate_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeDeleteSet

type AgentORMWithBeforeDeleteSet interface {
	BeforeDeleteSet(context.Context, []*Agent, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeDelete_

type AgentORMWithBeforeDelete_ interface {
	BeforeDelete_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeListApplyQuery

type AgentORMWithBeforeListApplyQuery interface {
	BeforeListApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeListFind

type AgentORMWithBeforeListFind interface {
	BeforeListFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeReadApplyQuery

type AgentORMWithBeforeReadApplyQuery interface {
	BeforeReadApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeReadFind

type AgentORMWithBeforeReadFind interface {
	BeforeReadFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeStrictUpdateCleanup

type AgentORMWithBeforeStrictUpdateCleanup interface {
	BeforeStrictUpdateCleanup(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentORMWithBeforeStrictUpdateSave

type AgentORMWithBeforeStrictUpdateSave interface {
	BeforeStrictUpdateSave(context.Context, *gorm.DB) (*gorm.DB, error)
}

type AgentWithAfterPatchSave

type AgentWithAfterPatchSave interface {
	AfterPatchSave(context.Context, *Agent, *field_mask.FieldMask, *gorm.DB) error
}

type AgentWithAfterToORM

type AgentWithAfterToORM interface {
	AfterToORM(context.Context, *AgentORM) error
}

AgentAfterToORM called after default ToORM code

type AgentWithAfterToPB

type AgentWithAfterToPB interface {
	AfterToPB(context.Context, *Agent) error
}

AgentAfterToPB called after default ToPB code

type AgentWithBeforePatchApplyFieldMask

type AgentWithBeforePatchApplyFieldMask interface {
	BeforePatchApplyFieldMask(context.Context, *Agent, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type AgentWithBeforePatchRead

type AgentWithBeforePatchRead interface {
	BeforePatchRead(context.Context, *Agent, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type AgentWithBeforePatchSave

type AgentWithBeforePatchSave interface {
	BeforePatchSave(context.Context, *Agent, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type AgentWithBeforeToORM

type AgentWithBeforeToORM interface {
	BeforeToORM(context.Context, *AgentORM) error
}

AgentBeforeToORM called before default ToORM code

type AgentWithBeforeToPB

type AgentWithBeforeToPB interface {
	BeforeToPB(context.Context, *Agent) error
}

AgentBeforeToPB called before default ToPB code

type Channel

type Channel struct {

	// @gotags: display:"ID" readonly:"true" strict:"yes"
	Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty" display:"ID" readonly:"true" strict:"yes"`
	// @gotags: display:"Created at" readonly:"true" xml:"-"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty" display:"Created at" readonly:"true" xml:"-"`
	// @gotags: display:"Updated at" readonly:"true" xml:"-"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty" display:"Updated at" readonly:"true" xml:"-"`
	// Base
	Type          string `protobuf:"bytes,9,opt,name=Type,proto3" json:"Type,omitempty"`
	Direction     string `protobuf:"bytes,10,opt,name=Direction,proto3" json:"Direction,omitempty"`
	PeerID        string `protobuf:"bytes,11,opt,name=PeerID,proto3" json:"PeerID,omitempty"`
	Order         int32  `protobuf:"varint,12,opt,name=Order,proto3" json:"Order,omitempty"`
	Running       bool   `protobuf:"varint,13,opt,name=Running,proto3" json:"Running,omitempty"`
	Protocol      string `protobuf:"bytes,14,opt,name=Protocol,proto3" json:"Protocol,omitempty"`
	RemoteAddress string `protobuf:"bytes,15,opt,name=RemoteAddress,proto3" json:"RemoteAddress,omitempty"`
	LocalAddress  string `protobuf:"bytes,16,opt,name=LocalAddress,proto3" json:"LocalAddress,omitempty"` // Filled by the Connection type
	ProxyURL      string `protobuf:"bytes,17,opt,name=ProxyURL,proto3" json:"ProxyURL,omitempty"`
	// Malleable Profile = 13;
	// Also add a simpler field for querying URI/remotes.
	RawData           string `protobuf:"bytes,18,opt,name=RawData,proto3" json:"RawData,omitempty"`
	ReconnectInterval int64  `protobuf:"varint,21,opt,name=ReconnectInterval,proto3" json:"ReconnectInterval,omitempty"`
	Interval          int64  `protobuf:"varint,22,opt,name=Interval,proto3" json:"Interval,omitempty"`
	Jitter            int64  `protobuf:"varint,23,opt,name=Jitter,proto3" json:"Jitter,omitempty"`
	// Live
	Attempts    int32 `protobuf:"varint,30,opt,name=Attempts,proto3" json:"Attempts,omitempty"`
	Failures    int32 `protobuf:"varint,31,opt,name=Failures,proto3" json:"Failures,omitempty"`
	LastCheckin int64 `protobuf:"varint,32,opt,name=LastCheckin,proto3" json:"LastCheckin,omitempty"`
	NextCheckin int64 `protobuf:"varint,33,opt,name=NextCheckin,proto3" json:"NextCheckin,omitempty"`
	// contains filtered or unexported fields
}

Channel represents an active C2 communication channel between an Agent and an arbitrary counterpart (a server, a pivot agent, etc). This channel might not be active in the sense that communication is established, and might be simply "available" to an agent without it running and using it already.

func DefaultApplyFieldMaskChannel

func DefaultApplyFieldMaskChannel(ctx context.Context, patchee *Channel, patcher *Channel, updateMask *field_mask.FieldMask, prefix string, db *gorm.DB) (*Channel, error)

DefaultApplyFieldMaskChannel patches an pbObject with patcher according to a field mask.

func DefaultCreateChannel

func DefaultCreateChannel(ctx context.Context, in *Channel, db *gorm.DB) (*Channel, error)

DefaultCreateChannel executes a basic gorm create call

func DefaultListChannel

func DefaultListChannel(ctx context.Context, db *gorm.DB) ([]*Channel, error)

DefaultListChannel executes a gorm list call

func DefaultPatchChannel

func DefaultPatchChannel(ctx context.Context, in *Channel, updateMask *field_mask.FieldMask, db *gorm.DB) (*Channel, error)

DefaultPatchChannel executes a basic gorm update call with patch behavior

func DefaultPatchSetChannel

func DefaultPatchSetChannel(ctx context.Context, objects []*Channel, updateMasks []*field_mask.FieldMask, db *gorm.DB) ([]*Channel, error)

DefaultPatchSetChannel executes a bulk gorm update call with patch behavior

func DefaultReadChannel

func DefaultReadChannel(ctx context.Context, in *Channel, db *gorm.DB) (*Channel, error)

func DefaultStrictUpdateChannel

func DefaultStrictUpdateChannel(ctx context.Context, in *Channel, db *gorm.DB) (*Channel, error)

DefaultStrictUpdateChannel clears / replaces / appends first level 1:many children and then executes a gorm update call

func (*Channel) Descriptor deprecated

func (*Channel) Descriptor() ([]byte, []int)

Deprecated: Use Channel.ProtoReflect.Descriptor instead.

func (*Channel) GetAttempts

func (x *Channel) GetAttempts() int32

func (*Channel) GetCreatedAt

func (x *Channel) GetCreatedAt() *timestamppb.Timestamp

func (*Channel) GetDirection

func (x *Channel) GetDirection() string

func (*Channel) GetFailures

func (x *Channel) GetFailures() int32

func (*Channel) GetId

func (x *Channel) GetId() string

func (*Channel) GetInterval

func (x *Channel) GetInterval() int64

func (*Channel) GetJitter

func (x *Channel) GetJitter() int64

func (*Channel) GetLastCheckin

func (x *Channel) GetLastCheckin() int64

func (*Channel) GetLocalAddress

func (x *Channel) GetLocalAddress() string

func (*Channel) GetNextCheckin

func (x *Channel) GetNextCheckin() int64

func (*Channel) GetOrder

func (x *Channel) GetOrder() int32

func (*Channel) GetPeerID

func (x *Channel) GetPeerID() string

func (*Channel) GetProtocol

func (x *Channel) GetProtocol() string

func (*Channel) GetProxyURL

func (x *Channel) GetProxyURL() string

func (*Channel) GetRawData

func (x *Channel) GetRawData() string

func (*Channel) GetReconnectInterval

func (x *Channel) GetReconnectInterval() int64

func (*Channel) GetRemoteAddress

func (x *Channel) GetRemoteAddress() string

func (*Channel) GetRunning

func (x *Channel) GetRunning() bool

func (*Channel) GetType

func (x *Channel) GetType() string

func (*Channel) GetUpdatedAt

func (x *Channel) GetUpdatedAt() *timestamppb.Timestamp

func (*Channel) ProtoMessage

func (*Channel) ProtoMessage()

func (*Channel) ProtoReflect

func (x *Channel) ProtoReflect() protoreflect.Message

func (*Channel) Reset

func (x *Channel) Reset()

func (*Channel) String

func (x *Channel) String() string

func (*Channel) ToORM

func (m *Channel) ToORM(ctx context.Context) (ChannelORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type ChannelORM

type ChannelORM struct {
	AgentId           *string
	Attempts          int32
	CreatedAt         *time.Time
	Direction         string
	Failures          int32
	Id                string `gorm:"type:uuid;primaryKey"`
	Interval          int64
	Jitter            int64
	LastCheckin       int64
	LocalAddress      string
	NextCheckin       int64
	Order             int32
	PeerID            string
	Protocol          string
	ProxyURL          string
	RawData           string
	ReconnectInterval int64
	RemoteAddress     string
	Running           bool
	Type              string
	UpdatedAt         *time.Time
}

func (*ChannelORM) BeforeCreate

func (channel *ChannelORM) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM-specific autogenerated helpers.

func (ChannelORM) TableName

func (ChannelORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*ChannelORM) ToPB

func (m *ChannelORM) ToPB(ctx context.Context) (Channel, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type ChannelORMWithAfterCreate_

type ChannelORMWithAfterCreate_ interface {
	AfterCreate_(context.Context, *gorm.DB) error
}

type ChannelORMWithAfterDeleteSet

type ChannelORMWithAfterDeleteSet interface {
	AfterDeleteSet(context.Context, []*Channel, *gorm.DB) error
}

type ChannelORMWithAfterDelete_

type ChannelORMWithAfterDelete_ interface {
	AfterDelete_(context.Context, *gorm.DB) error
}

type ChannelORMWithAfterListFind

type ChannelORMWithAfterListFind interface {
	AfterListFind(context.Context, *gorm.DB, *[]ChannelORM) error
}

type ChannelORMWithAfterReadFind

type ChannelORMWithAfterReadFind interface {
	AfterReadFind(context.Context, *gorm.DB) error
}

type ChannelORMWithAfterStrictUpdateSave

type ChannelORMWithAfterStrictUpdateSave interface {
	AfterStrictUpdateSave(context.Context, *gorm.DB) error
}

type ChannelORMWithBeforeCreate_

type ChannelORMWithBeforeCreate_ interface {
	BeforeCreate_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeDeleteSet

type ChannelORMWithBeforeDeleteSet interface {
	BeforeDeleteSet(context.Context, []*Channel, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeDelete_

type ChannelORMWithBeforeDelete_ interface {
	BeforeDelete_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeListApplyQuery

type ChannelORMWithBeforeListApplyQuery interface {
	BeforeListApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeListFind

type ChannelORMWithBeforeListFind interface {
	BeforeListFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeReadApplyQuery

type ChannelORMWithBeforeReadApplyQuery interface {
	BeforeReadApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeReadFind

type ChannelORMWithBeforeReadFind interface {
	BeforeReadFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeStrictUpdateCleanup

type ChannelORMWithBeforeStrictUpdateCleanup interface {
	BeforeStrictUpdateCleanup(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelORMWithBeforeStrictUpdateSave

type ChannelORMWithBeforeStrictUpdateSave interface {
	BeforeStrictUpdateSave(context.Context, *gorm.DB) (*gorm.DB, error)
}

type ChannelWithAfterPatchSave

type ChannelWithAfterPatchSave interface {
	AfterPatchSave(context.Context, *Channel, *field_mask.FieldMask, *gorm.DB) error
}

type ChannelWithAfterToORM

type ChannelWithAfterToORM interface {
	AfterToORM(context.Context, *ChannelORM) error
}

ChannelAfterToORM called after default ToORM code

type ChannelWithAfterToPB

type ChannelWithAfterToPB interface {
	AfterToPB(context.Context, *Channel) error
}

ChannelAfterToPB called after default ToPB code

type ChannelWithBeforePatchApplyFieldMask

type ChannelWithBeforePatchApplyFieldMask interface {
	BeforePatchApplyFieldMask(context.Context, *Channel, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type ChannelWithBeforePatchRead

type ChannelWithBeforePatchRead interface {
	BeforePatchRead(context.Context, *Channel, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type ChannelWithBeforePatchSave

type ChannelWithBeforePatchSave interface {
	BeforePatchSave(context.Context, *Channel, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type ChannelWithBeforeToORM

type ChannelWithBeforeToORM interface {
	BeforeToORM(context.Context, *ChannelORM) error
}

ChannelBeforeToORM called before default ToORM code

type ChannelWithBeforeToPB

type ChannelWithBeforeToPB interface {
	BeforeToPB(context.Context, *Channel) error
}

ChannelBeforeToPB called before default ToPB code

type Task

type Task struct {

	// @gotags: display:"ID" readonly:"true" strict:"yes"
	Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty" display:"ID" readonly:"true" strict:"yes"`
	// @gotags: display:"Created at" readonly:"true" xml:"-"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty" display:"Created at" readonly:"true" xml:"-"`
	// @gotags: display:"Updated at" readonly:"true" xml:"-"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty" display:"Updated at" readonly:"true" xml:"-"`
	// @gotags: display:"Sent at" readonly:"true" xml:"-"
	SentAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=SentAt,proto3" json:"SentAt,omitempty" display:"Sent at" readonly:"true" xml:"-"`
	// @gotags: display:"Completed at" readonly:"true" xml:"-"
	CompletedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=CompletedAt,proto3" json:"CompletedAt,omitempty" display:"Completed at" readonly:"true" xml:"-"`
	// string AgentID = 10;
	State       string `protobuf:"bytes,10,opt,name=State,proto3" json:"State,omitempty"`
	Request     string `protobuf:"bytes,11,opt,name=Request,proto3" json:"Request,omitempty"`   // bytes
	Response    string `protobuf:"bytes,12,opt,name=Response,proto3" json:"Response,omitempty"` // bytes
	Description string `protobuf:"bytes,13,opt,name=Description,proto3" json:"Description,omitempty"`
	// contains filtered or unexported fields
}

Task represents a task to run on a target host, irrespective of C2 channel/types through which it's sent and its results received.

func DefaultApplyFieldMaskTask

func DefaultApplyFieldMaskTask(ctx context.Context, patchee *Task, patcher *Task, updateMask *field_mask.FieldMask, prefix string, db *gorm.DB) (*Task, error)

DefaultApplyFieldMaskTask patches an pbObject with patcher according to a field mask.

func DefaultCreateTask

func DefaultCreateTask(ctx context.Context, in *Task, db *gorm.DB) (*Task, error)

DefaultCreateTask executes a basic gorm create call

func DefaultListTask

func DefaultListTask(ctx context.Context, db *gorm.DB) ([]*Task, error)

DefaultListTask executes a gorm list call

func DefaultPatchSetTask

func DefaultPatchSetTask(ctx context.Context, objects []*Task, updateMasks []*field_mask.FieldMask, db *gorm.DB) ([]*Task, error)

DefaultPatchSetTask executes a bulk gorm update call with patch behavior

func DefaultPatchTask

func DefaultPatchTask(ctx context.Context, in *Task, updateMask *field_mask.FieldMask, db *gorm.DB) (*Task, error)

DefaultPatchTask executes a basic gorm update call with patch behavior

func DefaultReadTask

func DefaultReadTask(ctx context.Context, in *Task, db *gorm.DB) (*Task, error)

func DefaultStrictUpdateTask

func DefaultStrictUpdateTask(ctx context.Context, in *Task, db *gorm.DB) (*Task, error)

DefaultStrictUpdateTask clears / replaces / appends first level 1:many children and then executes a gorm update call

func (*Task) Descriptor deprecated

func (*Task) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetCompletedAt

func (x *Task) GetCompletedAt() *timestamppb.Timestamp

func (*Task) GetCreatedAt

func (x *Task) GetCreatedAt() *timestamppb.Timestamp

func (*Task) GetDescription

func (x *Task) GetDescription() string

func (*Task) GetId

func (x *Task) GetId() string

func (*Task) GetRequest

func (x *Task) GetRequest() string

func (*Task) GetResponse

func (x *Task) GetResponse() string

func (*Task) GetSentAt

func (x *Task) GetSentAt() *timestamppb.Timestamp

func (*Task) GetState

func (x *Task) GetState() string

func (*Task) GetUpdatedAt

func (x *Task) GetUpdatedAt() *timestamppb.Timestamp

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

func (x *Task) ProtoReflect() protoreflect.Message

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

func (*Task) ToORM

func (m *Task) ToORM(ctx context.Context) (TaskORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

type TaskORM

type TaskORM struct {
	AgentId     *string
	CompletedAt *time.Time
	CreatedAt   *time.Time
	Description string
	Id          string `gorm:"type:uuid;primaryKey"`
	Request     string
	Response    string
	SentAt      *time.Time
	State       string
	UpdatedAt   *time.Time
}

func (*TaskORM) BeforeCreate

func (task *TaskORM) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM-specific autogenerated helpers.

func (TaskORM) TableName

func (TaskORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*TaskORM) ToPB

func (m *TaskORM) ToPB(ctx context.Context) (Task, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type TaskORMWithAfterCreate_

type TaskORMWithAfterCreate_ interface {
	AfterCreate_(context.Context, *gorm.DB) error
}

type TaskORMWithAfterDeleteSet

type TaskORMWithAfterDeleteSet interface {
	AfterDeleteSet(context.Context, []*Task, *gorm.DB) error
}

type TaskORMWithAfterDelete_

type TaskORMWithAfterDelete_ interface {
	AfterDelete_(context.Context, *gorm.DB) error
}

type TaskORMWithAfterListFind

type TaskORMWithAfterListFind interface {
	AfterListFind(context.Context, *gorm.DB, *[]TaskORM) error
}

type TaskORMWithAfterReadFind

type TaskORMWithAfterReadFind interface {
	AfterReadFind(context.Context, *gorm.DB) error
}

type TaskORMWithAfterStrictUpdateSave

type TaskORMWithAfterStrictUpdateSave interface {
	AfterStrictUpdateSave(context.Context, *gorm.DB) error
}

type TaskORMWithBeforeCreate_

type TaskORMWithBeforeCreate_ interface {
	BeforeCreate_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeDeleteSet

type TaskORMWithBeforeDeleteSet interface {
	BeforeDeleteSet(context.Context, []*Task, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeDelete_

type TaskORMWithBeforeDelete_ interface {
	BeforeDelete_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeListApplyQuery

type TaskORMWithBeforeListApplyQuery interface {
	BeforeListApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeListFind

type TaskORMWithBeforeListFind interface {
	BeforeListFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeReadApplyQuery

type TaskORMWithBeforeReadApplyQuery interface {
	BeforeReadApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeReadFind

type TaskORMWithBeforeReadFind interface {
	BeforeReadFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeStrictUpdateCleanup

type TaskORMWithBeforeStrictUpdateCleanup interface {
	BeforeStrictUpdateCleanup(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskORMWithBeforeStrictUpdateSave

type TaskORMWithBeforeStrictUpdateSave interface {
	BeforeStrictUpdateSave(context.Context, *gorm.DB) (*gorm.DB, error)
}

type TaskWithAfterPatchSave

type TaskWithAfterPatchSave interface {
	AfterPatchSave(context.Context, *Task, *field_mask.FieldMask, *gorm.DB) error
}

type TaskWithAfterToORM

type TaskWithAfterToORM interface {
	AfterToORM(context.Context, *TaskORM) error
}

TaskAfterToORM called after default ToORM code

type TaskWithAfterToPB

type TaskWithAfterToPB interface {
	AfterToPB(context.Context, *Task) error
}

TaskAfterToPB called after default ToPB code

type TaskWithBeforePatchApplyFieldMask

type TaskWithBeforePatchApplyFieldMask interface {
	BeforePatchApplyFieldMask(context.Context, *Task, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type TaskWithBeforePatchRead

type TaskWithBeforePatchRead interface {
	BeforePatchRead(context.Context, *Task, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type TaskWithBeforePatchSave

type TaskWithBeforePatchSave interface {
	BeforePatchSave(context.Context, *Task, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type TaskWithBeforeToORM

type TaskWithBeforeToORM interface {
	BeforeToORM(context.Context, *TaskORM) error
}

TaskBeforeToORM called before default ToORM code

type TaskWithBeforeToPB

type TaskWithBeforeToPB interface {
	BeforeToPB(context.Context, *Task) error
}

TaskBeforeToPB called before default ToPB code

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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