sliver

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

Connect establishes a gRPC connection to a Sliver teamserver using mTLS.

Types

type Backend

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

Backend implements c2.Backend for Sliver C2 integration.

func New

func New(configPath string) *Backend

New creates a Sliver backend from an operator config file path.

func (*Backend) GenerateImplant

func (b *Backend) GenerateImplant(targetOS, arch string) ([]byte, error)

GenerateImplant generates a raw Sliver implant binary. Used by the runner for CmdStager delivery (chunked printf/bourne).

func (*Backend) GeneratePayload

func (b *Backend) GeneratePayload(targetOS, arch string) (string, error)

GeneratePayload generates a Sliver implant, stages it, and returns a curl download-and-execute command. Use StageImplant + pkg/payload for finer control over the fetch method.

func (*Backend) Name

func (b *Backend) Name() string

func (*Backend) Setup

func (b *Backend) Setup(lhost string, lport int) error

Setup connects to the Sliver teamserver and starts an mTLS listener.

func (*Backend) Shutdown

func (b *Backend) Shutdown() error

Shutdown tears down staging servers, kills the Sliver listener, and closes the gRPC connection.

func (*Backend) StageImplant

func (b *Backend) StageImplant(targetOS, arch string) (string, error)

StageImplant generates a Sliver implant, serves it over an in-memory HTTP server, and returns the staging URL.

func (*Backend) TCPStageImplant

func (b *Backend) TCPStageImplant(targetOS, arch string) ([]byte, error)

TCPStageImplant generates a Sliver implant, starts a one-shot TCP staging server, and compiles a fresh stager binary with the host:port baked in. The payload stream is XOR-encrypted with a per-stager random key.

func (*Backend) WaitForSession

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

WaitForSession subscribes to Sliver events and blocks until a new session connects.

type OperatorConfig

type OperatorConfig struct {
	Operator      string `json:"operator"`
	LHost         string `json:"lhost"`
	LPort         int    `json:"lport"`
	Token         string `json:"token"`
	CACertificate string `json:"ca_certificate"`
	PrivateKey    string `json:"private_key"`
	Certificate   string `json:"certificate"`
}

OperatorConfig represents a Sliver operator .cfg file (JSON with mTLS certs).

func ParseConfig

func ParseConfig(path string) (*OperatorConfig, error)

ParseConfig reads and parses a Sliver operator config file.

Jump to

Keyboard shortcuts

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