2020-04-03 18:47:57 +00:00
|
|
|
package templates
|
|
|
|
|
|
|
|
import (
|
2020-12-29 11:03:25 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
|
2020-12-29 10:08:14 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/dns"
|
2021-01-01 09:58:28 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/file"
|
2021-02-21 11:01:34 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/headless"
|
2020-12-29 10:08:14 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/http"
|
2020-12-30 09:24:20 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/network"
|
2020-12-29 10:08:14 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/workflows"
|
2020-04-03 18:47:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Template is a request template parsed from a yaml file
|
|
|
|
type Template struct {
|
|
|
|
// ID is the unique id for the template
|
|
|
|
ID string `yaml:"id"`
|
|
|
|
// Info contains information about the template
|
2021-02-03 19:39:29 +00:00
|
|
|
Info map[string]interface{} `yaml:"info"`
|
2020-12-29 10:08:14 +00:00
|
|
|
// RequestsHTTP contains the http request to make in the template
|
2021-05-01 12:58:24 +00:00
|
|
|
RequestsHTTP []*http.Request `yaml:"requests,omitempty" json:"requests"`
|
2020-07-18 19:42:23 +00:00
|
|
|
// RequestsDNS contains the dns request to make in the template
|
2021-05-01 12:58:24 +00:00
|
|
|
RequestsDNS []*dns.Request `yaml:"dns,omitempty" json:"dns"`
|
2021-01-01 09:58:28 +00:00
|
|
|
// RequestsFile contains the file request to make in the template
|
2021-05-01 12:58:24 +00:00
|
|
|
RequestsFile []*file.Request `yaml:"file,omitempty" json:"file"`
|
2020-12-30 09:24:20 +00:00
|
|
|
// RequestsNetwork contains the network request to make in the template
|
2021-05-01 12:58:24 +00:00
|
|
|
RequestsNetwork []*network.Request `yaml:"network,omitempty" json:"network"`
|
2021-02-21 11:01:34 +00:00
|
|
|
// RequestsHeadless contains the headless request to make in the template.
|
2021-05-01 12:58:24 +00:00
|
|
|
RequestsHeadless []*headless.Request `yaml:"headless,omitempty" json:"headless"`
|
2021-02-03 19:39:29 +00:00
|
|
|
|
2020-12-29 10:08:14 +00:00
|
|
|
// Workflows is a yaml based workflow declaration code.
|
2021-02-21 11:01:34 +00:00
|
|
|
workflows.Workflow `yaml:",inline,omitempty"`
|
2021-05-01 12:58:24 +00:00
|
|
|
CompiledWorkflow *workflows.Workflow `yaml:"-" json:"-" jsonschema:"-"`
|
2020-12-30 07:56:55 +00:00
|
|
|
|
2020-12-29 12:32:45 +00:00
|
|
|
// TotalRequests is the total number of requests for the template.
|
2021-05-01 12:58:24 +00:00
|
|
|
TotalRequests int `yaml:"-" json:"-"`
|
2020-12-29 12:32:45 +00:00
|
|
|
// Executer is the actual template executor for running template requests
|
2021-05-01 12:58:24 +00:00
|
|
|
Executer protocols.Executer `yaml:"-" json:"-"`
|
2021-06-05 17:30:59 +00:00
|
|
|
|
|
|
|
Path string `yaml:"-" json:"-"`
|
2020-07-31 15:13:51 +00:00
|
|
|
}
|