diff --git a/v2/cmd/nuclei/main.go b/v2/cmd/nuclei/main.go index b51e9c21b..3db0edda5 100644 --- a/v2/cmd/nuclei/main.go +++ b/v2/cmd/nuclei/main.go @@ -86,6 +86,7 @@ based on templates offering massive extensibility and ease of use.`) 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.IntVar(&options.StatsInterval, "stats-interval", 5, "Number of seconds between each stats line") _ = set.Parse() if cfgFile != "" { diff --git a/v2/internal/progress/progress.go b/v2/internal/progress/progress.go index 321d9dfe7..26b72729a 100644 --- a/v2/internal/progress/progress.go +++ b/v2/internal/progress/progress.go @@ -23,10 +23,10 @@ type Progress struct { } // NewProgress creates and returns a new progress tracking object. -func NewProgress(active, metrics bool, port int) (*Progress, error) { +func NewProgress(duration int, active, metrics bool, port int) (*Progress, error) { var tickDuration time.Duration if active { - tickDuration = 5 * time.Second + tickDuration = time.Duration(duration) * time.Second } else { tickDuration = -1 } diff --git a/v2/internal/runner/runner.go b/v2/internal/runner/runner.go index 957cfb227..519f64d64 100644 --- a/v2/internal/runner/runner.go +++ b/v2/internal/runner/runner.go @@ -155,7 +155,7 @@ func New(options *types.Options) (*Runner, error) { // Creates the progress tracking object var progressErr error - runner.progress, progressErr = progress.NewProgress(options.EnableProgressBar, options.Metrics, options.MetricsPort) + runner.progress, progressErr = progress.NewProgress(options.StatsInterval, options.EnableProgressBar, options.Metrics, options.MetricsPort) if progressErr != nil { return nil, progressErr } diff --git a/v2/pkg/types/types.go b/v2/pkg/types/types.go index 9bdeac076..34a47bb3f 100644 --- a/v2/pkg/types/types.go +++ b/v2/pkg/types/types.go @@ -99,6 +99,9 @@ type Options struct { // 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 + Workflows bool + // StatsInterval is the number of seconds to display stats after + StatsInterval int + InternalResolversList []string // normalized from resolvers flag as well as file provided. }