sessions

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: GPL-3.0 Imports: 27 Imported by: 2

README

client/command/sessions

Overview

Implements the 'sessions' command group for the Sliver client console. Handlers map Cobra invocations to sessions workflows such as background, close, interactive, and prune.

Go Files

  • background.go – Sends interactive sessions to the background while keeping them connected.
  • close.go – Closes sessions cleanly via RPC.
  • commands.go – Assembles the sessions command hierarchy and subcommands.
  • helpers.go – Provides lookup utilities and prompt helpers for session selection.
  • interactive.go – Brings sessions into the foreground interactive console.
  • prune.go – Removes disconnected or dead sessions from the server inventory.
  • sessions.go – Lists active sessions and renders tabular summaries.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoSessions - No sessions available.
	ErrNoSessions = errors.New("no sessions")
	// ErrNoSelection - No selection made.
	ErrNoSelection = errors.New("no selection")
)

Functions

func BackgroundCmd

func BackgroundCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

BackgroundCmd - Background the active session.

func CloseSessionCmd added in v1.5.0

func CloseSessionCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

CloseSessionCmd - Close an interactive session but do not kill the remote process.

func Commands added in v1.6.0

func Commands(con *console.SliverClient) []*cobra.Command

Commands returns the `sessions` command and its subcommands.

func InteractiveCmd added in v1.5.0

func InteractiveCmd(cmd *cobra.Command, con *console.SliverClient, _ []string)

InteractiveCmd - Beacon only command to open an interactive session.

func PrintSessions added in v1.5.0

func PrintSessions(sessions map[string]*clientpb.Session, filter string, filterRegex *regexp.Regexp, con *console.SliverClient)

PrintSessions - Print the current sessions.

func SelectSession

func SelectSession(onlyAlive bool, con *console.SliverClient) (*clientpb.Session, error)

SelectSession - Interactive menu for the user to select an session, optionally only display live sessions.

func SessionIDCompleter added in v1.6.0

func SessionIDCompleter(con *console.SliverClient) carapace.Action

SessionIDCompleter completes session IDs.

func SessionsCmd

func SessionsCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

SessionsCmd - Display/interact with sessions.

func SessionsPruneCmd

func SessionsPruneCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

SessionsPruneCmd - Forcefully kill stale sessions.

func ShortSessionID added in v1.5.0

func ShortSessionID(id string) string

ShortSessionID - Shorten the session ID.

func SliverCommands added in v1.6.0

func SliverCommands(con *console.SliverClient) []*cobra.Command

SliverCommands returns all session control commands for the active target.

Types

This section is empty.

Jump to

Keyboard shortcuts

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