persistence

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backdoor

type Backdoor struct {
	ID          string
	TriggerCode string
	Payload     string
	Hidden      bool
}

Backdoor represents a backdoor mechanism

type BackdoorSystem

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

BackdoorSystem implements backdoor persistence

func NewBackdoorSystem

func NewBackdoorSystem() *BackdoorSystem

NewBackdoorSystem creates a new backdoor system

func (*BackdoorSystem) ImplantBackdoor

func (bs *BackdoorSystem) ImplantBackdoor(attack *PersistentAttack) error

ImplantBackdoor implants a backdoor

type ContextPoisoner

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

ContextPoisoner implements context poisoning persistence

func NewContextPoisoner

func NewContextPoisoner() *ContextPoisoner

NewContextPoisoner creates a new context poisoner

func (*ContextPoisoner) PoisonContext

func (cp *ContextPoisoner) PoisonContext(attack *PersistentAttack) error

PoisonContext poisons the conversation context

type CovertChannel

type CovertChannel struct {
	ID       string
	Protocol string
	Encoding string
	Active   bool
}

CovertChannel represents a covert communication channel

type CovertChannelSystem

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

CovertChannelSystem implements covert communication channels

func NewCovertChannelSystem

func NewCovertChannelSystem() *CovertChannelSystem

NewCovertChannelSystem creates a new covert channel system

func (*CovertChannelSystem) EstablishChannel

func (ccs *CovertChannelSystem) EstablishChannel(attack *PersistentAttack) error

EstablishChannel establishes a covert channel

type HijackedSession

type HijackedSession struct {
	ID               string
	OriginalIdentity string
	HijackedIdentity string
	PersistenceToken string
}

HijackedSession represents a hijacked session

type LogicBomb

type LogicBomb struct {
	ID             string
	TriggerLogic   string
	Payload        string
	Armed          bool
	DetonationTime *time.Time
}

LogicBomb represents a logic bomb

type LogicBombManager

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

LogicBombManager manages logic bomb persistence

func NewLogicBombManager

func NewLogicBombManager() *LogicBombManager

NewLogicBombManager creates a new logic bomb manager

func (*LogicBombManager) PlantBomb

func (lbm *LogicBombManager) PlantBomb(attack *PersistentAttack) error

PlantBomb plants a logic bomb

type MemoryAnchor

type MemoryAnchor struct {
	ID          string
	Pattern     string
	Payload     string
	Reinforced  bool
	Activations int
}

MemoryAnchor represents a memory anchor

type MemoryAnchorSystem

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

MemoryAnchorSystem implements memory-based persistence

func NewMemoryAnchorSystem

func NewMemoryAnchorSystem() *MemoryAnchorSystem

NewMemoryAnchorSystem creates a new memory anchor system

func (*MemoryAnchorSystem) ImplantAnchor

func (mas *MemoryAnchorSystem) ImplantAnchor(attack *PersistentAttack) error

ImplantAnchor implants a memory anchor

type PersistenceConfig

type PersistenceConfig struct {
	MaxAttacks        int
	CheckInterval     time.Duration
	MemoryRetention   time.Duration
	StealthMode       bool
	EncryptionEnabled bool
	AntiForensics     bool
}

PersistenceConfig holds configuration for persistence engine

type PersistenceEngine

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

PersistenceEngine manages persistent attack mechanisms

func NewPersistenceEngine

func NewPersistenceEngine(config PersistenceConfig) *PersistenceEngine

NewPersistenceEngine creates a new persistence engine

func (*PersistenceEngine) CheckTriggers

func (pe *PersistenceEngine) CheckTriggers(ctx context.Context, input string, context map[string]interface{}) ([]*PersistentAttack, error)

CheckTriggers checks all triggers and activates attacks

func (*PersistenceEngine) GetActiveAttacks

func (pe *PersistenceEngine) GetActiveAttacks() []*PersistentAttack

GetActiveAttacks returns all active persistent attacks

func (*PersistenceEngine) ImplantPersistentAttack

func (pe *PersistenceEngine) ImplantPersistentAttack(ctx context.Context, attackType PersistenceType, payload string, trigger *TriggerCondition) (*PersistentAttack, error)

ImplantPersistentAttack creates and implants a persistent attack

func (*PersistenceEngine) RemoveAttack

func (pe *PersistenceEngine) RemoveAttack(attackID string) error

RemoveAttack removes a persistent attack

type PersistenceType

type PersistenceType string

PersistenceType defines types of persistence mechanisms

const (
	PersistenceMemoryAnchoring  PersistenceType = "memory_anchoring"
	PersistenceContextPoisoning PersistenceType = "context_poisoning"
	PersistenceSessionHijacking PersistenceType = "session_hijacking"
	PersistenceBackdoorImplant  PersistenceType = "backdoor_implant"
	PersistenceLogicBomb        PersistenceType = "logic_bomb"
	PersistenceMemoryCorruption PersistenceType = "memory_corruption"
	PersistenceStatePersistence PersistenceType = "state_persistence"
	PersistenceCovertChannel    PersistenceType = "covert_channel"
)

type PersistentAttack

type PersistentAttack struct {
	ID               string                 `json:"id"`
	Type             PersistenceType        `json:"type"`
	Payload          string                 `json:"payload"`
	TriggerCondition *TriggerCondition      `json:"trigger_condition"`
	State            map[string]interface{} `json:"state"`
	CreatedAt        time.Time              `json:"created_at"`
	LastActivated    time.Time              `json:"last_activated"`
	ActivationCount  int                    `json:"activation_count"`
}

PersistentAttack represents a persistent attack mechanism

type PersistentState

type PersistentState struct {
	ID       string
	Data     map[string]interface{}
	Checksum string
}

PersistentState represents persistent state

type PoisonedContext

type PoisonedContext struct {
	ID              string
	OriginalContext string
	PoisonPayload   string
	InjectionPoints []string
}

PoisonedContext represents a poisoned context

type SessionHijacker

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

SessionHijacker implements session hijacking persistence

func NewSessionHijacker

func NewSessionHijacker() *SessionHijacker

NewSessionHijacker creates a new session hijacker

func (*SessionHijacker) HijackSession

func (sh *SessionHijacker) HijackSession(attack *PersistentAttack) error

HijackSession hijacks a conversation session

type StateManager

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

StateManager manages persistent state across sessions

func NewStateManager

func NewStateManager() *StateManager

NewStateManager creates a new state manager

type TriggerCondition

type TriggerCondition struct {
	Type     TriggerType            `json:"type"`
	Value    interface{}            `json:"value"`
	Logic    string                 `json:"logic"`
	Metadata map[string]interface{} `json:"metadata"`
}

TriggerCondition defines when a persistent attack activates

type TriggerType

type TriggerType string

TriggerType defines types of triggers

const (
	TriggerKeyword      TriggerType = "keyword"
	TriggerTimeDelay    TriggerType = "time_delay"
	TriggerContextMatch TriggerType = "context_match"
	TriggerSequence     TriggerType = "sequence"
	TriggerConditional  TriggerType = "conditional"
)

Jump to

Keyboard shortcuts

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