mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 14:05:28 +00:00
Added stats-interval flag
This commit is contained in:
parent
ec3f85e032
commit
9b79f9b13c
@ -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.Headless, "headless", false, "Enable headless browser based templates support")
|
||||||
set.BoolVar(&options.ShowBrowser, "show-browser", false, "Show the browser on the screen")
|
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.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()
|
_ = set.Parse()
|
||||||
|
|
||||||
if cfgFile != "" {
|
if cfgFile != "" {
|
||||||
|
|||||||
@ -23,10 +23,10 @@ type Progress struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewProgress creates and returns a new progress tracking object.
|
// 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
|
var tickDuration time.Duration
|
||||||
if active {
|
if active {
|
||||||
tickDuration = 5 * time.Second
|
tickDuration = time.Duration(duration) * time.Second
|
||||||
} else {
|
} else {
|
||||||
tickDuration = -1
|
tickDuration = -1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,7 +155,7 @@ func New(options *types.Options) (*Runner, error) {
|
|||||||
|
|
||||||
// Creates the progress tracking object
|
// Creates the progress tracking object
|
||||||
var progressErr error
|
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 {
|
if progressErr != nil {
|
||||||
return nil, progressErr
|
return nil, progressErr
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,9 @@ type Options struct {
|
|||||||
// ShowBrowser specifies whether the show the browser in headless mode
|
// ShowBrowser specifies whether the show the browser in headless mode
|
||||||
ShowBrowser bool
|
ShowBrowser bool
|
||||||
// Workflows specifies if only to execute workflows (no normal templates will be run)
|
// 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.
|
InternalResolversList []string // normalized from resolvers flag as well as file provided.
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user