signature

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSOCKS5SignatureCacheSize = 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSignatureConfig added in v1.3.0

type DefaultSignatureConfig struct {
	TTYDetectedSignatureEnabled    bool
	SOCKS5DetectedSignatureEnabled bool
	SOCKS5DetectedSignatureConfig  SOCKS5DetectionSignatureConfig
}

type SOCKS5Detected added in v1.5.0

type SOCKS5Detected struct {
	// contains filtered or unexported fields
}

func (*SOCKS5Detected) GetMetadata added in v1.5.0

func (*SOCKS5Detected) GetMetadata() SignatureMetadata

func (*SOCKS5Detected) OnEvent added in v1.5.0

func (s *SOCKS5Detected) OnEvent(event *types.Event) *v1.SignatureFinding

type SOCKS5DetectionSignatureConfig added in v1.5.0

type SOCKS5DetectionSignatureConfig struct {
	CacheSize uint32
}

type SOCKS5DetectionState added in v1.5.0

type SOCKS5DetectionState uint8
const (
	SOCKS5Unknown SOCKS5DetectionState = iota
	SOCKS5InitialClientRequestReceived
	SOCKS5InitialClientRequestSend
	SOCKS5InitialServerResponseSend
	SOCKS5InitialServerResponseReceived
)

type Signature

type Signature interface {
	GetMetadata() SignatureMetadata

	OnEvent(event *types.Event) *castpb.SignatureFinding
}

func DefaultSignatures

func DefaultSignatures(log *logging.Logger, cfg DefaultSignatureConfig) ([]Signature, error)

func NewSOCKS5DetectedSignature added in v1.5.0

func NewSOCKS5DetectedSignature(cfg SOCKS5DetectionSignatureConfig) (Signature, error)

func NewStdViaSocketSignature

func NewStdViaSocketSignature(log *logging.Logger) Signature

func NewTTYDetectedSignature added in v1.3.0

func NewTTYDetectedSignature() Signature

type SignatureEngine

type SignatureEngine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(signatures []Signature, log *logging.Logger, cfg SignatureEngineConfig) *SignatureEngine

func (*SignatureEngine) EventInput

func (e *SignatureEngine) EventInput() chan<- *types.Event

func (*SignatureEngine) Events

func (e *SignatureEngine) Events() <-chan *castpb.Event

func (*SignatureEngine) QueueEvent

func (e *SignatureEngine) QueueEvent(event *types.Event)

func (*SignatureEngine) Run

func (e *SignatureEngine) Run(ctx context.Context) error

func (*SignatureEngine) TargetEvents

func (e *SignatureEngine) TargetEvents() []events.ID

type SignatureEngineConfig

type SignatureEngineConfig struct {
	InputChanSize          int `validate:"required"`
	OutputChanSize         int `validate:"required"`
	DefaultSignatureConfig DefaultSignatureConfig
}

type SignatureMetadata

type SignatureMetadata struct {
	ID           castpb.SignatureEventID
	Name         string
	Version      string
	TargetEvents []events.ID
}

type StdioViaSocket

type StdioViaSocket struct {
	// contains filtered or unexported fields
}

func (*StdioViaSocket) GetMetadata

func (*StdioViaSocket) GetMetadata() SignatureMetadata

func (*StdioViaSocket) OnEvent

func (s *StdioViaSocket) OnEvent(event *types.Event) *v1.SignatureFinding

type TTYDetected added in v1.3.0

type TTYDetected struct{}

func (*TTYDetected) GetMetadata added in v1.3.0

func (*TTYDetected) GetMetadata() SignatureMetadata

func (*TTYDetected) OnEvent added in v1.3.0

func (s *TTYDetected) OnEvent(event *types.Event) *v1.SignatureFinding

Jump to

Keyboard shortcuts

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