Ensure input URLs and requests are present before tracking any progress
@@ -293,7 +293,7 @@ func (r *Runner) RunEnumeration() {
switch t.(type) {
case *templates.Template:
template := t.(*templates.Template)
- totalRequests += template.GetHTTPRequestCount() + template.GetDNSRequestCount()
+ totalRequests += (template.GetHTTPRequestCount() + template.GetDNSRequestCount()) * r.inputCount
parsedTemplates = append(parsedTemplates, match)
case *workflows.Workflow:
// workflows will dynamically adjust the totals while running, as
@@ -304,17 +304,20 @@ func (r *Runner) RunEnumeration() {
}
}
- // ensure only successfully parsed templates are processed
- allTemplates = parsedTemplates
-
- // track global progress
- p.InitProgressbar(r.inputCount, templateCount, r.inputCount*totalRequests)
-
var (
wgtemplates sync.WaitGroup
results atomicboolean.AtomBool
)
+ if r.inputCount == 0 {
+ gologger.Errorf("Could not find any valid input URLs.")
+ } else if totalRequests > 0 {
+ // ensure only successfully parsed templates are processed
+ allTemplates = parsedTemplates
+
+ // track global progress
+ p.InitProgressbar(r.inputCount, templateCount, totalRequests)
+
for _, match := range allTemplates {
wgtemplates.Add(1)
go func(match string) {
@@ -344,6 +347,7 @@ func (r *Runner) RunEnumeration() {
p.Wait()
p.ShowStdErr()
p.ShowStdOut()
+ }
if !results.Get() {
if r.output != nil {
