alias

package
v1.6.5 Latest Latest
Warning

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

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

README

client/command/alias

Overview

Implements the 'alias' command group for the Sliver client console. Handlers map Cobra invocations to alias workflows such as install, load, and remove.

Go Files

  • alias.go – Implements runtime alias management, printing installed aliases and exposing tab-completion helpers.
  • alias_test.go (tests) – Exercises manifest parsing logic to ensure alias metadata is interpreted correctly.
  • commands.go – Wires Cobra commands for listing, installing, loading, and removing aliases into the client console.
  • install.go – Handles installing alias bundles from directories or archives, writing manifests and payload artifacts to disk.
  • load.go – Loads alias manifests, validates target compatibility, and registers commands against the active console.
  • remove.go – Removes installed aliases, prompting for confirmation and deleting associated on-disk assets.

Documentation

Index

Constants

View Source
const (
	ManifestFileName = "alias.json"
)

Variables

This section is empty.

Functions

func AliasCommandNameCompleter

func AliasCommandNameCompleter(prefix string, args []string, con *console.SliverClient) []string

AliasCommandNameCompleter - Completer for installed extensions command names.

func AliasCompleter added in v1.6.0

func AliasCompleter() carapace.Action

AliasCommandNameCompleter - Completer for installed extensions command names.

func AliasesCmd

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

AliasesCmd - The alias command.

func AliasesInstallCmd

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

AliasesInstallCmd - Install an alias.

func AliasesLoadCmd

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

AliasesLoadCmd - Locally load a alias into the Sliver shell.

func AliasesRemoveCmd

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

AliasesRemoveCmd - Locally load a alias into the Sliver shell.

func Commands added in v1.6.0

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

Commands returns the `alias` command and its child commands.

func InstallFromFile

func InstallFromFile(aliasGzFilePath string, aliasName string, promptToOverwrite bool, con *console.SliverClient) *string

Install an extension from a .tar.gz file.

func PrintAliases

func PrintAliases(con *console.SliverClient)

PrintAliases - Print a list of loaded aliases.

func PrintAssemblyOutput

func PrintAssemblyOutput(cmdName string, schema *packages.OutputSchema, execAsmResp *sliverpb.ExecuteAssembly, outFilePath *os.File, con *console.SliverClient)

PrintAssemblyOutput - Prints the output of an execute-assembly command.

func PrintSideloadOutput

func PrintSideloadOutput(cmdName string, schema *packages.OutputSchema, sideloadResp *sliverpb.Sideload, outFilePath *os.File, con *console.SliverClient)

PrintSideloadOutput - Prints the output of a sideload command.

func PrintSpawnDLLOutput

func PrintSpawnDLLOutput(cmdName string, schema *packages.OutputSchema, spawnDllResp *sliverpb.SpawnDll, outFilePath *os.File, con *console.SliverClient)

PrintSpawnDLLOutput - Prints the output of a spawn dll command.

func RemoveAliasByCommandName

func RemoveAliasByCommandName(commandName string, con *console.SliverClient) error

RemoveAliasByCommandName - Remove an alias by command name.

Types

type AliasArgument added in v1.6.3

type AliasArgument struct {
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Desc     string      `json:"desc"`
	Optional bool        `json:"optional"`
	Default  interface{} `json:"default,omitempty"`
	Choices  []string    `json:"choices,omitempty"`
}

AliasArgument - An argument for an alias command.

type AliasFile

type AliasFile struct {
	OS   string `json:"os"`
	Arch string `json:"arch"`
	Path string `json:"path"`
}

AliasFile - An OS/Arch specific file.

type AliasManifest

type AliasManifest struct {
	Name           string `json:"name"`
	Version        string `json:"version"`
	CommandName    string `json:"command_name"`
	OriginalAuthor string `json:"original_author"`
	RepoURL        string `json:"repo_url"`
	Help           string `json:"help"`
	LongHelp       string `json:"long_help"`

	Entrypoint   string                 `json:"entrypoint"`
	AllowArgs    bool                   `json:"allow_args"`
	DefaultArgs  string                 `json:"default_args"`
	Arguments    []*AliasArgument       `json:"arguments"`
	Files        []*AliasFile           `json:"files"`
	IsReflective bool                   `json:"is_reflective"`
	IsAssembly   bool                   `json:"is_assembly"`
	Schema       *packages.OutputSchema `json:"schema"`

	RootPath   string `json:"-"`
	ArmoryName string `json:"-"`
	ArmoryPK   string `json:"-"`
}

AliasManifest - The manifest for an alias, contains metadata.

func LoadAlias

func LoadAlias(manifestPath string, cmd *cobra.Command, con *console.SliverClient) (*AliasManifest, error)

LoadAlias - Load an alias into the Sliver shell from a given directory.

func ParseAliasManifest

func ParseAliasManifest(data []byte) (*AliasManifest, error)

ParseAliasManifest - Parse an alias manifest.

Jump to

Keyboard shortcuts

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