diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index f00ce6418..7c4a55778 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -10,6 +10,7 @@ import ( "regexp" "strconv" "strings" + "time" "github.com/projectdiscovery/gologger" contextutil "github.com/projectdiscovery/utils/context" @@ -80,6 +81,9 @@ func (r *Runner) RunEnumeration() error { // RunEnumerationWithCtx runs the subdomain enumeration flow on the targets specified func (r *Runner) RunEnumerationWithCtx(ctx context.Context) error { + timeout := time.Duration(r.options.Timeout) * time.Second + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() outputs := []io.Writer{r.options.Output} if len(r.options.Domain) > 0 {