diff --git a/README.md b/README.md new file mode 100644 index 00000000..4adeb9cd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# nuclei + +Nuceli is a fast tool to scan for things using configurable templates diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go new file mode 100644 index 00000000..2c4e8e69 --- /dev/null +++ b/pkg/requests/requests.go @@ -0,0 +1,20 @@ +package requests + +import ( + "github.com/projectdiscovery/nuclei/pkg/matchers" +) + +// Request contains a request to be made from a template +type Request struct { + // 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"` +} diff --git a/pkg/templates/doc.go b/pkg/templates/doc.go new file mode 100644 index 00000000..6da10a18 --- /dev/null +++ b/pkg/templates/doc.go @@ -0,0 +1,2 @@ +// Package templates contains the parser for a template for the engine. +package templates diff --git a/pkg/templates/templates.go b/pkg/templates/templates.go new file mode 100644 index 00000000..1e73a5ee --- /dev/null +++ b/pkg/templates/templates.go @@ -0,0 +1,32 @@ +package templates + +import ( + "github.com/projectdiscovery/nuclei/pkg/requests" +) + +// 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 + Info Info `yaml:"info"` + // Request contains the request to make in the template + Requests []*requests.Request `yaml:"requests"` +} + +// Info contains information about the request template +type Info struct { + // Name is the name of the template + Name string `yaml:"name"` + // Author is the name of the author of the template + Author string `yaml:"author"` + // Severity optionally describes the severity of the template + Severity string `yaml:"severity,omitempty"` +} + +// Levels of severity for a request template +const ( + SeverityHigh = "high" + SeverityMedium = "medium" + SeverityLow = "low" +)