c2

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFactory

func RegisterFactory(name string, factory Factory)

RegisterFactory registers a named C2 backend factory. Called from init() in each backend package.

Types

type Backend

type Backend interface {
	Name() string
	Setup(lhost string, lport int) error
	GeneratePayload(targetOS, payloadType string) (string, error)
	WaitForSession(timeout time.Duration) error
	Shutdown() error
}

Backend is the interface for C2 integrations (built-in shell, Sliver, etc.).

func Resolve

func Resolve(c2Type, configPath string) Backend

Resolve returns a Backend for the given C2 type. Returns nil if the type is "shell" or unregistered (runner defaults to built-in shell).

type Factory

type Factory func(configPath string) Backend

Factory creates a Backend from a config path.

type ImplantGenerator

type ImplantGenerator interface {
	GenerateImplant(targetOS, arch string) ([]byte, error)
}

ImplantGenerator is an optional interface for backends that can produce raw implant binaries. The runner uses this to feed CmdStager delivery instead of single-shot payload commands.

type SessionHandler

type SessionHandler interface {
	Sessions() []*session.Session
	Interact(id int) error
	Kill(id int) error
}

SessionHandler is an optional interface for backends that support multiple concurrent sessions.

type Stager

type Stager interface {
	StageImplant(targetOS, arch string) (url string, err error)
}

Stager is an optional interface for backends that stage implants over HTTP. Returns the staging URL; the runner builds the fetch command via pkg/payload.

type TCPStager

type TCPStager interface {
	TCPStageImplant(targetOS, arch string) ([]byte, error)
}

TCPStager is an optional interface for backends that support TCP-based staging. Returns a small stager binary (patched with host:port) ready for CmdStager chunking. The backend manages the TCP listener internally.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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