Documentation ¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func String(s string) *string
- type Agents
- func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetAgentResponse, error)
- func (s *Agents) SendHeartbeat(ctx context.Context, id int64, opts ...operations.Option) (*operations.SendHeartbeatResponse, error)
- func (s *Agents) SetAgentShutdown(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetAgentShutdownResponse, error)
- func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody []components.HashcatBenchmark, ...) (*operations.SubmitBenchmarkResponse, error)
- func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, agentError *components.AgentError, ...) (*operations.SubmitErrorAgentResponse, error)
- func (s *Agents) UpdateAgent(ctx context.Context, id int64, agentUpdate *components.AgentUpdate, ...) (*operations.UpdateAgentResponse, error)
- type Attacks
- type CipherSwarmAgentSDK
- type Client
- type Crackers
- type HTTPClient
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithDefaultHost(defaultHost string) SDKOption
- func WithHostAddress(hostAddress string) SDKOption
- func WithHostPort(hostPort string) SDKOption
- func WithRetryConfig(retryConfig retry.Config) SDKOption
- func WithSecurity(bearerAuth string) SDKOption
- func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- func WithTimeout(timeout time.Duration) SDKOption
- type Tasks
- func (s *Tasks) GetNewTask(ctx context.Context, opts ...operations.Option) (*operations.GetNewTaskResponse, error)
- func (s *Tasks) GetTask(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetTaskResponse, error)
- func (s *Tasks) GetTaskZaps(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetTaskZapsResponse, error)
- func (s *Tasks) SendCrack(ctx context.Context, id int64, hashcatResult *components.HashcatResult, ...) (*operations.SendCrackResponse, error)
- func (s *Tasks) SendStatus(ctx context.Context, id int64, taskStatus components.TaskStatus, ...) (*operations.SendStatusResponse, error)
- func (s *Tasks) SetTaskAbandoned(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskAbandonedResponse, error)
- func (s *Tasks) SetTaskAccepted(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskAcceptedResponse, error)
- func (s *Tasks) SetTaskExhausted(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskExhaustedResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"https://{defaultHost}",
"http://{hostAddress}:{hostPort}",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Agents ¶
type Agents struct {
// contains filtered or unexported fields
}
Agents API
func (*Agents) GetAgent ¶ added in v0.2.0
func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetAgentResponse, error)
GetAgent - Gets an instance of an agent Returns an agent
func (*Agents) SendHeartbeat ¶ added in v0.2.0
func (s *Agents) SendHeartbeat(ctx context.Context, id int64, opts ...operations.Option) (*operations.SendHeartbeatResponse, error)
SendHeartbeat - Send a heartbeat for an agent Send a heartbeat for an agent to keep it alive.
func (*Agents) SetAgentShutdown ¶ added in v0.4.0
func (s *Agents) SetAgentShutdown(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetAgentShutdownResponse, error)
SetAgentShutdown - shutdown agent Marks the agent as shutdown and offline, freeing any assigned tasks.
func (*Agents) SubmitBenchmark ¶ added in v0.2.0
func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody []components.HashcatBenchmark, opts ...operations.Option) (*operations.SubmitBenchmarkResponse, error)
SubmitBenchmark - submit_benchmark agent Submit a benchmark for an agent
func (*Agents) SubmitErrorAgent ¶ added in v0.2.2
func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, agentError *components.AgentError, opts ...operations.Option) (*operations.SubmitErrorAgentResponse, error)
SubmitErrorAgent - Submit an error for an agent Submit an error for an agent
func (*Agents) UpdateAgent ¶
func (s *Agents) UpdateAgent(ctx context.Context, id int64, agentUpdate *components.AgentUpdate, opts ...operations.Option) (*operations.UpdateAgentResponse, error)
UpdateAgent - Updates the agent Updates an agent
type Attacks ¶
type Attacks struct {
// contains filtered or unexported fields
}
Attacks API
func (*Attacks) GetAttack ¶ added in v0.2.0
func (s *Attacks) GetAttack(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetAttackResponse, error)
GetAttack - show attack Returns an attack by id. This is used to get the details of an attack.
func (*Attacks) GetHashList ¶ added in v0.2.0
func (s *Attacks) GetHashList(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetHashListResponse, error)
GetHashList - Get the hash list Returns the hash list for an attack.
type CipherSwarmAgentSDK ¶
type CipherSwarmAgentSDK struct { // Agents API Agents *Agents // Attacks API Attacks *Attacks // Crackers API Crackers *Crackers // Tasks API Tasks *Tasks // Client API Client *Client // contains filtered or unexported fields }
CipherSwarmAgentSDK - CypherSwarm Agent API: The CypherSwarm Agent API is used to allow agents to connect to the CypherSwarm server.
func New ¶
func New(opts ...SDKOption) *CipherSwarmAgentSDK
New creates a new instance of the SDK with the provided options
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client API
func (*Client) Authenticate ¶
func (s *Client) Authenticate(ctx context.Context, opts ...operations.Option) (*operations.AuthenticateResponse, error)
Authenticate Client Authenticates the client. This is used to verify that the client is able to connect to the server.
func (*Client) GetConfiguration ¶ added in v0.2.0
func (s *Client) GetConfiguration(ctx context.Context, opts ...operations.Option) (*operations.GetConfigurationResponse, error)
GetConfiguration - Get Agent Configuration Returns the configuration for the agent.
type Crackers ¶
type Crackers struct {
// contains filtered or unexported fields
}
Crackers API
func (*Crackers) CheckForCrackerUpdate ¶
func (s *Crackers) CheckForCrackerUpdate(ctx context.Context, operatingSystem *string, version *string, opts ...operations.Option) (*operations.CheckForCrackerUpdateResponse, error)
CheckForCrackerUpdate - Check for Cracker Update Check for a cracker update, based on the operating system and version.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type SDKOption ¶
type SDKOption func(*CipherSwarmAgentSDK)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithDefaultHost ¶
WithDefaultHost allows setting the defaultHost variable for url substitution
func WithHostAddress ¶
WithHostAddress allows setting the hostAddress variable for url substitution
func WithHostPort ¶
WithHostPort allows setting the hostPort variable for url substitution
func WithRetryConfig ¶
func WithSecurity ¶
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
func WithTemplatedServerURL ¶
WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTimeout ¶ added in v0.6.0
WithTimeout Optional request timeout applied to each operation
type Tasks ¶
type Tasks struct {
// contains filtered or unexported fields
}
Tasks API
func (*Tasks) GetNewTask ¶ added in v0.2.0
func (s *Tasks) GetNewTask(ctx context.Context, opts ...operations.Option) (*operations.GetNewTaskResponse, error)
GetNewTask - Request a new task from server Request a new task from the server, if available.
func (*Tasks) GetTask ¶ added in v0.2.0
func (s *Tasks) GetTask(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetTaskResponse, error)
GetTask - Request the task information Request the task information from the server.
func (*Tasks) GetTaskZaps ¶ added in v0.7.0
func (s *Tasks) GetTaskZaps(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetTaskZapsResponse, error)
GetTaskZaps - Get Completed Hashes Gets the completed hashes for a task. This is a text file that should be added to the monitored directory to remove the hashes from the list during runtime.
func (*Tasks) SendCrack ¶ added in v0.2.0
func (s *Tasks) SendCrack(ctx context.Context, id int64, hashcatResult *components.HashcatResult, opts ...operations.Option) (*operations.SendCrackResponse, error)
SendCrack - Submit a cracked hash result for a task Submit a cracked hash result for a task.
func (*Tasks) SendStatus ¶ added in v0.2.0
func (s *Tasks) SendStatus(ctx context.Context, id int64, taskStatus components.TaskStatus, opts ...operations.Option) (*operations.SendStatusResponse, error)
SendStatus - Submit a status update for a task Submit a status update for a task. This includes the status of the current guess and the devices.
func (*Tasks) SetTaskAbandoned ¶ added in v0.2.0
func (s *Tasks) SetTaskAbandoned(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskAbandonedResponse, error)
SetTaskAbandoned - Abandon Task Abandon a task. This will mark the task as abandoned. Usually used when the client is unable to complete the task.
func (*Tasks) SetTaskAccepted ¶ added in v0.2.0
func (s *Tasks) SetTaskAccepted(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskAcceptedResponse, error)
SetTaskAccepted - Accept Task Accept an offered task from the server.
func (*Tasks) SetTaskExhausted ¶ added in v0.2.0
func (s *Tasks) SetTaskExhausted(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetTaskExhaustedResponse, error)
SetTaskExhausted - Notify of Exhausted Task Notify the server that the task is exhausted. This will mark the task as completed.