requests

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package requests implements requests for templates that will be sent to hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleDecompression added in v1.1.5

func HandleDecompression(r *retryablehttp.Request, bodyOrig []byte) (bodyDec []byte, err error)

HandleDecompression if the user specified a custom encoding (as golang transport doesn't do this automatically)

Types

type CompiledHTTP added in v1.1.5

type CompiledHTTP struct {
	Request *retryablehttp.Request
	Error   error
	Meta    map[string]interface{}
}

CompiledHTTP contains Generated HTTP Request or error

type CustomHeaders added in v1.1.5

type CustomHeaders []string

CustomHeaders valid for all requests

func (*CustomHeaders) Set added in v1.1.5

func (c *CustomHeaders) Set(value string) error

Set a new global header

func (*CustomHeaders) String added in v1.1.5

func (c *CustomHeaders) String() string

String returns just a label

type DNSRequest added in v1.1.1

type DNSRequest struct {
	Recursion bool `yaml:"recursion"`
	// Path contains the path/s for the request
	Name    string `yaml:"name"`
	Type    string `yaml:"type"`
	Class   string `yaml:"class"`
	Retries int    `yaml:"retries"`
	// Raw contains a raw request
	Raw string `yaml:"raw,omitempty"`

	// Matchers contains the detection mechanism for the request to identify
	// whether the request was successful
	Matchers []*matchers.Matcher `yaml:"matchers,omitempty"`

	// MatchersCondition is the condition of the matchers
	// whether to use AND or OR. Default is OR.
	MatchersCondition string `yaml:"matchers-condition,omitempty"`
	// Extractors contains the extraction mechanism for the request to identify
	// and extract parts of the response.
	Extractors []*extractors.Extractor `yaml:"extractors,omitempty"`
	// contains filtered or unexported fields
}

DNSRequest contains a request to be made from a template

func (*DNSRequest) GetMatchersCondition added in v1.1.1

func (r *DNSRequest) GetMatchersCondition() matchers.ConditionType

GetMatchersCondition returns the condition for the matcher

func (*DNSRequest) MakeDNSRequest added in v1.1.1

func (r *DNSRequest) MakeDNSRequest(domain string) (*dns.Msg, error)

MakeDNSRequest creates a *dns.Request from a request template

func (*DNSRequest) SetMatchersCondition added in v1.1.1

func (r *DNSRequest) SetMatchersCondition(condition matchers.ConditionType)

SetMatchersCondition sets the condition for the matcher

type HTTPRequest added in v1.1.1

type HTTPRequest struct {
	// AttackType is the attack type
	// Sniper, PitchFork and ClusterBomb. Default is Sniper
	AttackType string `yaml:"attack,omitempty"`

	// Path contains the path/s for the request variables
	Payloads map[string]string `yaml:"payloads,omitempty"`
	// Method is the request method, whether GET, POST, PUT, etc
	Method string `yaml:"method"`
	// Path contains the path/s for the request
	Path []string `yaml:"path"`
	// Headers contains headers to send with the request
	Headers map[string]string `yaml:"headers,omitempty"`
	// Body is an optional parameter which contains the request body for POST methods, etc
	Body string `yaml:"body,omitempty"`
	// Matchers contains the detection mechanism for the request to identify
	// whether the request was successful
	Matchers []*matchers.Matcher `yaml:"matchers,omitempty"`
	// MatchersCondition is the condition of the matchers
	// whether to use AND or OR. Default is OR.
	MatchersCondition string `yaml:"matchers-condition,omitempty"`

	// Extractors contains the extraction mechanism for the request to identify
	// and extract parts of the response.
	Extractors []*extractors.Extractor `yaml:"extractors,omitempty"`
	// Redirects specifies whether redirects should be followed.
	Redirects bool `yaml:"redirects,omitempty"`
	// MaxRedirects is the maximum number of redirects that should be followed.
	MaxRedirects int `yaml:"max-redirects,omitempty"`
	// Raw contains raw requests
	Raw []string `yaml:"raw,omitempty"`
	// contains filtered or unexported fields
}

HTTPRequest contains a request to be made from a template

func (*HTTPRequest) GetAttackType added in v1.1.5

func (r *HTTPRequest) GetAttackType() generators.Type

GetAttackType returns the attack

func (*HTTPRequest) GetMatchersCondition added in v1.1.1

func (r *HTTPRequest) GetMatchersCondition() matchers.ConditionType

GetMatchersCondition returns the condition for the matcher

func (*HTTPRequest) MakeHTTPRequest added in v1.1.1

func (r *HTTPRequest) MakeHTTPRequest(baseURL string) (chan *CompiledHTTP, error)

MakeHTTPRequest creates a *http.Request from a request configuration

func (*HTTPRequest) SetAttackType added in v1.1.5

func (r *HTTPRequest) SetAttackType(attack generators.Type)

SetAttackType sets the attack

func (*HTTPRequest) SetMatchersCondition added in v1.1.1

func (r *HTTPRequest) SetMatchersCondition(condition matchers.ConditionType)

SetMatchersCondition sets the condition for the matcher

Jump to

Keyboard shortcuts

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