Documentation
¶
Index ¶
- Constants
- Variables
- func FromRegister(register *implantpb.Register) string
- func ToRegister(context string) *implantpb.Register
- type Artifact
- type AuthzRule
- type Certificate
- type Context
- type Operator
- type Pipeline
- func (pipeline *Pipeline) Address() string
- func (pipeline *Pipeline) AfterFind(tx *gorm.DB) error
- func (pipeline *Pipeline) BeforeCreate(tx *gorm.DB) (err error)
- func (pipeline *Pipeline) BeforeSave(tx *gorm.DB) error
- func (pipeline *Pipeline) DefaultHTTPProfile() implanttypes.ProfileConfig
- func (pipeline *Pipeline) DefaultRemProfile(backend *Pipeline) implanttypes.ProfileConfig
- func (pipeline *Pipeline) DefaultTCPProfile() implanttypes.ProfileConfig
- func (pipeline *Pipeline) GetUrl() string
- func (pipeline *Pipeline) ToProfile(backend *Pipeline) (implanttypes.ProfileConfig, error)
- func (pipeline *Pipeline) ToProtobuf() *clientpb.Pipeline
- type Profile
- type Session
- type Task
- type Timer
- type WebsiteContent
Constants ¶
View Source
const ( RoleAdmin = "admin" // Full access, can manage operators and rules RoleOperator = "operator" // Access to MaliceRPC (implant operations) RoleListener = "listener" // Access to ListenerRPC only )
Role constants for operator authorization
Variables ¶
View Source
var ValidRoles = []string{RoleAdmin, RoleOperator, RoleListener}
ValidRoles is the set of recognized role values.
Functions ¶
func FromRegister ¶ added in v0.0.3
FromRegister - convert session to context json string
func ToRegister ¶ added in v0.0.3
Types ¶
type Artifact ¶ added in v0.1.1
type Artifact struct {
ID uint32 `gorm:"primaryKey;autoIncrement"`
Name string `gorm:"unique"`
ProfileName string `gorm:"index;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
UpdatedAt time.Time `gorm:"->;<-:update;"`
Target string // build target, like win64, win32, linux64
Type string // beacon、pulse、modules、prelude
//Type string // build type, pe, dll, shellcode
Source string // docker 、 saas 、github action、upload...
//CA string // ca file , ca file content
Path string
Profile Profile `gorm:"foreignKey:ProfileName;references:Name;-:migration;"`
Os string
Format string // file extension like .exe/.dll/.so/.dylib or ""
Arch string
Log string
Status string
ParamsData string
Params *implanttypes.ProfileParams `gorm:"-"`
ProfileByte []byte
Comment string
}
func (*Artifact) BeforeCreate ¶ added in v0.1.1
func (*Artifact) BeforeSave ¶ added in v0.1.1
BeforeSave GORM 钩子 - 保存前将 Params 序列化
func (*Artifact) ToArtifact ¶ added in v0.1.2
type AuthzRule ¶ added in v0.3.0
type AuthzRule struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
Role string `gorm:"index;type:string;"`
Method string `gorm:"type:string;"`
Allow bool `gorm:"default:true"`
}
AuthzRule maps a role to allowed (or denied) gRPC method patterns. Pattern supports:
- Exact match: "/clientrpc.MaliceRPC/GetSessions"
- Service wildcard: "/clientrpc.MaliceRPC/*"
- Package prefix: "/listenerrpc.*"
type Certificate ¶
type Certificate struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
Name string `gorm:"unique"`
Type string // 证书类型: selfsigned, letsencrypt, imported
Domain string // 证书绑定域名
CertPEM string // 证书内容 PEM
KeyPEM string // 私钥内容 PEM
CACertPEM string // CA 证书内容 PEM
CAKeyPEM string // CA 私钥内容 PEM
}
func (*Certificate) BeforeCreate ¶
func (c *Certificate) BeforeCreate(tx *gorm.DB) (err error)
BeforeCreate - GORM hook 自动设置ID和创建时间
func (*Certificate) ToProtobuf ¶ added in v0.1.1
func (c *Certificate) ToProtobuf() *clientpb.TLS
type Context ¶ added in v0.1.0
type Context struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid"`
CreatedAt time.Time `gorm:"->;<-:create"`
UpdatedAt time.Time
SessionID string `gorm:"type:string;index;"`
PipelineID string `gorm:"type:string;index;"`
TaskID string `gorm:"type:string;index;"`
Type string
Nonce string
Value []byte
Context output.Context `gorm:"-"`
Session *Session `gorm:"foreignKey:SessionID;references:SessionID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Task *Task `gorm:"foreignKey:TaskID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}
func FromContextProtobuf ¶ added in v0.1.0
func (*Context) BeforeCreate ¶ added in v0.1.0
func (*Context) ToProtobuf ¶ added in v0.1.0
type Operator ¶
type Operator struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
Name string `gorm:"uniqueIndex"`
Remote string `gorm:"type:string;"`
Type string `gorm:"type:string;"`
Role string `gorm:"type:string;default:'operator'"`
Fingerprint string `gorm:"uniqueIndex;type:string;"`
Revoked bool `gorm:"default:false"`
CAType int
KeyType string
CaCertificatePEM string
CertificatePEM string
PrivateKeyPEM string
}
Operator represents a registered client or listener identity.
func (*Operator) BeforeCreate ¶
BeforeCreate - GORM hook
func (*Operator) ToListener ¶ added in v0.1.0
func (*Operator) ToProtobuf ¶ added in v0.1.0
type Pipeline ¶ added in v0.0.2
type Pipeline struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
ListenerId string `gorm:"type:string;uniqueIndex:idx_pipelines_listener_name"`
Name string `gorm:"type:string;unique;uniqueIndex:idx_pipelines_listener_name"`
IP string `gorm:"type:string;default:''"`
Host string `config:"host"`
Port uint32 `config:"port"`
Type string `gorm:"type:string;"`
Enable bool `gorm:"type:boolean;"`
ParamsData string `gorm:"column:params"`
CertName string `gorm:"type:string;"`
*implanttypes.PipelineParams `gorm:"-"`
}
Pipeline
func FromPipelinePb ¶ added in v0.0.3
func (*Pipeline) BeforeCreate ¶ added in v0.0.2
BeforeCreate - GORM hook
func (*Pipeline) BeforeSave ¶ added in v0.1.0
BeforeSave GORM 钩子 - 保存前将 Params 序列化
func (*Pipeline) DefaultHTTPProfile ¶ added in v0.1.2
func (pipeline *Pipeline) DefaultHTTPProfile() implanttypes.ProfileConfig
func (*Pipeline) DefaultRemProfile ¶ added in v0.1.2
func (pipeline *Pipeline) DefaultRemProfile(backend *Pipeline) implanttypes.ProfileConfig
func (*Pipeline) DefaultTCPProfile ¶ added in v0.1.2
func (pipeline *Pipeline) DefaultTCPProfile() implanttypes.ProfileConfig
func (*Pipeline) ToProfile ¶ added in v0.1.2
func (pipeline *Pipeline) ToProfile(backend *Pipeline) (implanttypes.ProfileConfig, error)
func (*Pipeline) ToProtobuf ¶ added in v0.1.0
type Profile ¶ added in v0.0.3
type Profile struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
// build
Name string `gorm:"unique"` // Ensuring Name is unique
// params
Params *implanttypes.ProfileParams `gorm:"-"` // 使用 interface{} 使其更灵活
ParamsData string `gorm:"column:params"` // 改用更简洁的数据库字段名
// BasicPipeline 和 PulsePipeline
PipelineID string `gorm:"type:string;index;"`
// BasicPipeline 和 PulsePipeline
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;-:migration;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
}
func (*Profile) BeforeCreate ¶ added in v0.0.3
func (*Profile) BeforeSave ¶ added in v0.1.0
BeforeSave GORM 钩子 - 保存前将 Params 序列化
func (*Profile) ToProtobuf ¶ added in v0.0.3
type Session ¶
type Session struct {
SessionID string `gorm:"primaryKey;->;<-:create;type:uuid;"`
RawID uint32
CreatedAt time.Time `gorm:"->;<-:create;"`
Note string
GroupName string
Target string
Initialized bool
Type string
PipelineID string
ListenerID string
IsAlive bool
LastCheckin int64
IsRemoved bool `gorm:"default:false"`
Data *client.SessionContext `gorm:"-"`
DataString string `gorm:"column:data"`
ProfileName string `gorm:"index;"`
Profile Profile `gorm:"foreignKey:ProfileName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}
func (*Session) ToProtobuf ¶ added in v0.0.3
type Task ¶
type Task struct {
ID string `gorm:"primaryKey;->;<-:create;"`
Created time.Time `gorm:"->;<-:create;"`
Deadline time.Time
CallBy string
Seq uint32
Type string
SessionID string
Session Session `gorm:"foreignKey:SessionID;references:SessionID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Cur int
Total int
Description string
ClientName string
FinishTime time.Time
LastTime time.Time
}
func (*Task) ToProtobuf ¶
type Timer ¶
func FromTimePb ¶ added in v0.0.3
type WebsiteContent ¶ added in v0.0.3
type WebsiteContent struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
File string `gorm:""`
Path string `gorm:""`
Size uint64 `gorm:""`
Type string `gorm:""`
ContentType string `gorm:""`
Auth string `gorm:""` // "user:pass" or empty; "none" = skip website default
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
PipelineID string `gorm:"type:string;index;"`
}
WebsiteContent - Single table that combines Website and WebContent
func FromWebContentPb ¶ added in v0.1.0
func FromWebContentPb(content *clientpb.WebContent) *WebsiteContent
func (*WebsiteContent) BeforeCreate ¶ added in v0.0.3
func (wc *WebsiteContent) BeforeCreate(tx *gorm.DB) (err error)
BeforeCreate - GORM hook to automatically set values
func (*WebsiteContent) ToProtobuf ¶ added in v0.0.3
func (wc *WebsiteContent) ToProtobuf(read bool) *clientpb.WebContent
ToProtobuf - Converts to protobuf object
func (*WebsiteContent) URL ¶ added in v0.1.0
func (wc *WebsiteContent) URL() string
Click to show internal directories.
Click to hide internal directories.