client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Teamclient & remotes
	Teamclient *client.Client

	// Services
	Hosts hosts.HostsClient

	Services network.ServicesClient
	Creds    credentials.CredentialsClient
	Logins   credentials.LoginsClient
	Scans    scans.ScansClient
	Agents   c2.AgentsClient
	Channels c2.ChannelsClient
	// contains filtered or unexported fields
}

Client connects to an AIMS database through a gRPC connection. The client can be passed around to use the different services offered by the AIMS server backend.

func New

func New(opts ...grpc.DialOption) (con *Client, err error)

func (*Client) AddConnectHooks

func (con *Client) AddConnectHooks(hooks ...func() error)

AddConnectHooks should be considered part of the temporary API. It is used to all the Sliver client to run hooks before running its own pre-connect handlers, and can thus be used to register server-only pre-run routines.

func (*Client) CompletionScope

func (con *Client) CompletionScope() string

CompletionScope returns a stable identifier for the teamserver this client talks to (user@host:port), used to namespace on-disk completion caches so a multiplayer client never serves one server's objects when completing against another. It returns "local" when no remote config is selected (the in-process teamserver). Note: the remote config is only populated once Teamclient.Connect() has run, so in exec-once CLI mode — where the scope is read before the per-Tab connection — this falls back to "local"; segmentation is exact in the persistent console. Resolving the selected config's host without a full connect is a follow-up.

func (*Client) ConnectComplete

func (con *Client) ConnectComplete() (carapace.Action, error)

ConnectComplete is a special connection mode which should be called in completer functions that need to use the client RPC. It is almost equivalent to client.ConnectRun(), but for completions.

If the connection failed, an error is returned along with a completion action include the error as a status message, to be returned by completers.

This function is safe to call regardless of the client being used as a closed-loop console mode or in an exec-once CLI mode.

func (*Client) ConnectRun

func (con *Client) ConnectRun(cmd *cobra.Command, _ []string) error

ConnectRun is a spf13/cobra-compliant runner function to be included in/as any of the runners that such cobra.Commands offer to use.

The function will connect the Sliver teamclient to a remote server, register its client RPC interfaces, and start handling events/log streams.

Note that this function will always check if it used as part of a completion command execution call, in which case asciicast/logs streaming is disabled.

func (*Client) Disconnect

func (con *Client) Disconnect() error

Disconnect disconnects the client from its Sliver server, closing all its event/log streams and files, then closing the core Sliver RPC client connection. After this call, the client can reconnect should it want to.

func (*Client) Init

func (c *Client) Init() error

Init registers all gRPC clients to the existing teamclient connection.

func (*Client) Users

func (con *Client) Users() (users []team.User, err error)

Users returns a list of all users registered with the app teamserver. If the gRPC teamclient is not connected or does not have an RPC client, an ErrNoRPC is returned.

func (*Client) VersionClient

func (con *Client) VersionClient() (version team.Version, err error)

func (*Client) VersionServer

func (con *Client) VersionServer() (version team.Version, err error)

VersionServer returns the version information of the server to which the client is connected, or nil and an error if it could not retrieve it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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