Documentation
¶
Index ¶
- type Client
- func (con *Client) AddConnectHooks(hooks ...func() error)
- func (con *Client) CompletionScope() string
- func (con *Client) ConnectComplete() (carapace.Action, error)
- func (con *Client) ConnectRun(cmd *cobra.Command, _ []string) error
- func (con *Client) Disconnect() error
- func (c *Client) Init() error
- func (con *Client) Users() (users []team.User, err error)
- func (con *Client) VersionClient() (version team.Version, err error)
- func (con *Client) VersionServer() (version team.Version, err error)
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 (*Client) AddConnectHooks ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.