(Attacks)
Attacks API
- GetAttack - show attack
- GetHashList - Get the hash list
Returns an attack by id. This is used to get the details of an attack.
package main
import(
cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
"context"
"log"
)
func main() {
s := cipherswarmagentsdkgo.New(
cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Attacks.GetAttack(ctx, 535539)
if err != nil {
log.Fatal(err)
}
if res.Attack != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
int64 | ✔️ | id |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetAttackResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.ErrorObject | 401, 404 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Returns the hash list for an attack.
package main
import(
cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
"context"
"log"
)
func main() {
s := cipherswarmagentsdkgo.New(
cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Attacks.GetHashList(ctx, 904122)
if err != nil {
log.Fatal(err)
}
if res.ResponseStream != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
int64 | ✔️ | id |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetHashListResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |