Documentation ¶
Index ¶
- Variables
- type ApplicationLogin
- type Doer
- type Evidence
- type GraphQLErrorResponse
- type GraphQLQueryTemplateParams
- type Issue
- type IssueDefinition
- type IssueEvent
- type Resturp
- func (r *Resturp) CancelScan(ctx context.Context, ID uint)
- func (r *Resturp) DeleteScan(ctx context.Context, ID uint)
- func (r *Resturp) GetIssueDefinitions(ctx context.Context) ([]IssueDefinition, error)
- func (r *Resturp) GetScanStatus(ctx context.Context, ID uint) (*ScanStatus, error)
- func (r *Resturp) LaunchScan(ctx context.Context, targetURL string, configs []string) (uint, error)
- type Scan
- type ScanCallback
- type ScanConfiguration
- type ScanPayloadError
- type ScanStatus
- type Scope
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnexpectedStatusCodeReceived is returned when a http request // response does not match expected status code. ErrUnexpectedStatusCodeReceived = errors.New("unexpected status code received") // ErrGraphQLResponse is returned when a http request to the Burp GraphQL // API respond with a formatted error. ErrGraphQLResponse = errors.New("GraphQL API error response received") // ErrNoLocationHeader is returned when creating a Burp scan and // the scan ID is available in the location header response. ErrNoLocationHeader = errors.New("no location header received") )
var (
GraphQLQueryTemplate = `` /* 273-byte string literal not displayed */
)
Functions ¶
This section is empty.
Types ¶
type ApplicationLogin ¶
type ApplicationLogin struct { Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` }
ApplicationLogin defines credentials to be used in a scan.
type Evidence ¶
type Evidence struct { Detail struct { BandFlags []string `json:"band_flags"` Payload struct { Bytes string `json:"bytes"` Flags int64 `json:"flags"` } `json:"payload"` } `json:"detail"` RequestResponse struct { Request []struct { Data string `json:"data"` Length int64 `json:"length"` Type string `json:"type"` } `json:"request"` RequestTime string `json:"request_time"` Response []struct { Data string `json:"data"` Length int64 `json:"length"` Type string `json:"type"` } `json:"response"` URL string `json:"url"` WasRedirectFollowed bool `json:"was_redirect_followed"` } `json:"request_response"` Type string `json:"type"` }
type GraphQLErrorResponse ¶
type GraphQLErrorResponse struct { Errors []struct { Message string `json:"message"` Extensions struct { Code int `json:"code"` } `json:"extensions"` } `json:"errors"` }
GraphQLErrorResponse defines the Burp GrapQL API error response structure.
type Issue ¶
type Issue struct { Caption string `json:"caption"` Confidence string `json:"confidence"` Description string `json:"description"` Evidence []Evidence `json:"evidence"` InternalData string `json:"internal_data"` Name string `json:"name"` Origin string `json:"origin"` Path string `json:"path"` SerialNumber string `json:"serial_number"` Severity string `json:"severity"` TypeIndex int64 `json:"type_index"` }
type IssueDefinition ¶
type IssueEvent ¶
type Resturp ¶
type Resturp struct {
// contains filtered or unexported fields
}
Resturp is a client for the Burp scanner rest API.
func New ¶
New returns a ready to use Burp REST client. The burpRESTURL must have the form: https://hostname:port.
func (*Resturp) CancelScan ¶
CancelScan cancels the scan with the given id.
func (*Resturp) DeleteScan ¶
DeleteScan deletes the scan with the given id.
func (*Resturp) GetIssueDefinitions ¶
func (r *Resturp) GetIssueDefinitions(ctx context.Context) ([]IssueDefinition, error)
GetIssueDefinitions gets the current defined issues in burp.
func (*Resturp) GetScanStatus ¶
GetScanStatus returns the status of a scan.
func (*Resturp) LaunchScan ¶
LaunchScan runs a new scan using the specified configurations against the given target url. The configurations must exist in the Burp library, for instance: "Minimize false positives". It returns the id of the created scan.
type Scan ¶
type Scan struct { ApplicationLogins []ApplicationLogin `json:"application_logins,omitempty"` Name string `json:"name,omitempty"` ResourcePool string `json:"resource_pool,omitempty"` ScanCallback *ScanCallback `json:"scan_callback,omitempty"` ScanConfigurations []ScanConfiguration `json:"scan_configurations,omitempty"` Scope *Scope `json:"scope,omitempty"` Urls []string `json:"urls"` }
Scan defines the information required by the BURP API to create a scan.
type ScanCallback ¶
type ScanCallback struct {
URL string `json:"url,omitempty"`
}
ScanCallback defines a url to be call when the scan finishes.
type ScanConfiguration ¶
type ScanConfiguration struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` }
ScanConfiguration defines a named configuration to be used in a scan. The configuration must be present in the Burp scan configuration library. The type parameter must be set to NamedConfiguration.
type ScanPayloadError ¶
ScanPayloadError defines the info returned by burp when there is controlled error creating a scan.
func (ScanPayloadError) Error ¶
func (s ScanPayloadError) Error() string
type ScanStatus ¶
type ScanStatus struct { TaskID string `json:"task_id"` Status string `json:"scan_status"` IssueEvents []IssueEvent `json:"issue_events"` }
ScanStatus defines the info returned by the Burp API when querying the status of a scan.
type Scope ¶
type Scope struct { Exclude []struct { Rule string `json:"rule,omitempty"` } `json:"exclude,omitempty"` Include []struct { Rule string `json:"rule,omitempty"` } `json:"include,omitempty"` Type string `json:"type,omitempty"` }
Scope defines rules to include or exclude url's in a web scan.