Merge branch 'engine-execution' of https://github.com/projectdiscovery/nuclei into more-protocols

This commit is contained in:
Ice3man543 2021-11-03 02:24:00 +05:30
commit b3162decff
5 changed files with 11 additions and 9 deletions

View File

@ -68,7 +68,7 @@ on extensive configurability, massive extensibility and ease of use.`)
flagSet.StringSliceVarP(&options.ExcludedTemplates, "exclude-templates", "et", []string{}, "template or template directory paths to exclude"), flagSet.StringSliceVarP(&options.ExcludedTemplates, "exclude-templates", "et", []string{}, "template or template directory paths to exclude"),
flagSet.VarP(&options.Severities, "severity", "s", fmt.Sprintf("Templates to run based on severity. Possible values: %s", severity.GetSupportedSeverities().String())), flagSet.VarP(&options.Severities, "severity", "s", fmt.Sprintf("Templates to run based on severity. Possible values: %s", severity.GetSupportedSeverities().String())),
flagSet.VarP(&options.ExcludeSeverities, "exclude-severity", "es", fmt.Sprintf("Templates to exclude based on severity. Possible values: %s", severity.GetSupportedSeverities().String())), flagSet.VarP(&options.ExcludeSeverities, "exclude-severity", "es", fmt.Sprintf("Templates to exclude based on severity. Possible values: %s", severity.GetSupportedSeverities().String())),
flagSet.NormalizedStringSliceVarP(&options.Author, "author", "a", []string{}, "execute templates that are (co-)created by the specified authors"), flagSet.NormalizedStringSliceVarP(&options.Authors, "author", "a", []string{}, "execute templates that are (co-)created by the specified authors"),
) )
createGroup(flagSet, "output", "Output", createGroup(flagSet, "output", "Output",

View File

@ -54,7 +54,7 @@ func NewConfig(options *types.Options, catalog *catalog.Catalog, executerOpts pr
Tags: options.Tags, Tags: options.Tags,
ExcludeTags: options.ExcludeTags, ExcludeTags: options.ExcludeTags,
IncludeTemplates: options.IncludeTemplates, IncludeTemplates: options.IncludeTemplates,
Authors: options.Author, Authors: options.Authors,
Severities: options.Severities, Severities: options.Severities,
ExcludeSeverities: options.ExcludeSeverities, ExcludeSeverities: options.ExcludeSeverities,
IncludeTags: options.IncludeTags, IncludeTags: options.IncludeTags,

View File

@ -5,7 +5,7 @@ import (
"github.com/projectdiscovery/nuclei/v2/pkg/types" "github.com/projectdiscovery/nuclei/v2/pkg/types"
) )
// Engine is an engine for running Nuclei Templates/Workflows. // Engine is an executer for running Nuclei Templates/Workflows.
// //
// The engine contains multiple thread pools which allow using different // The engine contains multiple thread pools which allow using different
// concurrency values per protocol executed. // concurrency values per protocol executed.
@ -19,14 +19,16 @@ type Engine struct {
executerOpts protocols.ExecuterOptions executerOpts protocols.ExecuterOptions
} }
// InputProvider is an input provider interface for the nuclei execution // InputProvider is an input providing interface for the nuclei execution
// engine. // engine.
// //
// An example InputProvider is provided in form of hmap input provider. // An example InputProvider implementation is provided in form of hybrid
// input provider in pkg/core/inputs/hybrid/hmap.go
type InputProvider interface { type InputProvider interface {
// Count returns the number of items for input provider // Count returns the number of items for input provider
Count() int64 Count() int64
// Scan calls a callback function till the input provider is exhausted // Scan iterates the input and for each found item calls the callback
// until the input provider has been exhausted.
Scan(callback func(value string)) Scan(callback func(value string))
} }

View File

@ -18,7 +18,7 @@ func NewLoader(options *protocols.ExecuterOptions) (model.WorkflowLoader, error)
tagFilter := filter.New(&filter.Config{ tagFilter := filter.New(&filter.Config{
Tags: options.Options.Tags, Tags: options.Options.Tags,
ExcludeTags: options.Options.ExcludeTags, ExcludeTags: options.Options.ExcludeTags,
Authors: options.Options.Author, Authors: options.Options.Authors,
Severities: options.Options.Severities, Severities: options.Options.Severities,
IncludeTags: options.Options.IncludeTags, IncludeTags: options.Options.IncludeTags,
}) })

View File

@ -29,8 +29,8 @@ type Options struct {
Severities severity.Severities Severities severity.Severities
// ExcludeSeverities specifies severities to exclude // ExcludeSeverities specifies severities to exclude
ExcludeSeverities severity.Severities ExcludeSeverities severity.Severities
// Author filters templates based on their author and only run the matching ones. // Authors filters templates based on their author and only run the matching ones.
Author goflags.NormalizedStringSlice Authors goflags.NormalizedStringSlice
// IncludeTags includes specified tags to be run even while being in denylist // IncludeTags includes specified tags to be run even while being in denylist
IncludeTags goflags.NormalizedStringSlice IncludeTags goflags.NormalizedStringSlice
// IncludeTemplates includes specified templates to be run even while being in denylist // IncludeTemplates includes specified templates to be run even while being in denylist