assets

package
v1.6.6 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: 12 Imported by: 39

README

client/assets

Overview

Manages embedded client asset manifests such as operator profiles, settings, and armory catalogs. Handles serialization, bundling, and lookup of static client metadata. Core logic addresses aliases, armories, C2 profiles, and extensions within the assets package.

Go Files

  • aliases.go – Provides helpers for discovering, installing, and reading alias manifests shipped with the client.
  • armories.go – Loads configured armory definitions and persists operator customizations.
  • assets.go – Central entry point that exposes asset directories, lazy initialization, and filesystem utilities.
  • c2profiles.go – Embeds default HTTP C2 profile templates and exposes lookup utilities.
  • config.go – Tracks client configuration paths and manages persistence of runtime options.
  • extensions.go – Handles embedded extension manifests and supports lookup by command name.
  • settings.go – Stores default console settings and manages serialization to disk.

Documentation

Index

Constants

View Source
const (
	ArmoryConfigFileName = "armories.json"
	DefaultArmoryName    = "Default"
)
View Source
const (
	AliasesDirName = "aliases"
)
View Source
const (
	// ConfigDirName - Directory name containing config files
	ConfigDirName = "configs"
)
View Source
const (
	// ExtensionsDirName - Directory storing the client side extensions
	ExtensionsDirName = "extensions"
)
View Source
const (
	// SliverClientDirName - Directory storing all of the client configs/logs
	SliverClientDirName = ".sliver-client"
)

Variables

View Source
var (
	// DefaultArmoryPublicKey - The default public key for the armory
	DefaultArmoryPublicKey string
	// DefaultArmoryRepoURL - The default repo url for the armory
	DefaultArmoryRepoURL string

	DefaultArmoryConfig = &ArmoryConfig{
		PublicKey: DefaultArmoryPublicKey,
		RepoURL:   DefaultArmoryRepoURL,
		Name:      DefaultArmoryName,
		Enabled:   true,
	}
)

Functions

func GetAliasesDir added in v1.5.0

func GetAliasesDir() string

GetAliasesDir - Returns the path to the config dir

func GetClientLogsDir added in v1.6.0

func GetClientLogsDir() string

GetClientLogsDir - Get the Sliver client logs dir ~/.sliver-client/logs/

func GetConfigDir

func GetConfigDir() string

GetConfigDir - Returns the path to the config dir

func GetConfigs

func GetConfigs() map[string]*ClientConfig

GetConfigs - Returns a list of available configs

func GetConsoleLogsDir added in v1.6.0

func GetConsoleLogsDir() string

GetConsoleLogsDir - Get the Sliver client console logs dir ~/.sliver-client/logs/console/

func GetExtensionsDir added in v1.5.0

func GetExtensionsDir() string

GetExtensionsDir - Get the Sliver extension directory: ~/.sliver-client/extensions

func GetInstalledAliasManifests added in v1.5.0

func GetInstalledAliasManifests() []string

GetInstalledAliasManifests - Returns a list of installed alias manifests

func GetInstalledExtensionManifests added in v1.5.0

func GetInstalledExtensionManifests() []string

GetInstalledExtensionManifests - Returns a list of installed extension manifests

func GetMCPLogsDir added in v1.6.1

func GetMCPLogsDir() string

GetMCPLogsDir - Get the Sliver client MCP logs dir ~/.sliver-client/logs/mcp/

func GetRootAppDir

func GetRootAppDir() string

GetRootAppDir - Get the Sliver app dir ~/.sliver-client/

func RefreshArmoryAuthorization added in v1.6.0

func RefreshArmoryAuthorization(armories []*ArmoryConfig)

func SaveArmoriesConfig added in v1.6.0

func SaveArmoriesConfig(armories []*ArmoryConfig) error

func SaveConfig

func SaveConfig(config *ClientConfig) error

SaveConfig - Save a config to disk

func SaveSettings added in v1.5.0

func SaveSettings(settings *ClientSettings) error

SaveSettings - Save the current settings to disk

func Setup added in v1.5.0

func Setup(force bool, echo bool)

Setup - Extract or create local assets

Types

type ArmoryConfig added in v1.5.0

type ArmoryConfig struct {
	PublicKey        string `json:"public_key"`
	RepoURL          string `json:"repo_url"`
	Authorization    string `json:"authorization"`
	AuthorizationCmd string `json:"authorization_cmd"`
	Name             string `json:"name"`
	Enabled          bool   `json:"enabled"`
}

ArmoryConfig - The armory config file

func GetArmoriesConfig added in v1.5.0

func GetArmoriesConfig() []*ArmoryConfig

GetArmoriesConfig - The parsed armory config file

type ClientConfig

type ClientConfig struct {
	Operator      string `json:"operator"` // This value is actually ignored for the most part (cert CN is used instead)
	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"`
}

ClientConfig - Client JSON config

func ReadConfig

func ReadConfig(confFilePath string) (*ClientConfig, error)

ReadConfig - Load config into struct

type ClientSettings added in v1.5.0

type ClientSettings struct {
	TableStyle        string `json:"tables"`
	AutoAdult         bool   `json:"autoadult"`
	BeaconAutoResults bool   `json:"beacon_autoresults"`
	SmallTermWidth    int    `json:"small_term_width"`
	AlwaysOverflow    bool   `json:"always_overflow"`
	VimMode           bool   `json:"vim_mode"`
	UserConnect       bool   `json:"user_connect"`
	ConsoleLogs       bool   `json:"console_logs"`
}

ClientSettings - Client JSON config

func LoadSettings added in v1.5.0

func LoadSettings() (*ClientSettings, error)

LoadSettings - Load the client settings from disk

type HTTPC2Config added in v1.6.0

type HTTPC2Config struct {
	ImplantConfig HTTPC2ImplantConfig `json:"implant_config"`
	ServerConfig  HTTPC2ServerConfig  `json:"server_config"`
}

HTTPC2Config - Parent config file struct for implant/server

type HTTPC2ImplantConfig added in v1.6.0

type HTTPC2ImplantConfig struct {
	UserAgent         string `json:"user_agent"`
	ChromeBaseVersion int    `json:"chrome_base_version"`
	MacOSVersion      string `json:"macos_version"`

	NonceQueryArgChars string                 `json:"nonce_query_args"`
	URLParameters      []NameValueProbability `json:"url_parameters"`
	Headers            []NameValueProbability `json:"headers"`
	NonceQueryLength   int                    `json:"nonce_query_length"`
	NonceMode          string                 `json:"nonce_mode"`

	MaxFileGen    int `json:"max_files"`
	MinFileGen    int `json:"min_files"`
	MaxPathGen    int `json:"max_paths"`
	MinPathGen    int `json:"min_paths"`
	MaxPathLength int `json:"max_path_length"`
	MinPathLength int `json:"min_path_length"`

	Extensions []string `json:"extensions"`
	Files      []string `json:"files"`
	Paths      []string `json:"paths"`
}

HTTPC2ImplantConfig - Implant configuration options Procedural C2 =============== .txt = rsakey .css = start .php = session

.js = poll

.png = stop .woff = sliver shellcode

type HTTPC2ServerConfig added in v1.6.0

type HTTPC2ServerConfig struct {
	RandomVersionHeaders bool                   `json:"random_version_headers"`
	Headers              []NameValueProbability `json:"headers"`
	Cookies              []string               `json:"cookies"`
}

HTTPC2ServerConfig - Server configuration options

type NameValueProbability added in v1.6.0

type NameValueProbability struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	Probability int    `json:"probability"`
	Method      string `json:"method"`
}

Jump to

Keyboard shortcuts

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