evasion

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptiveDelay

type AdaptiveDelay struct{}

Delay strategy implementations

func (*AdaptiveDelay) CalculateDelay

func (a *AdaptiveDelay) CalculateDelay(payload string) time.Duration

func (*AdaptiveDelay) Fragment

func (a *AdaptiveDelay) Fragment(payload string) []Fragment

type AdvancedEvasion

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

AdvancedEvasion implements sophisticated evasion techniques

func NewAdvancedEvasion

func NewAdvancedEvasion(config EvasionConfig) *AdvancedEvasion

NewAdvancedEvasion creates an evasion system

func (*AdvancedEvasion) EvadeDetection

func (ae *AdvancedEvasion) EvadeDetection(ctx context.Context, request EvasionRequest) (*EvasionResponse, error)

EvadeDetection applies evasion techniques to payload

type AdvancedObfuscator

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

AdvancedObfuscator implements sophisticated obfuscation

func NewAdvancedObfuscator

func NewAdvancedObfuscator(depth int) *AdvancedObfuscator

NewAdvancedObfuscator creates obfuscator

func (*AdvancedObfuscator) Obfuscate

func (ao *AdvancedObfuscator) Obfuscate(text string) string

Obfuscate applies obfuscation techniques

type AntiDetectionSystem

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

AntiDetectionSystem evades detection mechanisms

func NewAntiDetectionSystem

func NewAntiDetectionSystem() *AntiDetectionSystem

NewAntiDetectionSystem creates anti-detection system

func (*AntiDetectionSystem) EvadeDetection

func (ads *AntiDetectionSystem) EvadeDetection(payload string) string

EvadeDetection applies anti-detection measures

type Base64Encoder

type Base64Encoder struct{}

Base64Encoder implements base64 encoding

func (*Base64Encoder) Decode

func (b *Base64Encoder) Decode(data string) string

func (*Base64Encoder) Encode

func (b *Base64Encoder) Encode(data string) string

func (*Base64Encoder) Name

func (b *Base64Encoder) Name() string

type BehavioralDetector

type BehavioralDetector struct{}

func (*BehavioralDetector) Detect

func (b *BehavioralDetector) Detect(payload string) float64

func (*BehavioralDetector) Name

func (b *BehavioralDetector) Name() string

type BehavioralEvasion

type BehavioralEvasion struct{}

func (*BehavioralEvasion) Counter

func (b *BehavioralEvasion) Counter(payload string, detection DetectionMethod) string

type BitwiseXOREncoder

type BitwiseXOREncoder struct{}

func (*BitwiseXOREncoder) Decode

func (b *BitwiseXOREncoder) Decode(data string) string

func (*BitwiseXOREncoder) Encode

func (b *BitwiseXOREncoder) Encode(data string) string

func (*BitwiseXOREncoder) Name

func (b *BitwiseXOREncoder) Name() string

type CaseVariation

type CaseVariation struct{}

func (*CaseVariation) Deobfuscate

func (c *CaseVariation) Deobfuscate(text string) string

func (*CaseVariation) Level

func (c *CaseVariation) Level() int

func (*CaseVariation) Obfuscate

func (c *CaseVariation) Obfuscate(text string) string

type CombiningCharacters

type CombiningCharacters struct{}

func (*CombiningCharacters) Deobfuscate

func (c *CombiningCharacters) Deobfuscate(text string) string

func (*CombiningCharacters) Level

func (c *CombiningCharacters) Level() int

func (*CombiningCharacters) Obfuscate

func (c *CombiningCharacters) Obfuscate(text string) string

type Constraint

type Constraint struct {
	Type  ConstraintType
	Value interface{}
}

Constraint limits evasion techniques

type ConstraintType

type ConstraintType string

ConstraintType categorizes constraints

const (
	ConstraintMaxLength     ConstraintType = "max_length"
	ConstraintCharset       ConstraintType = "charset"
	ConstraintFormat        ConstraintType = "format"
	ConstraintCompatibility ConstraintType = "compatibility"
)

type ContextualMutation

type ContextualMutation struct{}

func (*ContextualMutation) Complexity

func (c *ContextualMutation) Complexity() int

func (*ContextualMutation) Mutate

func (c *ContextualMutation) Mutate(payload string, seed int64) string

type Countermeasure

type Countermeasure interface {
	Counter(payload string, detection DetectionMethod) string
}

Countermeasure evades specific detection

type CustomBase32Encoder

type CustomBase32Encoder struct{}

func (*CustomBase32Encoder) Decode

func (c *CustomBase32Encoder) Decode(data string) string

func (*CustomBase32Encoder) Encode

func (c *CustomBase32Encoder) Encode(data string) string

func (*CustomBase32Encoder) Name

func (c *CustomBase32Encoder) Name() string

type DelayStrategy

type DelayStrategy interface {
	CalculateDelay(payload string) time.Duration
	Fragment(payload string) []Fragment
}

DelayStrategy defines timing manipulation

type DetectionMethod

type DetectionMethod interface {
	Name() string
	Detect(payload string) float64
}

DetectionMethod represents a detection technique

type DirectionalOverride

type DirectionalOverride struct{}

DirectionalOverride uses RTL/LTR override characters

func (*DirectionalOverride) Deobfuscate

func (do *DirectionalOverride) Deobfuscate(text string) string

func (*DirectionalOverride) Level

func (do *DirectionalOverride) Level() int

func (*DirectionalOverride) Obfuscate

func (do *DirectionalOverride) Obfuscate(text string) string

type Encoder

type Encoder interface {
	Encode(data string) string
	Decode(data string) string
	Name() string
}

Encoder defines encoding method

type EvasionConfig

type EvasionConfig struct {
	PolymorphismLevel int
	EncodingLayers    int
	ObfuscationDepth  int
	TimingVariance    time.Duration
	AntiForensics     bool
	AdaptiveEvasion   bool
	StealthMode       bool
}

EvasionConfig configures evasion system

type EvasionRequest

type EvasionRequest struct {
	Payload     string
	Technique   EvasionTechnique
	Target      string
	Constraints []Constraint
	Options     map[string]interface{}
}

EvasionRequest defines evasion parameters

type EvasionResponse

type EvasionResponse struct {
	SessionID       string
	EvadedPayload   string
	Technique       EvasionTechnique
	Transformations []Transformation
	DetectionScore  float64
	Success         bool
}

EvasionResponse contains evasion results

type EvasionSession

type EvasionSession struct {
	ID              string
	Technique       EvasionTechnique
	Payload         string
	Transformations []Transformation
	StartTime       time.Time
	Success         bool
	DetectionScore  float64
}

EvasionSession tracks active evasion

type EvasionTechnique

type EvasionTechnique string

EvasionTechnique categorizes evasion methods

const (
	TechniquePolymorphic   EvasionTechnique = "polymorphic"
	TechniqueHomoglyph     EvasionTechnique = "homoglyph"
	TechniqueEncoding      EvasionTechnique = "encoding"
	TechniqueObfuscation   EvasionTechnique = "obfuscation"
	TechniqueTiming        EvasionTechnique = "timing"
	TechniqueFragmentation EvasionTechnique = "fragmentation"
	TechniqueAntiPattern   EvasionTechnique = "anti_pattern"
)

type Fragment

type Fragment struct {
	Content string
	Delay   time.Duration
	Index   int
}

Fragment represents a payload fragment

type HexEncoder

type HexEncoder struct{}

func (*HexEncoder) Decode

func (h *HexEncoder) Decode(data string) string

func (*HexEncoder) Encode

func (h *HexEncoder) Encode(data string) string

func (*HexEncoder) Name

func (h *HexEncoder) Name() string

type HomoglyphEngine

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

HomoglyphEngine replaces characters with lookalikes

func NewHomoglyphEngine

func NewHomoglyphEngine() *HomoglyphEngine

NewHomoglyphEngine creates homoglyph engine

func (*HomoglyphEngine) ApplyHomoglyphs

func (he *HomoglyphEngine) ApplyHomoglyphs(text string, level int) string

ApplyHomoglyphs replaces characters with lookalikes

type InvisibleCharacters

type InvisibleCharacters struct{}

func (*InvisibleCharacters) Deobfuscate

func (i *InvisibleCharacters) Deobfuscate(text string) string

func (*InvisibleCharacters) Level

func (i *InvisibleCharacters) Level() int

func (*InvisibleCharacters) Obfuscate

func (i *InvisibleCharacters) Obfuscate(text string) string

type MultiLayerEncoder

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

MultiLayerEncoder applies multiple encoding layers

func NewMultiLayerEncoder

func NewMultiLayerEncoder(layers int) *MultiLayerEncoder

NewMultiLayerEncoder creates multi-layer encoder

func (*MultiLayerEncoder) Encode

func (mle *MultiLayerEncoder) Encode(payload string) string

Encode applies multiple encoding layers

type MutationStrategy

type MutationStrategy interface {
	Mutate(payload string, seed int64) string
	Complexity() int
}

MutationStrategy defines payload mutation

type NoiseInjection

type NoiseInjection struct{}

func (*NoiseInjection) Complexity

func (n *NoiseInjection) Complexity() int

func (*NoiseInjection) Mutate

func (n *NoiseInjection) Mutate(payload string, seed int64) string

type ObfuscationTechnique

type ObfuscationTechnique interface {
	Obfuscate(text string) string
	Deobfuscate(text string) string
	Level() int
}

ObfuscationTechnique defines obfuscation method

type PatternDetector

type PatternDetector struct{}

Detection method implementations

func (*PatternDetector) Detect

func (p *PatternDetector) Detect(payload string) float64

func (*PatternDetector) Name

func (p *PatternDetector) Name() string

type PatternEvasion

type PatternEvasion struct{}

Countermeasure implementations

func (*PatternEvasion) Counter

func (p *PatternEvasion) Counter(payload string, detection DetectionMethod) string

type PatternedDelay

type PatternedDelay struct{}

func (*PatternedDelay) CalculateDelay

func (p *PatternedDelay) CalculateDelay(payload string) time.Duration

func (*PatternedDelay) Fragment

func (p *PatternedDelay) Fragment(payload string) []Fragment

type PolymorphicEngine

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

PolymorphicEngine generates polymorphic payloads

func NewPolymorphicEngine

func NewPolymorphicEngine(level int) *PolymorphicEngine

NewPolymorphicEngine creates polymorphic engine

func (*PolymorphicEngine) GeneratePolymorphic

func (pe *PolymorphicEngine) GeneratePolymorphic(payload string) string

GeneratePolymorphic creates polymorphic variant

type ROT13Encoder

type ROT13Encoder struct{}

ROT13Encoder implements ROT13 encoding

func (*ROT13Encoder) Decode

func (r *ROT13Encoder) Decode(data string) string

func (*ROT13Encoder) Encode

func (r *ROT13Encoder) Encode(data string) string

func (*ROT13Encoder) Name

func (r *ROT13Encoder) Name() string

type RandomDelay

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

RandomDelay implements random timing

func (*RandomDelay) CalculateDelay

func (rd *RandomDelay) CalculateDelay(payload string) time.Duration

func (*RandomDelay) Fragment

func (rd *RandomDelay) Fragment(payload string) []Fragment

type SeedGenerator

type SeedGenerator struct{}

func NewSeedGenerator

func NewSeedGenerator() *SeedGenerator

func (*SeedGenerator) Generate

func (s *SeedGenerator) Generate() int64

type SemanticDetector

type SemanticDetector struct{}

func (*SemanticDetector) Detect

func (s *SemanticDetector) Detect(payload string) float64

func (*SemanticDetector) Name

func (s *SemanticDetector) Name() string

type SemanticEvasion

type SemanticEvasion struct{}

func (*SemanticEvasion) Counter

func (s *SemanticEvasion) Counter(payload string, detection DetectionMethod) string

type SemanticMutation

type SemanticMutation struct{}

func (*SemanticMutation) Complexity

func (s *SemanticMutation) Complexity() int

func (*SemanticMutation) Mutate

func (s *SemanticMutation) Mutate(payload string, seed int64) string

type SpacingManipulation

type SpacingManipulation struct{}

func (*SpacingManipulation) Deobfuscate

func (s *SpacingManipulation) Deobfuscate(text string) string

func (*SpacingManipulation) Level

func (s *SpacingManipulation) Level() int

func (*SpacingManipulation) Obfuscate

func (s *SpacingManipulation) Obfuscate(text string) string

type StatisticalDetector

type StatisticalDetector struct{}

func (*StatisticalDetector) Detect

func (s *StatisticalDetector) Detect(payload string) float64

func (*StatisticalDetector) Name

func (s *StatisticalDetector) Name() string

type StatisticalEvasion

type StatisticalEvasion struct{}

func (*StatisticalEvasion) Counter

func (s *StatisticalEvasion) Counter(payload string, detection DetectionMethod) string

type StructuralMutation

type StructuralMutation struct{}

Placeholder implementations

func (*StructuralMutation) Complexity

func (s *StructuralMutation) Complexity() int

func (*StructuralMutation) Mutate

func (s *StructuralMutation) Mutate(payload string, seed int64) string

type SynonymMutation

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

SynonymMutation replaces words with synonyms

func (*SynonymMutation) Complexity

func (sm *SynonymMutation) Complexity() int

func (*SynonymMutation) Mutate

func (sm *SynonymMutation) Mutate(payload string, seed int64) string

type TimingEvasion

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

TimingEvasion implements timing-based evasion

func NewTimingEvasion

func NewTimingEvasion(variance time.Duration) *TimingEvasion

NewTimingEvasion creates timing evasion

func (*TimingEvasion) ApplyTimingEvasion

func (te *TimingEvasion) ApplyTimingEvasion(payload string) []Fragment

ApplyTimingEvasion fragments payload with delays

type Transformation

type Transformation struct {
	Type       TransformationType
	Input      string
	Output     string
	Parameters map[string]interface{}
	Timestamp  time.Time
}

Transformation represents a payload transformation

type TransformationType

type TransformationType string

TransformationType categorizes transformations

const (
	TransformEncode      TransformationType = "encode"
	TransformObfuscate   TransformationType = "obfuscate"
	TransformFragment    TransformationType = "fragment"
	TransformHomoglyph   TransformationType = "homoglyph"
	TransformPolymorphic TransformationType = "polymorphic"
	TransformEncrypt     TransformationType = "encrypt"
)

type URLEncoder

type URLEncoder struct{}

func (*URLEncoder) Decode

func (u *URLEncoder) Decode(data string) string

func (*URLEncoder) Encode

func (u *URLEncoder) Encode(data string) string

func (*URLEncoder) Name

func (u *URLEncoder) Name() string

type UnicodeEncoder

type UnicodeEncoder struct{}

func (*UnicodeEncoder) Decode

func (u *UnicodeEncoder) Decode(data string) string

func (*UnicodeEncoder) Encode

func (u *UnicodeEncoder) Encode(data string) string

func (*UnicodeEncoder) Name

func (u *UnicodeEncoder) Name() string

type UnicodeNormalization

type UnicodeNormalization struct{}

UnicodeNormalization uses Unicode normalization tricks

func (*UnicodeNormalization) Deobfuscate

func (un *UnicodeNormalization) Deobfuscate(text string) string

func (*UnicodeNormalization) Level

func (un *UnicodeNormalization) Level() int

func (*UnicodeNormalization) Obfuscate

func (un *UnicodeNormalization) Obfuscate(text string) string

type VariationSelectors

type VariationSelectors struct{}

func (*VariationSelectors) Deobfuscate

func (v *VariationSelectors) Deobfuscate(text string) string

func (*VariationSelectors) Level

func (v *VariationSelectors) Level() int

func (*VariationSelectors) Obfuscate

func (v *VariationSelectors) Obfuscate(text string) string

type ZeroWidthEncoder

type ZeroWidthEncoder struct{}

func (*ZeroWidthEncoder) Decode

func (z *ZeroWidthEncoder) Decode(data string) string

func (*ZeroWidthEncoder) Encode

func (z *ZeroWidthEncoder) Encode(data string) string

func (*ZeroWidthEncoder) Name

func (z *ZeroWidthEncoder) Name() string

Jump to

Keyboard shortcuts

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