mirror of https://github.com/daffainfo/nuclei.git
Precompute total number of HTTP requests when using multiple templates
parent
81eed093d2
commit
e5949c8eba
|
@ -200,6 +200,23 @@ func (r *Runner) RunEnumeration() {
|
|||
// track progress
|
||||
p := progress.NewProgress(nil)
|
||||
|
||||
// precompute request count
|
||||
var totalRequests int64 = 0
|
||||
for _, match := range matches {
|
||||
t, err := r.parse(match)
|
||||
switch t.(type) {
|
||||
case *templates.Template:
|
||||
template := t.(*templates.Template)
|
||||
totalRequests += template.GetHTTPRequestsCount()
|
||||
default:
|
||||
p.StartStdCapture()
|
||||
gologger.Errorf("Could not parse file '%s': %s\n", r.options.Templates, err)
|
||||
p.StopStdCapture()
|
||||
}
|
||||
}
|
||||
|
||||
p.SetupProgressBar("Multiple templates", r.inputCount * totalRequests)
|
||||
|
||||
var results bool
|
||||
for _, match := range matches {
|
||||
t, err := r.parse(match)
|
||||
|
@ -213,8 +230,6 @@ func (r *Runner) RunEnumeration() {
|
|||
}
|
||||
}
|
||||
|
||||
p.SetupProgressBar(template.ID, r.inputCount * template.GetHTTPRequestsCount())
|
||||
|
||||
for _, request := range template.RequestsHTTP {
|
||||
httpResults := r.processTemplateWithList(p, template, request)
|
||||
if httpResults {
|
||||
|
|
Loading…
Reference in New Issue