diff --git a/v2/cmd/nuclei/main.go b/v2/cmd/nuclei/main.go index 634afce0f..b51e9c21b 100644 --- a/v2/cmd/nuclei/main.go +++ b/v2/cmd/nuclei/main.go @@ -85,6 +85,7 @@ based on templates offering massive extensibility and ease of use.`) set.StringVarP(&options.ResolversFile, "resolvers", "r", "", "File containing resolver list for nuclei") set.BoolVar(&options.Headless, "headless", false, "Enable headless browser based templates support") set.BoolVar(&options.ShowBrowser, "show-browser", false, "Show the browser on the screen") + set.BoolVarP(&options.Workflows, "w", "workflows", false, "Only run workflow templates with nuclei") _ = set.Parse() if cfgFile != "" { diff --git a/v2/internal/runner/runner.go b/v2/internal/runner/runner.go index 1993d81b3..957cfb227 100644 --- a/v2/internal/runner/runner.go +++ b/v2/internal/runner/runner.go @@ -304,7 +304,7 @@ func (r *Runner) RunEnumeration() { if len(template.Workflows) > 0 { results.CAS(false, r.processWorkflowWithList(template)) - } else { + } else if !r.options.Workflows { results.CAS(false, r.processTemplateWithList(template)) } }(t) @@ -325,6 +325,5 @@ func (r *Runner) RunEnumeration() { if r.browser != nil { r.browser.Close() - // kill chrome process here } } diff --git a/v2/pkg/types/types.go b/v2/pkg/types/types.go index 3aa7d6277..9bdeac076 100644 --- a/v2/pkg/types/types.go +++ b/v2/pkg/types/types.go @@ -95,7 +95,10 @@ type Options struct { // ResolversFile is a file containing resolvers for nuclei. ResolversFile string // Headless specifies whether to allow headless mode templates - Headless bool - ShowBrowser bool // show the browser too + Headless bool + // ShowBrowser specifies whether the show the browser in headless mode + ShowBrowser bool + // Workflows specifies if only to execute workflows (no normal templates will be run) + Workflows bool InternalResolversList []string // normalized from resolvers flag as well as file provided. }