2020-04-04 00:17:57 +05:30
|
|
|
package templates
|
|
|
|
|
|
|
|
|
|
import (
|
2020-12-29 16:33:25 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols"
|
2020-12-29 15:38:14 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/dns"
|
2021-01-01 15:28:28 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/file"
|
2021-02-21 16:31:34 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/headless"
|
2020-12-29 15:38:14 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/http"
|
2020-12-30 14:54:20 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/network"
|
2020-12-29 15:38:14 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/workflows"
|
2020-04-04 00:17:57 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 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-04 01:09:29 +05:30
|
|
|
Info map[string]interface{} `yaml:"info"`
|
2020-12-29 15:38:14 +05:30
|
|
|
// RequestsHTTP contains the http request to make in the template
|
|
|
|
|
RequestsHTTP []*http.Request `yaml:"requests,omitempty"`
|
2020-07-18 21:42:23 +02:00
|
|
|
// RequestsDNS contains the dns request to make in the template
|
2020-12-29 15:38:14 +05:30
|
|
|
RequestsDNS []*dns.Request `yaml:"dns,omitempty"`
|
2021-01-01 15:28:28 +05:30
|
|
|
// RequestsFile contains the file request to make in the template
|
|
|
|
|
RequestsFile []*file.Request `yaml:"file,omitempty"`
|
2020-12-30 14:54:20 +05:30
|
|
|
// RequestsNetwork contains the network request to make in the template
|
|
|
|
|
RequestsNetwork []*network.Request `yaml:"network,omitempty"`
|
2021-02-21 16:31:34 +05:30
|
|
|
// RequestsHeadless contains the headless request to make in the template.
|
|
|
|
|
RequestsHeadless []*headless.Request `yaml:"headless,omitempty"`
|
2021-02-04 01:09:29 +05:30
|
|
|
|
2020-12-29 15:38:14 +05:30
|
|
|
// Workflows is a yaml based workflow declaration code.
|
2021-02-21 16:31:34 +05:30
|
|
|
workflows.Workflow `yaml:",inline,omitempty"`
|
|
|
|
|
CompiledWorkflow *workflows.Workflow `yaml:"-"`
|
2020-12-30 13:26:55 +05:30
|
|
|
|
2020-12-29 18:02:45 +05:30
|
|
|
// TotalRequests is the total number of requests for the template.
|
2021-02-21 16:31:34 +05:30
|
|
|
TotalRequests int `yaml:"-"`
|
2020-12-29 18:02:45 +05:30
|
|
|
// Executer is the actual template executor for running template requests
|
2021-02-21 16:31:34 +05:30
|
|
|
Executer protocols.Executer `yaml:"-"`
|
2020-07-31 17:13:51 +02:00
|
|
|
}
|