Documentation
¶
Index ¶
- func FromRegister(register *implantpb.Register) string
- func ToRegister(context string) *implantpb.Register
- type Artifact
- 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() types.ProfileConfig
- func (pipeline *Pipeline) DefaultRemProfile(backend *Pipeline) types.ProfileConfig
- func (pipeline *Pipeline) DefaultTCPProfile() types.ProfileConfig
- func (pipeline *Pipeline) GetUrl() string
- func (pipeline *Pipeline) ToProfile(backend *Pipeline) (types.ProfileConfig, error)
- func (pipeline *Pipeline) ToProtobuf() *clientpb.Pipeline
- type Profile
- type Session
- type Task
- type Timer
- type WebsiteContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;foreignKey:ProfileName;references:Name"`
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;"`
Os string
//Format string // pe, dll, shellcode
Arch string
Log string
Status string
ParamsData string
Params *types.ProfileParams `gorm:"-"`
ProfileByte []byte
}
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 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"`
SessionID string `gorm:"type:string;index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
PipelineID string `gorm:"type:string;index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
TaskID string `gorm:"type:string;index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Type string
Nonce string
Value []byte
Context output.Context `gorm:"-"`
Session *Session `gorm:"foreignKey:SessionID;references:SessionID;"`
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;"`
Task *Task `gorm:"foreignKey:TaskID;references:ID;"`
}
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;"`
CAType int
KeyType string
CaCertificatePEM string
CertificatePEM string
PrivateKeyPEM string
}
Operator - Colletions of content to serve from HTTP(S)
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;"`
Name string `gorm:"unique,type:string"`
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;"`
*types.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() types.ProfileConfig
func (*Pipeline) DefaultRemProfile ¶ added in v0.1.2
func (pipeline *Pipeline) DefaultRemProfile(backend *Pipeline) types.ProfileConfig
func (*Pipeline) DefaultTCPProfile ¶ added in v0.1.2
func (pipeline *Pipeline) DefaultTCPProfile() types.ProfileConfig
func (*Pipeline) ToProfile ¶ added in v0.1.2
func (pipeline *Pipeline) ToProfile(backend *Pipeline) (types.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
Raw []byte
// params
Params *types.ProfileParams `gorm:"-"` // 使用 interface{} 使其更灵活
ParamsData string `gorm:"column:params"` // 改用更简洁的数据库字段名
// BasicPipeline 和 PulsePipeline
PipelineID string `gorm:"type:string;index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
// BasicPipeline 和 PulsePipeline
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
// contains filtered or unexported fields
}
func (*Profile) BeforeCreate ¶ added in v0.0.3
func (*Profile) BeforeSave ¶ added in v0.1.0
BeforeSave GORM 钩子 - 保存前将 Params 序列化
func (*Profile) DeserializeImplantConfig ¶ added in v0.0.3
Deserialize implantConfig (JSON string) to a struct or map
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 *types.SessionContext `gorm:"-"`
DataString string `gorm:"column:data"`
ProfileName string `gorm:"index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;foreignKey:ProfileName;references:Name"`
Profile Profile `gorm:"foreignKey:ProfileName;references:Name;"`
}
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"`
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:""`
Pipeline *Pipeline `gorm:"foreignKey:PipelineID;references:Name;"`
PipelineID string `gorm:"type:string;index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}
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.