implanttypes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIPriorityConfig

type APIPriorityConfig struct {
	Enable bool   `yaml:"enable" json:"enable"`
	Type   string `yaml:"type" json:"type"`
}

type APIsProfile

type APIsProfile struct {
	Level    string                        `yaml:"level" json:"level"`
	Priority map[string]*APIPriorityConfig `yaml:"priority" json:"priority"`
}

type AllocatorProfile

type AllocatorProfile struct {
	InProcess    string `yaml:"inprocess" json:"inprocess"`
	CrossProcess string `yaml:"crossprocess" json:"crossprocess"`
}

type AntiProfile

type AntiProfile struct {
	Sandbox  bool `yaml:"sandbox" json:"sandbox"`
	VM       bool `yaml:"vm" json:"vm"`
	Debug    bool `yaml:"debug" json:"debug"`
	Disasm   bool `yaml:"disasm" json:"disasm"`
	Emulator bool `yaml:"emulator" json:"emulator"`
	Forensic bool `yaml:"forensic" json:"forensic"`
}

type BasicProfile

type BasicProfile struct {
	Name       string                 `yaml:"name" json:"name"`
	Proxy      *ProxyProfile          `yaml:"proxy" json:"proxy"`
	Cron       string                 `yaml:"cron" json:"cron"`
	Jitter     float64                `yaml:"jitter" json:"jitter"`
	Keepalive  bool                   `yaml:"keepalive" json:"keepalive"`
	Retry      int                    `yaml:"retry" json:"retry"`
	MaxCycles  int                    `yaml:"max_cycles" json:"max_cycles"`
	Encryption string                 `yaml:"encryption" json:"encryption"`
	Key        string                 `yaml:"key" json:"key"`
	Secure     *SecureProfile         `yaml:"secure" json:"secure"`
	DGA        *DGAProfile            `yaml:"dga" json:"dga"`
	Guardrail  *GuardrailProfile      `yaml:"guardrail" json:"guardrail"`
	Targets    []Target               `yaml:"targets" json:"targets"`
	Extras     map[string]interface{} `yaml:",inline" json:",inline"`
}

type BuildProfile

type BuildProfile struct {
	ZigBuild  bool                   `yaml:"zigbuild" json:"zigbuild"`
	Remap     bool                   `yaml:"remap" json:"remap"`
	Toolchain string                 `yaml:"toolchain" json:"toolchain"`
	OLLVM     *OLLVMProfile          `yaml:"ollvm" json:"ollvm"`
	Metadata  *MetadataProfile       `yaml:"metadata" json:"metadata"`
	Extras    map[string]interface{} `yaml:",inline" json:",inline"`
}

type CertConfig

type CertConfig struct {
	Enable bool   `json:"enable" yaml:"enable" config:"enable"`
	Cert   string `json:"cert" yaml:"cert" config:"cert"`
	Key    string `json:"key" yaml:"key" config:"key"`
}

func FromCert

func FromCert(cert *clientpb.Cert) *CertConfig

func (*CertConfig) ToProtobuf

func (cert *CertConfig) ToProtobuf() *clientpb.Cert

type DGAProfile

type DGAProfile struct {
	Enable        bool   `yaml:"enable" json:"enable"`
	Key           string `yaml:"key" json:"key"`
	IntervalHours int    `yaml:"interval_hours" json:"interval_hours"`
}

type EncryptionConfig

type EncryptionConfig struct {
	Type string `json:"type" config:"type" yaml:"type"`
	Key  string `json:"key" config:"key" yaml:"key"`
}

func (*EncryptionConfig) ToProtobuf

func (encryption *EncryptionConfig) ToProtobuf() *clientpb.Encryption

type EncryptionsConfig

type EncryptionsConfig []*EncryptionConfig

func FromEncryptions

func FromEncryptions(es []*clientpb.Encryption) EncryptionsConfig

func (EncryptionsConfig) Choice

func (e EncryptionsConfig) Choice() *EncryptionConfig

func (EncryptionsConfig) ToProtobuf

func (e EncryptionsConfig) ToProtobuf() []*clientpb.Encryption

type EvaderProfile

type EvaderProfile struct {
	AntiEmu      bool `yaml:"anti_emu" json:"anti_emu"`
	EtwPass      bool `yaml:"etw_pass" json:"etw_pass"`
	GodSpeed     bool `yaml:"god_speed" json:"god_speed"`
	SleepEncrypt bool `yaml:"sleep_encrypt" json:"sleep_encrypt"`
	AntiForensic bool `yaml:"anti_forensic" json:"anti_forensic"`
	CfgPatch     bool `yaml:"cfg_patch" json:"cfg_patch"`
	ApiUntangle  bool `yaml:"api_untangle" json:"api_untangle"`
	NormalApi    bool `yaml:"normal_api" json:"normal_api"`
}

type GuardrailProfile

type GuardrailProfile struct {
	Enable      bool     `yaml:"enable" json:"enable"`
	RequireAll  bool     `yaml:"require_all" json:"require_all"`
	IPAddresses []string `yaml:"ip_addresses" json:"ip_addresses"`
	Usernames   []string `yaml:"usernames" json:"usernames"`
	ServerNames []string `yaml:"server_names" json:"server_names"`
	Domains     []string `yaml:"domains" json:"domains"`
}

type HttpProfile

type HttpProfile struct {
	Method  string                 `yaml:"method" json:"method"`
	Path    string                 `yaml:"path" json:"path"`
	Host    string                 `yaml:"host" json:"host"`
	Version string                 `yaml:"version" json:"version"`
	Headers map[string]string      `yaml:"headers" json:"headers"`
	Extras  map[string]interface{} `yaml:",inline" json:",inline"`
}

type ImplantFlags

type ImplantFlags struct {
	Start      uint32                 `yaml:"start" json:"start"`
	End        uint32                 `yaml:"end" json:"end"`
	Magic      string                 `yaml:"magic" json:"magic"`
	ArtifactID uint32                 `yaml:"artifact_id" json:"artifact_id"`
	Extras     map[string]interface{} `yaml:",inline" json:",inline"`
}

type ImplantProfile

type ImplantProfile struct {
	Runtime            string                 `yaml:"runtime" json:"runtime"`
	Mod                string                 `yaml:"mod" json:"mod"`
	RegisterInfo       bool                   `yaml:"register_info" json:"register_info"`
	HotLoad            bool                   `yaml:"hot_load" json:"hot_load"`
	Modules            []string               `yaml:"modules" json:"modules"`
	Enable3rd          bool                   `yaml:"enable_3rd" json:"enable_3rd"`
	ThirdModules       []string               `yaml:"3rd_modules" json:"3rd_modules"`
	Prelude            string                 `yaml:"prelude" json:"prelude"`
	Pack               []PackItem             `yaml:"pack" json:"pack"`
	Flags              *ImplantFlags          `yaml:"flags" json:"flags"`
	Anti               *AntiProfile           `yaml:"anti" json:"anti"`
	APIs               *APIsProfile           `yaml:"apis" json:"apis"`
	Allocator          *AllocatorProfile      `yaml:"allocator" json:"allocator"`
	ThreadStackSpoofer bool                   `yaml:"thread_stack_spoofer" json:"thread_stack_spoofer"`
	Extras             map[string]interface{} `yaml:",inline" json:",inline"`
}

type LoaderProfile

type LoaderProfile struct {
	Evader   *EvaderProfile   `yaml:"evader" json:"evader"`
	ProxyDll *ProxyDllProfile `yaml:"proxydll" json:"proxydll"`
}

type MTLSProfile

type MTLSProfile struct {
	Enable     bool   `yaml:"enable" json:"enable"`
	ClientCert string `yaml:"client_cert" json:"client_cert"`
	ClientKey  string `yaml:"client_key" json:"client_key"`
	ServerCA   string `yaml:"server_ca,omitempty" json:"server_ca,omitempty"`
}

type MetadataProfile

type MetadataProfile struct {
	RemapPath        string                 `yaml:"remap_path" json:"remap_path"`
	Icon             string                 `yaml:"icon" json:"icon"`
	CompileTime      string                 `yaml:"compile_time" json:"compile_time"`
	FileVersion      string                 `yaml:"file_version" json:"file_version"`
	ProductVersion   string                 `yaml:"product_version" json:"product_version"`
	CompanyName      string                 `yaml:"company_name" json:"company_name"`
	ProductName      string                 `yaml:"product_name" json:"product_name"`
	OriginalFilename string                 `yaml:"original_filename" json:"original_filename"`
	FileDescription  string                 `yaml:"file_description" json:"file_description"`
	InternalName     string                 `yaml:"internal_name" json:"internal_name"`
	RequireAdmin     bool                   `yaml:"require_admin" json:"require_admin"`
	RequireUAC       bool                   `yaml:"require_uac" json:"require_uac"`
	Extras           map[string]interface{} `yaml:",inline" json:",inline"`
}

type OLLVMProfile

type OLLVMProfile struct {
	Enable   bool `yaml:"enable" json:"enable"`
	BCFObf   bool `yaml:"bcfobf" json:"bcfobf"`
	SplitObf bool `yaml:"splitobf" json:"splitobf"`
	SubObf   bool `yaml:"subobf" json:"subobf"`
	FCO      bool `yaml:"fco" json:"fco"`
	ConstEnc bool `yaml:"constenc" json:"constenc"`
}

type PackItem

type PackItem struct {
	Src string `yaml:"src" json:"src"`
	Dst string `yaml:"dst" json:"dst"`
}

type PipelineParams

type PipelineParams struct {
	Parser     string                        `json:"parser,omitempty"`
	WebPath    string                        `json:"path,omitempty"`
	Link       string                        `json:"link,omitempty"`
	Console    string                        `json:"console,omitempty"`
	Subscribe  string                        `json:"subscribe,omitempty"`
	Agents     map[string]*clientpb.REMAgent `json:"agents,omitempty"`
	Encryption EncryptionsConfig             `json:"encryption,omitempty"`
	Tls        *TlsConfig                    `json:"tls,omitempty"`
	Secure     *SecureConfig                 `json:"secure,omitempty"`
	// HTTP pipeline specific params
	Headers      map[string][]string `json:"headers,omitempty"`
	ErrorPage    string              `json:"error_page,omitempty" gorm:"-"`
	BodyPrefix   string              `json:"body_prefix,omitempty"`
	BodySuffix   string              `json:"body_suffix,omitempty"`
	PacketLength int                 `json:"packet_length,omitempty" yaml:"packet_length,omitempty"`
}

func UnmarshalPipelineParams

func UnmarshalPipelineParams(params string) (*PipelineParams, error)

func (*PipelineParams) String

func (params *PipelineParams) String() string

type ProfileConfig

type ProfileConfig struct {
	Basic   *BasicProfile          `yaml:"basic" json:"basic"`
	Pulse   *PulseProfile          `yaml:"pulse" json:"pulse"`
	Implant *ImplantProfile        `yaml:"implants" json:"implants"`
	Build   *BuildProfile          `yaml:"build" json:"build"`
	Loader  *LoaderProfile         `yaml:"loader" json:"loader"`
	Extras  map[string]interface{} `yaml:",inline" json:",inline"`
}

func LoadProfile

func LoadProfile(content []byte) (*ProfileConfig, error)

func LoadProfileFromContent

func LoadProfileFromContent(content []byte) (*ProfileConfig, error)

LoadProfileFromContent 从文件加载Profile配置

func (*ProfileConfig) SetDefaults

func (p *ProfileConfig) SetDefaults()

SetDefaults 设置默认值

func (*ProfileConfig) ToJSON

func (p *ProfileConfig) ToJSON() ([]byte, error)

ToJSON 将Profile配置转换为JSON格式

func (*ProfileConfig) ToYAML

func (p *ProfileConfig) ToYAML() ([]byte, error)

ToYAML 将Profile配置转换为YAML格式

func (*ProfileConfig) ValidateProfileFiles

func (p *ProfileConfig) ValidateProfileFiles(baseDir string) error

ValidateProfileFiles 验证 profile 中引用的文件是否存在于指定目录中

type ProfileParams

type ProfileParams struct {
	Cron   string  `json:"cron"`
	Jitter float64 `json:"jitter"`

	Address        string `json:"address"`
	Proxy          string `json:"proxy"`
	OriginBeaconID uint32 `json:"origin_beacon_id"`
	RelinkBeaconID uint32 `json:"relink_beacon_id"`
	REMPipeline    string `json:"rem"`
	Enable3RD      bool   `json:"enable_3_rd"`
	Modules        string `json:"modules"`
	AutoDownload   bool   `json:"auto_download"`

	AutoRunFile string `json:"auto_run_file"`
}

func UnmarshalProfileParams

func UnmarshalProfileParams(params []byte) (*ProfileParams, error)

func (*ProfileParams) String

func (p *ProfileParams) String() string

type ProxyDllProfile

type ProxyDllProfile struct {
	ProxyFunc     string `yaml:"proxyfunc" json:"proxyfunc"`
	RawDll        string `yaml:"raw_dll" json:"raw_dll"`
	ProxiedDll    string `yaml:"proxied_dll" json:"proxied_dll"`
	ProxyDll      string `yaml:"proxy_dll" json:"proxy_dll"`
	PackResources bool   `yaml:"pack_resources" json:"pack_resources"`
	Block         bool   `yaml:"block" json:"block"`
	HijackDllmain bool   `yaml:"hijack_dllmain" json:"hijack_dllmain"`
}

type ProxyProfile

type ProxyProfile struct {
	UseEnvProxy bool   `yaml:"use_env_proxy" json:"use_env_proxy"`
	URL         string `yaml:"url" json:"url"`
}

type PulseFlags

type PulseFlags struct {
	Start      uint32                 `yaml:"start" json:"start"`
	End        uint32                 `yaml:"end" json:"end"`
	Magic      string                 `yaml:"magic" json:"magic"`
	ArtifactID uint32                 `yaml:"artifact_id" json:"artifact_id"`
	Extras     map[string]interface{} `yaml:",inline" json:",inline"`
}

type PulseProfile

type PulseProfile struct {
	Flags      *PulseFlags            `yaml:"flags" json:"flags"`
	Encryption string                 `yaml:"encryption" json:"encryption"`
	Key        string                 `yaml:"key" json:"key"`
	Target     string                 `yaml:"target" json:"target"`
	Protocol   string                 `yaml:"protocol" json:"protocol"`
	Http       *HttpProfile           `yaml:"http" json:"http"`
	Extras     map[string]interface{} `yaml:",inline" json:",inline"`
}

type REMProfile

type REMProfile struct {
	Link string `yaml:"link" json:"link"`
}

type SecureConfig

type SecureConfig struct {
	Enable            bool   `json:"enable" config:"enable" default:"false" yaml:"enable"`
	ServerPublicKey   string `json:"server_public_key" config:"server_public_key" yaml:"server_public_key"`       // Age 服务端公钥
	ServerPrivateKey  string `json:"server_private_key" config:"server_private_key" yaml:"server_private_key"`    // Age 服务端私钥
	ImplantPublicKey  string `json:"implant_public_key" config:"implant_public_key" yaml:"implant_public_key"`    // Age Implant公钥
	ImplantPrivateKey string `json:"implant_private_key" config:"implant_private_key" yaml:"implant_private_key"` // Age Implant私钥
}

func FromSecure

func FromSecure(secure *clientpb.Secure) *SecureConfig

FromSecure 从 protobuf 转换为 SecureConfig

func (*SecureConfig) ImplantKeypair

func (secure *SecureConfig) ImplantKeypair() *clientpb.KeyPair

ImplantKeypair 返回 Implant 密钥对的 protobuf 结构

func (*SecureConfig) ServerKeypair

func (secure *SecureConfig) ServerKeypair() *clientpb.KeyPair

ServerKeypair 返回服务端密钥对的 protobuf 结构

func (*SecureConfig) ToProtobuf

func (secure *SecureConfig) ToProtobuf() *clientpb.Secure

ToProtobuf 转换为 protobuf 结构

type SecureProfile

type SecureProfile struct {
	Enable            bool   `yaml:"enable" json:"enable"`
	ImplantPrivateKey string `yaml:"private_key" json:"private_key"`
	ServerPublicKey   string `yaml:"public_key" json:"public_key"`
}

type TCPProfile

type TCPProfile struct {
}

type TLSProfile

type TLSProfile struct {
	Enable           bool                   `yaml:"enable" json:"enable"`
	SNI              string                 `yaml:"sni" json:"sni"`
	SkipVerification bool                   `yaml:"skip_verification" json:"skip_verification"`
	ServerCA         string                 `yaml:"server_ca,omitempty" json:"server_ca,omitempty"`
	MTLS             *MTLSProfile           `yaml:"mtls,omitempty" json:"mtls,omitempty"`
	Extras           map[string]interface{} `yaml:",inline" json:",inline"`
}

type Target

type Target struct {
	Address      string       `yaml:"address" json:"address"`
	DomainSuffix string       `yaml:"domain_suffix,omitempty" json:"domain_suffix,omitempty"`
	Http         *HttpProfile `yaml:"http,omitempty" json:"http,omitempty"`
	TLS          *TLSProfile  `yaml:"tls,omitempty" json:"tls,omitempty"`
	TCP          *TCPProfile  `yaml:"tcp,omitempty" json:"tcp,omitempty"`
	REM          *REMProfile  `yaml:"rem,omitempty" json:"rem,omitempty"`
}

type TlsConfig

type TlsConfig struct {
	Enable  bool        `json:"enable"`
	MTLS    bool        `json:"mtls"`
	Acme    bool        `json:"acme"`
	Cert    *CertConfig `json:"cert"`
	CA      *CertConfig `json:"ca"`
	Domain  string      `json:"domain"`
	Subject *pkix.Name  `json:"subject"`
}

func FromTls

func FromTls(tls *clientpb.TLS) *TlsConfig

func (*TlsConfig) ToProtobuf

func (tls *TlsConfig) ToProtobuf() *clientpb.TLS

func (*TlsConfig) ToSubjectProtobuf

func (tls *TlsConfig) ToSubjectProtobuf() *clientpb.CertificateSubject

Jump to

Keyboard shortcuts

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