c2

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register added in v0.5.0

func Register(b Backend)

Register registers a C2 backend by its Name(). Called from init() in each backend package.

func ResolvePayload added in v0.1.4

func ResolvePayload(payloads PayloadMap, lhost string, lport int, payloadType string, fallback PayloadGen) (string, error)

ResolvePayload looks up a payload by type in the map, falling back to the given default.

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 Configurable added in v0.5.0

type Configurable interface {
	Configure(configPath string)
}

Configurable is an optional interface for backends that need external configuration (e.g. Sliver operator config file).

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 PayloadGen added in v0.5.0

type PayloadGen func(lhost string, lport int) string

PayloadGen is a function that generates a reverse shell command for a given host:port.

type PayloadMap added in v0.1.4

type PayloadMap map[string]PayloadGen

PayloadMap is a map of payload names to generators.

type SessionBase added in v0.3.0

type SessionBase struct {
	Manager *session.Manager
}

SessionBase provides default SessionHandler methods by wrapping a session.Manager. Embed in a listener to get Sessions, Interact, Kill, WaitForSession for free.

func (*SessionBase) Interact added in v0.3.0

func (b *SessionBase) Interact(id int) error

func (*SessionBase) Kill added in v0.3.0

func (b *SessionBase) Kill(id int) error

func (*SessionBase) Sessions added in v0.3.0

func (b *SessionBase) Sessions() []*session.Session

func (*SessionBase) ShutdownManager added in v0.3.0

func (b *SessionBase) ShutdownManager() error

func (*SessionBase) WaitForSession added in v0.3.0

func (b *SessionBase) WaitForSession(timeout time.Duration) error

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