models

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: GPL-3.0 Imports: 20 Imported by: 15

README

server/db/models

Overview

Database models and ORM definitions for server state. Defines data schemas, relationships, and query helpers. Key routines cover beacon, canary, certificates, and crackstations within the models subsystem.

Go Files

  • beacon.go – Defines the beacon ORM model and associated relations.
  • canary.go – Stores DNS canary records and status flags.
  • certificates.go – Persists certificate metadata for listeners and operators.
  • crackstations.go – Models cracking nodes and benchmark data.
  • credentials.go – Holds captured credential entries and tags.
  • host.go – Represents discovered hosts and host-specific metadata.
  • http-c2.go – Stores HTTP C2 configuration data.
  • implant.go – Tracks implant builds, configs, and artifacts.
  • jobs.go – Records long-running server jobs and status.
  • keyex.go – Persists key exchange state for implants.
  • keyvalue.go – Generic key/value storage for misc settings.
  • loot.go – Describes loot artifacts and file locations.
  • monitor.go – Stores monitoring job configurations.
  • operator.go – Represents operators, permissions, and MFA data.
  • resource_id.go – Allocates human-readable resource identifiers.
  • website.go – Captures hosted website configurations and assets.
  • wgkeys.go – Stores WireGuard peer keys and metadata.

Documentation

Index

Constants

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

BeaconTask - Represents a host machine

View Source
const (
	DefaultChromeBaseVer = 106
	DefaultMacOSVer      = "10_15_7"
)

Variables

This section is empty.

Functions

func ChromeVer added in v1.6.0

func ChromeVer(baseVer int32) string

ChromeVer - Generate a random Chrome user-agent

func GenerateOperatorToken added in v1.5.0

func GenerateOperatorToken() string

GenerateOperatorToken - Generate a new operator auth token

func GenerateUserAgent added in v1.6.0

func GenerateUserAgent(goos string, goarch string, userAgent string, baseVer int32, macOsVer string) string

GenerateUserAgent - Generate a user-agent depending on OS/Arch

func IsC2Enabled added in v1.6.0

func IsC2Enabled(schemes []string, c2s []*clientpb.ImplantC2) bool

func MacOSVer added in v1.6.0

func MacOSVer(MacOSVersion string) string

func RandomFiles added in v1.6.0

func RandomFiles(httpC2PathSegments []*clientpb.HTTPC2PathSegment, MinFileGen int32, MaxFileGen int32) []*clientpb.HTTPC2PathSegment

func RandomPathSegments added in v1.6.0

func RandomPathSegments(h *clientpb.HTTPC2ImplantConfig) []*clientpb.HTTPC2PathSegment

func RandomPaths added in v1.6.0

func RandomPaths(httpC2PathSegments []*clientpb.HTTPC2PathSegment, minPaths int32, maxPaths int32) []*clientpb.HTTPC2PathSegment

func RandomizeImplantConfig added in v1.6.0

func RandomizeImplantConfig(h *clientpb.HTTPC2ImplantConfig, goos string, goarch string) *clientpb.HTTPC2ImplantConfig

RandomImplantConfig - Randomly generate a new implant config from the parent config, this is the primary configuration used by the implant generation.

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
	Locale            string
	Integrity         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      int64
	CompletedAt int64
	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 Benchmark added in v1.6.0

type Benchmark struct {
	ID             uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt      time.Time `gorm:"->;<-:create;"`
	CrackstationID uuid.UUID `gorm:"type:uuid;"`
	HashType       int32
	PerSecondRate  uint64
}

Benchmark - Performance information about the crackstation

func (*Benchmark) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

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 CrackCommand added in v1.6.0

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

	// FLAGS
	AttackMode             int32
	HashType               int32
	Hashes                 []string `gorm:"type:text"`
	Quiet                  bool
	HexCharset             bool
	HexSalt                bool
	HexWordlist            bool
	Force                  bool
	DeprecatedCheckDisable bool
	Status                 bool
	StatusJSON             bool
	StatusTimer            uint32
	StdinTimeoutAbort      uint32
	MachineReadable        bool
	KeepGuessing           bool
	SelfTestDisable        bool
	Loopback               bool
	// MarkovHcstat2          []byte
	MarkovDisable   bool
	MarkovClassic   bool
	MarkovInverse   bool
	MarkovThreshold uint32
	Runtime         uint32
	Session         string
	Restore         bool
	RestoreDisable  bool
	// RestoreFile            []byte
	// --outfile FILE (28)
	OutfileFormat          []int32 `gorm:"type:integer[]"`
	OutfileAutohexDisable  bool
	OutfileCheckTimer      uint32
	WordlistAutohexDisable bool
	Separator              string
	Stdout                 bool
	Show                   bool
	Left                   bool
	Username               bool
	Remove                 bool
	RemoveTimer            uint32
	PotfileDisable         bool
	// Potfile                []byte
	EncodingFrom int32
	EncodingTo   int32
	DebugMode    uint32
	// --debug-file FILE (45)
	// --induction-dir DIR (46)
	// --outfile-check-dir DIR (47)
	LogfileDisable        bool
	HccapxMessagePair     uint32
	NonceErrorCorrections uint32
	// KeyboardLayoutMapping []byte
	// --truecrypt-keyfiles FILE (52)
	// --veracrypt-keyfiles FILE (53)
	// --veracrypt-pim-start PIM (54)
	// --veracrypt-pim-stop PIM (55)
	Benchmark    bool
	BenchmarkAll bool
	SpeedOnly    bool
	ProgressOnly bool
	SegmentSize  uint32
	BitmapMin    uint32
	BitmapMax    uint32
	CPUAffinity  []uint32 `gorm:"type:integer[]"`
	HookThreads  uint32
	HashInfo     bool
	// --example-hashes (66)
	BackendIgnoreCUDA     bool
	BackendIgnoreHip      bool
	BackendIgnoreMetal    bool
	BackendIgnoreOpenCL   bool
	BackendInfo           bool
	BackendDevices        []uint32 `gorm:"type:integer[]"`
	OpenCLDeviceTypes     []uint32 `gorm:"type:integer[]"`
	OptimizedKernelEnable bool
	MultiplyAccelDisabled bool
	WorkloadProfile       int32
	KernelAccel           uint32
	KernelLoops           uint32
	KernelThreads         uint32
	BackendVectorWidth    uint32
	SpinDamp              uint32
	HwmonDisable          bool
	HwmonTempAbort        uint32
	ScryptTMTO            uint32
	Skip                  uint64
	Limit                 uint64
	Keyspace              bool
	// --rule-left (88)
	// --rule-right (89)
	// RulesFile             []byte
	GenerateRules         uint32
	GenerateRulesFunMin   uint32
	GenerateRulesFunMax   uint32
	GenerateRulesFuncSel  string
	GenerateRulesSeed     int32
	CustomCharset1        string
	CustomCharset2        string
	CustomCharset3        string
	CustomCharset4        string
	Identify              string
	Increment             bool
	IncrementMin          uint32
	IncrementMax          uint32
	SlowCandidates        bool
	BrainServer           bool
	BrainServerTimer      uint32
	BrainClient           bool
	BrainClientFeatures   string
	BrainHost             string
	BrainPort             uint32
	BrainPassword         string
	BrainSession          string
	BrainSessionWhitelist string
}

func (*CrackCommand) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (CrackCommand) FromProtobuf added in v1.6.0

func (CrackCommand) FromProtobuf(c *clientpb.CrackCommand) *CrackCommand

func (*CrackCommand) ToProtobuf added in v1.6.0

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

type CrackFile added in v1.6.0

type CrackFile struct {
	ID               uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt        time.Time `gorm:"->;<-:create;"`
	LastModified     time.Time
	Name             string
	UncompressedSize int64
	Sha2_256         string
	Type             int32
	IsCompressed     bool
	IsComplete       bool

	Chunks []CrackFileChunk
}

CrackFile - Performance information about the crackstation

func (*CrackFile) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (*CrackFile) MaxN added in v1.6.0

func (c *CrackFile) MaxN(chunkSize int64) uint32

func (*CrackFile) ToProtobuf added in v1.6.0

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

type CrackFileChunk added in v1.6.0

type CrackFileChunk struct {
	ID          uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CrackFileID uuid.UUID `gorm:"type:uuid;"`
	N           uint32
}

CrackFileChunk - Performance information about the crackstation

func (*CrackFileChunk) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (*CrackFileChunk) ToProtobuf added in v1.6.0

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

type CrackJob added in v1.6.0

type CrackJob struct {
	ID          uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	CreatedAt   time.Time `gorm:"->;<-:create;"`
	CompletedAt time.Time
	Tasks       []CrackTask

	Command CrackCommand // Parent command
}

CrackJob - A crack job is a collection of one or more crack tasks, the crack job contains the parent command, whose keyspace may get broken up into multiple crack tasks and distributed to multiple crackstations

func (*CrackJob) Status added in v1.6.0

func (c *CrackJob) Status() clientpb.CrackJobStatus

type CrackTask added in v1.6.0

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

	Command CrackCommand
}

CrackTask - An individual chunk of a job sent to a specific crackstation

func (*CrackTask) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (CrackTask) FromProtobuf added in v1.6.0

func (CrackTask) FromProtobuf(c *clientpb.CrackTask) *CrackTask

func (*CrackTask) ToProtobuf added in v1.6.0

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

type Crackstation added in v1.6.0

type Crackstation struct {
	// ID = crackstation name
	ID         uuid.UUID `gorm:"primaryKey;type:uuid;"`
	CreatedAt  time.Time `gorm:"->;<-:create;"`
	Tasks      []CrackTask
	Benchmarks []Benchmark
}

Crackstation - History of crackstation jobs

func (*Crackstation) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

type Credential added in v1.6.0

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

	Collection string
	Username   string
	Plaintext  string
	Hash       string // https://hashcat.net/wiki/doku.php?id=example_hashes
	HashType   int32
	IsCracked  bool
}

Credential - Represents a piece of loot

func (*Credential) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (*Credential) ToProtobuf added in v1.6.0

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

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 DNSCanaryFromProtobuf added in v1.6.0

func DNSCanaryFromProtobuf(m *clientpb.DNSCanary) DNSCanary

convert from protobuf

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 DNSListener added in v1.6.0

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

	Domains    []DnsDomain
	Canaries   bool
	Host       string
	Port       uint32
	EnforceOtp bool
}

func (*DNSListener) BeforeCreate added in v1.6.0

func (j *DNSListener) BeforeCreate(tx *gorm.DB) (err error)

func (*DNSListener) ToProtobuf added in v1.6.0

func (j *DNSListener) ToProtobuf() *clientpb.DNSListenerReq

type DnsDomain added in v1.6.0

type DnsDomain struct {
	ID            uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	DNSListenerID uuid.UUID `gorm:"type:uuid;"`
	Domain        string
}

type EncoderAsset added in v1.6.0

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

	Name string
}

EncoderAsset - Tracks which assets were embedded into the implant but we currently don't keep a copy of the actual data

func (*EncoderAsset) ToProtobuf added in v1.6.0

func (t *EncoderAsset) ToProtobuf() *commonpb.File

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 HTTPListener added in v1.6.0

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

	Domain          string
	Host            string
	Port            uint32
	Secure          bool
	Website         string
	Cert            []byte
	Key             []byte
	Acme            bool
	EnforceOtp      bool
	LongPollTimeout int64
	LongPollJitter  int64
	RandomizeJarm   bool
	Staging         bool
}

func (*HTTPListener) BeforeCreate added in v1.6.0

func (j *HTTPListener) BeforeCreate(tx *gorm.DB) (err error)

func (*HTTPListener) ToProtobuf added in v1.6.0

func (j *HTTPListener) ToProtobuf() *clientpb.HTTPListenerReq

type Host added in v1.5.0

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

	Hostname  string
	OSVersion string // Verbose OS version
	Locale    string // Detected language code

	IOCs          []IOC           `gorm:"foreignKey:HostID;references:HostUUID"`
	ExtensionData []ExtensionData `gorm:"foreignKey:HostID;references:HostUUID"`
}

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 HttpC2Config added in v1.6.0

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

	Name string `gorm:"unique;"`

	ServerConfig  HttpC2ServerConfig
	ImplantConfig HttpC2ImplantConfig
}

HttpC2Config -

func HTTPC2ConfigFromProtobuf added in v1.6.0

func HTTPC2ConfigFromProtobuf(pbHttpC2Config *clientpb.HTTPC2Config) *HttpC2Config

HTTPC2ConfigFromProtobuf - Create a native config struct from Protobuf

func (*HttpC2Config) BeforeCreate added in v1.6.0

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

func (*HttpC2Config) ToProtobuf added in v1.6.0

func (h *HttpC2Config) ToProtobuf() *clientpb.HTTPC2Config

type HttpC2Cookie added in v1.6.0

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

	Name string
}

HttpC2Cookie - HTTP C2 Cookie (server only)

func (*HttpC2Cookie) BeforeCreate added in v1.6.0

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

func (*HttpC2Cookie) ToProtobuf added in v1.6.0

func (h *HttpC2Cookie) ToProtobuf() *clientpb.HTTPC2Cookie

type HttpC2Header added in v1.6.0

type HttpC2Header struct {
	ID                    uuid.UUID  `gorm:"primaryKey;->;<-:create;type:uuid;"`
	HttpC2ServerConfigID  *uuid.UUID `gorm:"type:uuid;"`
	HttpC2ImplantConfigID *uuid.UUID `gorm:"type:uuid;"`

	Method      string
	Name        string
	Value       string
	Probability int32
}

HttpC2Header - HTTP C2 Header (server and implant)

func (*HttpC2Header) BeforeCreate added in v1.6.0

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

func (*HttpC2Header) ToProtobuf added in v1.6.0

func (h *HttpC2Header) ToProtobuf() *clientpb.HTTPC2Header

type HttpC2ImplantConfig added in v1.6.0

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

	UserAgent          string
	ChromeBaseVersion  int32
	MacOSVersion       string
	NonceQueryArgChars string
	ExtraURLParameters []HttpC2URLParameter
	Headers            []HttpC2Header

	// File/Path Generation subset size of the http config to select during generation
	// see randomSample function
	MaxFileGen int32
	MinFileGen int32
	MaxPathGen int32
	MinPathGen int32

	// implant configuration for path length
	MaxPathLength int32
	MinPathLength int32

	// gorm doesn not support string arrays apparently
	Extensions string

	PathSegments     []HttpC2PathSegment
	NonceQueryLength int32
	NonceMode        string
}

HttpC2ImplantConfig - HTTP C2 Implant Configuration

func (*HttpC2ImplantConfig) BeforeCreate added in v1.6.0

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

func (*HttpC2ImplantConfig) ToProtobuf added in v1.6.0

type HttpC2PathSegment added in v1.6.0

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

	IsFile      bool
	SegmentType int32 // Poll, Session, Close
	Value       string
}

HttpC2PathSegment - Represents a list of file/path URL segments (implant only)

func (*HttpC2PathSegment) BeforeCreate added in v1.6.0

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

func (*HttpC2PathSegment) ToProtobuf added in v1.6.0

func (h *HttpC2PathSegment) ToProtobuf() *clientpb.HTTPC2PathSegment

type HttpC2ServerConfig added in v1.6.0

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

	RandomVersionHeaders bool
	Headers              []HttpC2Header
	Cookies              []HttpC2Cookie
}

HttpC2ServerConfig - HTTP C2 Server Configuration

func (*HttpC2ServerConfig) BeforeCreate added in v1.6.0

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

func (*HttpC2ServerConfig) ToProtobuf added in v1.6.0

type HttpC2URLParameter added in v1.6.0

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

	Method      string // HTTP Method
	Name        string // Name of URL parameter, must be 3+ characters
	Value       string // Value of the URL parameter
	Probability int32  // 0 - 100
}

HttpC2URLParameter - Extra URL parameters (implant only)

func (*HttpC2URLParameter) BeforeCreate added in v1.6.0

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

func (*HttpC2URLParameter) ToProtobuf added in v1.6.0

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

	// Resource ID referencing build
	ImplantID uint64

	ImplantConfigID uuid.UUID

	// ECC
	PeerPublicKey           string
	PeerPublicKeyDigest     string
	PeerPrivateKey          string
	PeerPublicKeySignature  string
	AgeServerPublicKey      string
	MinisignServerPublicKey string

	// MTLS
	MtlsCACert string
	MtlsCert   string
	MtlsKey    string

	// WireGuard
	WGImplantPrivKey string
	WGServerPubKey   string

	Stage bool
}

ImplantBuild - Represents an implant

func ImplantBuildFromProtobuf added in v1.6.0

func ImplantBuildFromProtobuf(ib *clientpb.ImplantBuild) *ImplantBuild

func (*ImplantBuild) BeforeCreate

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

BeforeCreate - GORM hook

func (*ImplantBuild) ToProtobuf added in v1.6.0

func (ib *ImplantBuild) ToProtobuf() *clientpb.ImplantBuild

Convert ImplantBuild To Protobuf

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;"`
	ImplantProfileID *uuid.UUID

	ImplantBuilds []ImplantBuild
	CreatedAt     time.Time `gorm:"->;<-:create;"`

	// Go
	GOOS   string
	GOARCH string

	TemplateName string

	IsBeacon       bool
	BeaconInterval int64
	BeaconJitter   int64

	Debug               bool
	DebugFile           string
	Evasion             bool
	ObfuscateSymbols    bool
	ReconnectInterval   int64
	PollTimeout         int64
	MaxConnectionErrors uint32
	ConnectionStrategy  string
	SGNEnabled          bool
	Exports             string

	// WireGuard
	WGPeerTunIP       string
	WGKeyExchangePort uint32
	WGTcpCommsPort    uint32

	C2 []ImplantC2

	IncludeMTLS bool
	IncludeWG   bool
	IncludeHTTP bool
	IncludeDNS  bool

	CanaryDomains   []CanaryDomain
	IncludeNamePipe bool
	IncludeTCP      bool

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

	// Output Format
	Format clientpb.OutputFormat

	// For 	IsSharedLib bool
	IsSharedLib bool
	IsService   bool
	IsShellcode bool

	RunAtLoad bool

	HttpC2ConfigName       string
	NetGoEnabled           bool
	TrafficEncodersEnabled bool
	Assets                 []EncoderAsset
	Extension              string
}

ImplantConfig - An implant build configuration

func ImplantConfigFromProtobuf added in v1.6.0

func ImplantConfigFromProtobuf(pbConfig *clientpb.ImplantConfig) *ImplantConfig

ImplantConfigFromProtobuf - Create a native config struct from Protobuf

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 ImplantProfileFromProtobuf added in v1.6.0

func ImplantProfileFromProtobuf(pbProfile *clientpb.ImplantProfile) *ImplantProfile

ImplantProfileFromProtobuf - Create a native profile struct from Protobuf

func (*ImplantProfile) BeforeCreate

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

BeforeCreate - GORM hook

func (*ImplantProfile) ToProtobuf added in v1.6.0

func (ip *ImplantProfile) ToProtobuf() *clientpb.ImplantProfile

ToProtobuf - Convert ImplantProfile to protobuf equiv

type KeyExHistory added in v1.6.0

type KeyExHistory struct {
	Sha256    string    `gorm:"primaryKey;"`
	CreatedAt time.Time `gorm:"->;<-:create;"`
}

KeyExHistory - Represents an implant

func (*KeyExHistory) BeforeCreate added in v1.6.0

func (k *KeyExHistory) 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 ListenerJob added in v1.6.0

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

	JobID               uint32 `gorm:"unique;"`
	Type                string
	HttpListener        HTTPListener
	MtlsListener        MtlsListener
	DnsListener         DNSListener
	WgListener          WGListener
	MultiplayerListener MultiplayerListener
}

func ListenerJobFromProtobuf added in v1.6.0

func ListenerJobFromProtobuf(pbListenerJob *clientpb.ListenerJob) *ListenerJob

to model

func (*ListenerJob) BeforeCreate added in v1.6.0

func (j *ListenerJob) BeforeCreate(tx *gorm.DB) (err error)

orm hooks

func (*ListenerJob) ToProtobuf added in v1.6.0

func (j *ListenerJob) ToProtobuf() *clientpb.ListenerJob

To Protobuf

type Loot added in v1.4.18

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

	FileType int
	Name     string
	Size     int64

	OriginHostID 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

func (*Loot) ToProtobuf added in v1.6.0

func (l *Loot) ToProtobuf() *clientpb.Loot

type MonitoringProvider added in v1.6.0

type MonitoringProvider struct {
	ID          uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	Type        string    // currently vt or xforce
	APIKey      string
	APIPassword string
}

func MonitorFromProtobuf added in v1.6.0

func MonitorFromProtobuf(m *clientpb.MonitoringProvider) MonitoringProvider

convert from protobuf

func (*MonitoringProvider) BeforeCreate added in v1.6.0

func (m *MonitoringProvider) BeforeCreate(tx *gorm.DB) (err error)

func (*MonitoringProvider) ToProtobuf added in v1.6.0

convert to protobuf

type MtlsListener added in v1.6.0

type MtlsListener struct {
	ID            uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ListenerJobID uuid.UUID `gorm:"type:uuid;"`
	Host          string
	Port          uint32
}

func (*MtlsListener) BeforeCreate added in v1.6.0

func (j *MtlsListener) BeforeCreate(tx *gorm.DB) (err error)

func (*MtlsListener) ToProtobuf added in v1.6.0

func (j *MtlsListener) ToProtobuf() *clientpb.MTLSListenerReq

type MultiplayerListener added in v1.6.0

type MultiplayerListener struct {
	ID            uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ListenerJobID uuid.UUID `gorm:"type:uuid;"`
	Host          string
	Port          uint32
}

func (*MultiplayerListener) ToProtobuf added in v1.6.0

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"`   // NOTE: This is the SHA256 of the token
	PermissionAll          bool   `gorm:"default:false"` // Access all gRPC APIs
	PermissionBuilder      bool   `gorm:"default:false"` // Access Builder gRPC APIs
	PermissionCrackstation bool   `gorm:"default:false"` // Access Crackstation gRPC APIs
}

Operator - Collections 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 ResourceID added in v1.6.0

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

	Type  string // encoder or stager
	Name  string
	Value uint64 // prime number used to reference resource in requests
}

Host - Represents a host machine

func (*ResourceID) BeforeCreate added in v1.6.0

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

BeforeCreate - GORM hook

func (*ResourceID) ToProtobuf added in v1.6.0

func (rid *ResourceID) ToProtobuf() *clientpb.ResourceID

ToProtobuf - Converts to protobuf object

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 WGListener added in v1.6.0

type WGListener struct {
	ID            uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
	ListenerJobID uuid.UUID `gorm:"type:uuid;"`
	Host          string
	Port          uint32
	NPort         uint32
	KeyPort       uint32
	TunIP         string
}

func (*WGListener) BeforeCreate added in v1.6.0

func (j *WGListener) BeforeCreate(tx *gorm.DB) (err error)

func (*WGListener) ToProtobuf added in v1.6.0

func (j *WGListener) ToProtobuf() *clientpb.WGListenerReq

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        uint64
	ContentType string
}

WebContent - One piece of content mapped to a path

func WebContentFromProtobuf added in v1.6.0

func WebContentFromProtobuf(pbWebContent *clientpb.WebContent) WebContent

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(webContentDir string) *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