models

package
v1.15.16 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: GPL-3.0 Imports: 10 Imported by: 10

Documentation

Index

Constants

View Source
const (
	PENDING   = "pending"
	SENT      = "sent"
	COMPLETED = "completed"
)

BeaconTask - Represents a host machine

Variables

This section is empty.

Functions

func GenerateOperatorToken added in v1.5.0

func GenerateOperatorToken() string

GenerateOperatorToken - Generate a new operator auth token

Types

type Beacon added in v1.5.0

type Beacon struct {
	CreatedAt time.Time `gorm:"->;<-:create;"`

	ID                uuid.UUID `gorm:"type:uuid;"`
	Name              string
	Hostname          string
	UUID              uuid.UUID `gorm:"type:uuid;"` // Host UUID
	Username          string
	UID               string
	GID               string
	OS                string
	Arch              string
	Transport         string
	RemoteAddress     string
	PID               int32
	Filename          string
	LastCheckin       time.Time
	Version           string
	ReconnectInterval int64
	ActiveC2          string
	ProxyURL          string

	ImplantBuildID uuid.UUID `gorm:"type:uuid;"`

	Interval    int64
	Jitter      int64
	NextCheckin int64

	Tasks []BeaconTask
}

Beacon - Represents a host machine

func (*Beacon) BeforeCreate added in v1.5.0

func (b *Beacon) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*Beacon) Task added in v1.5.0

func (b *Beacon) Task(envelope *sliverpb.Envelope) (*BeaconTask, error)

func (*Beacon) ToProtobuf added in v1.5.0

func (b *Beacon) ToProtobuf() *clientpb.Beacon

type BeaconTask added in v1.5.0

type BeaconTask struct {
	ID          uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	EnvelopeID  int64     `gorm:"uniqueIndex"`
	BeaconID    uuid.UUID `gorm:"type:uuid;"`
	CreatedAt   time.Time `gorm:"->;<-:create;"`
	State       string
	SentAt      time.Time
	CompletedAt time.Time
	Description string
	Request     []byte // *sliverpb.Envelope
	Response    []byte // *sliverpb.Envelope
}

func (*BeaconTask) BeforeCreate added in v1.5.0

func (b *BeaconTask) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*BeaconTask) ToProtobuf added in v1.5.0

func (b *BeaconTask) ToProtobuf(content bool) *clientpb.BeaconTask

type CanaryDomain

type CanaryDomain struct {
	ID              uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ImplantConfigID uuid.UUID
	CreatedAt       time.Time `gorm:"->;<-:create;"`

	Domain string
}

CanaryDomain - Canary domain, belongs to ImplantConfig

func (*CanaryDomain) BeforeCreate

func (c *CanaryDomain) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type Certificate

type Certificate struct {
	ID             uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt      time.Time `gorm:"->;<-:create;"`
	CommonName     string
	CAType         string
	KeyType        string
	CertificatePEM string
	PrivateKeyPEM  string
}

Certificate - Certificate database model

func (*Certificate) BeforeCreate

func (c *Certificate) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook to automatically set values

type DNSCanary

type DNSCanary struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	ImplantName   string
	Domain        string
	Triggered     bool
	FirstTrigger  time.Time
	LatestTrigger time.Time
	Count         uint32
}

DNSCanary - Colletions of content to serve from HTTP(S)

func (*DNSCanary) BeforeCreate

func (c *DNSCanary) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*DNSCanary) ToProtobuf

func (c *DNSCanary) ToProtobuf() *clientpb.DNSCanary

ToProtobuf - Converts to protobuf object

type ExtensionData added in v1.5.0

type ExtensionData struct {
	gorm.Model

	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	HostID    uuid.UUID `gorm:"type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Name   string
	Output string
}

ExtensionData - Represents an indicator of compromise, generally a file we've uploaded to a remote system.

func (*ExtensionData) BeforeCreate added in v1.5.0

func (e *ExtensionData) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type Host added in v1.5.0

type Host struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	HostUUID  uuid.UUID `gorm:"type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Hostname  string
	OSVersion string // Verbore OS version

	IOCs          []IOC
	ExtensionData []ExtensionData
}

Host - Represents a host machine

func (*Host) BeforeCreate added in v1.5.0

func (h *Host) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*Host) ToProtobuf added in v1.5.0

func (h *Host) ToProtobuf() *clientpb.Host

type IOC added in v1.5.0

type IOC struct {
	gorm.Model

	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	HostID    uuid.UUID `gorm:"type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Path     string
	FileHash string
}

IOC - Represents an indicator of compromise, generally a file we've uploaded to a remote system.

func (*IOC) BeforeCreate added in v1.5.0

func (i *IOC) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*IOC) ToProtobuf added in v1.5.0

func (i *IOC) ToProtobuf() *clientpb.IOC

type ImplantBuild

type ImplantBuild struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Name string `gorm:"unique;"`

	// Checksums stores of the implant binary
	MD5    string
	SHA1   string
	SHA256 string

	// Burned indicates whether the implant
	// has been seen on threat intel platforms
	Burned bool

	ImplantConfig ImplantConfig
}

ImplantBuild - Represents an implant

func (*ImplantBuild) BeforeCreate

func (ib *ImplantBuild) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type ImplantC2

type ImplantC2 struct {
	ID              uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ImplantConfigID uuid.UUID
	CreatedAt       time.Time `gorm:"->;<-:create;"`

	Priority uint32
	URL      string
	Options  string
}

ImplantC2 - C2 struct

func (*ImplantC2) BeforeCreate

func (c2 *ImplantC2) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*ImplantC2) String

func (c2 *ImplantC2) String() string

func (*ImplantC2) ToProtobuf

func (c2 *ImplantC2) ToProtobuf() *clientpb.ImplantC2

ToProtobuf - Convert to protobuf version

type ImplantConfig

type ImplantConfig struct {
	ID               uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ImplantBuildID   uuid.UUID
	ImplantProfileID uuid.UUID

	CreatedAt time.Time `gorm:"->;<-:create;"`

	// Go
	GOOS   string
	GOARCH string

	IsBeacon       bool
	BeaconInterval int64
	BeaconJitter   int64

	// ECC
	ECCPublicKey            string
	ECCPublicKeyDigest      string
	ECCPrivateKey           string
	ECCPublicKeySignature   string
	ECCServerPublicKey      string
	MinisignServerPublicKey string

	// MTLS
	MtlsCACert string
	MtlsCert   string
	MtlsKey    string

	Debug               bool
	Evasion             bool
	ObfuscateSymbols    bool
	ReconnectInterval   int64
	MaxConnectionErrors uint32
	ConnectionStrategy  string

	// WireGuard
	WGImplantPrivKey  string
	WGServerPubKey    string
	WGPeerTunIP       string
	WGKeyExchangePort uint32
	WGTcpCommsPort    uint32

	C2 []ImplantC2

	MTLSc2Enabled bool
	WGc2Enabled   bool
	HTTPc2Enabled bool
	DNSc2Enabled  bool

	CanaryDomains     []CanaryDomain
	NamePipec2Enabled bool
	TCPPivotc2Enabled bool

	// Limits
	LimitDomainJoined bool
	LimitHostname     string
	LimitUsername     string
	LimitDatetime     string
	LimitFileExists   string

	// Output Format
	Format clientpb.OutputFormat

	// For 	IsSharedLib bool
	IsSharedLib bool
	IsService   bool
	IsShellcode bool

	RunAtLoad bool

	FileName string
}

ImplantConfig - An implant build configuration

func (*ImplantConfig) BeforeCreate

func (ic *ImplantConfig) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*ImplantConfig) CanaryDomainsList

func (ic *ImplantConfig) CanaryDomainsList() []string

CanaryDomainsList - Get string slice of canary domains

func (*ImplantConfig) ToProtobuf

func (ic *ImplantConfig) ToProtobuf() *clientpb.ImplantConfig

ToProtobuf - Convert ImplantConfig to protobuf equiv

type ImplantProfile

type ImplantProfile struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Name          string `gorm:"unique;"`
	ImplantConfig *ImplantConfig
}

ImplantProfile - An implant build configuration

func (*ImplantProfile) BeforeCreate

func (ip *ImplantProfile) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type KeyValue added in v1.5.0

type KeyValue struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Key   string `gorm:"unique;"`
	Value string
}

KeyValue - Represents an implant

func (*KeyValue) BeforeCreate added in v1.5.0

func (k *KeyValue) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type Loot added in v1.4.18

type Loot struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Type           int
	FileType       int
	CredentialType int
	Name           string

	OriginHost uuid.UUID `gorm:"type:uuid;"`
}

Loot - Represents a piece of loot

func (*Loot) BeforeCreate added in v1.4.18

func (l *Loot) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type Operator added in v1.5.0

type Operator struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`
	Name      string
	Token     string `gorm:"uniqueIndex"`
}

Operator - Colletions of content to serve from HTTP(S)

func (*Operator) BeforeCreate added in v1.5.0

func (o *Operator) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

type WGKeys added in v1.4.9

type WGKeys struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`
	PrivKey   string
	PubKey    string
}

WGKeys - WGKeys database model

func (*WGKeys) BeforeCreate added in v1.4.9

func (c *WGKeys) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook to automatically set values

type WGPeer added in v1.4.9

type WGPeer struct {
	// gorm.Model
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`
	PrivKey   string
	PubKey    string
	TunIP     string
}

WGPeer- WGPeer database model

func (*WGPeer) BeforeCreate added in v1.4.9

func (c *WGPeer) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook to automatically set values

type WebContent

type WebContent struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	WebsiteID uuid.UUID `gorm:"type:uuid;"`

	Path        string `gorm:"primaryKey"`
	Size        int
	ContentType string
}

WebContent - One piece of content mapped to a path

func (*WebContent) BeforeCreate

func (wc *WebContent) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook to automatically set values

func (*WebContent) ToProtobuf

func (wc *WebContent) ToProtobuf(content []byte) *clientpb.WebContent

ToProtobuf - Converts to protobuf object

type Website

type Website struct {
	ID        uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`

	Name string `gorm:"unique;"` // Website Name

	WebContents []WebContent
}

Website - Colletions of content to serve from HTTP(S)

func (*Website) BeforeCreate

func (w *Website) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate - GORM hook

func (*Website) ToProtobuf

func (w *Website) ToProtobuf() *clientpb.Website

ToProtobuf - Converts to protobuf object

Jump to

Keyboard shortcuts

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