2020-12-21 09:01:32 +00:00
|
|
|
package http
|
2020-12-21 22:41:07 +00:00
|
|
|
|
2020-12-26 09:25:15 +00:00
|
|
|
import (
|
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
|
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/generators"
|
|
|
|
)
|
2020-12-21 22:41:07 +00:00
|
|
|
|
|
|
|
// Request contains a http request to be made from a template
|
|
|
|
type Request struct {
|
2020-12-23 10:46:16 +00:00
|
|
|
// Name is the name of the request
|
2020-12-23 20:12:04 +00:00
|
|
|
Name string `yaml:"Name"`
|
2020-12-23 10:46:16 +00:00
|
|
|
// AttackType is the attack type
|
|
|
|
// Sniper, PitchFork and ClusterBomb. Default is Sniper
|
2020-12-23 20:12:04 +00:00
|
|
|
AttackType string `yaml:"attack"`
|
2020-12-23 10:46:16 +00:00
|
|
|
// Method is the request method, whether GET, POST, PUT, etc
|
|
|
|
Method string `yaml:"method"`
|
|
|
|
// Body is an optional parameter which contains the request body for POST methods, etc
|
2020-12-23 20:12:04 +00:00
|
|
|
Body string `yaml:"body"`
|
2020-12-23 10:46:16 +00:00
|
|
|
// Path contains the path/s for the request
|
|
|
|
Path []string `yaml:"path"`
|
|
|
|
// Raw contains raw requests
|
2020-12-23 20:12:04 +00:00
|
|
|
Raw []string `yaml:"raw"`
|
2020-12-23 10:46:16 +00:00
|
|
|
// Path contains the path/s for the request variables
|
2020-12-23 20:12:04 +00:00
|
|
|
Payloads map[string]interface{} `yaml:"payloads"`
|
2020-12-23 10:46:16 +00:00
|
|
|
// Headers contains headers to send with the request
|
2020-12-23 20:12:04 +00:00
|
|
|
Headers map[string]string `yaml:"headers"`
|
|
|
|
// RaceNumberRequests is the number of same request to send in race condition attack
|
|
|
|
RaceNumberRequests int `yaml:"race_count"`
|
|
|
|
// MaxRedirects is the maximum number of redirects that should be followed.
|
|
|
|
MaxRedirects int `yaml:"max-redirects"`
|
|
|
|
// PipelineConcurrentConnections is number of connections in pipelining
|
|
|
|
PipelineConcurrentConnections int `yaml:"pipeline-concurrent-connections"`
|
|
|
|
// PipelineRequestsPerConnection is number of requests in pipelining
|
|
|
|
PipelineRequestsPerConnection int `yaml:"pipeline-requests-per-connection"`
|
|
|
|
// Threads specifies number of threads for sending requests
|
|
|
|
Threads int `yaml:"threads"`
|
|
|
|
// CookieReuse is an optional setting that makes cookies shared within requests
|
|
|
|
CookieReuse bool `yaml:"cookie-reuse"`
|
|
|
|
// Redirects specifies whether redirects should be followed.
|
|
|
|
Redirects bool `yaml:"redirects"`
|
|
|
|
// Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining (race conditions/billions requests)
|
|
|
|
// All requests must be indempotent (GET/POST)
|
|
|
|
Pipeline bool `yaml:"pipeline"`
|
|
|
|
// Specify in order to skip request RFC normalization
|
|
|
|
Unsafe bool `yaml:"unsafe"`
|
|
|
|
// DisableAutoHostname Enable/Disable Host header for unsafe raw requests
|
|
|
|
DisableAutoHostname bool `yaml:"disable-automatic-host-header"`
|
|
|
|
// DisableAutoContentLength Enable/Disable Content-Length header for unsafe raw requests
|
|
|
|
DisableAutoContentLength bool `yaml:"disable-automatic-content-length-header"`
|
|
|
|
// Race determines if all the request have to be attempted at the same time
|
|
|
|
// The minimum number fof requests is determined by threads
|
|
|
|
Race bool `yaml:"race"`
|
|
|
|
|
|
|
|
attackType generators.Type
|
2020-12-26 17:27:40 +00:00
|
|
|
generator *generators.Generator // optional, only enabled when using payloads
|
2020-12-26 09:25:15 +00:00
|
|
|
options *protocols.ExecuterOptions
|
2020-12-21 22:41:07 +00:00
|
|
|
}
|