diff --git a/examples/example.go b/examples/example.go index ff3fe5f..ae2bb4e 100644 --- a/examples/example.go +++ b/examples/example.go @@ -15,7 +15,6 @@ func main() { options := runner.Options{ Methods: "GET", - Threads: 2, InputTargetHost: goflags.StringSlice{"scanme.sh", "projectdiscovery.io", "localhost"}, //InputFile: "./targetDomains.txt", // path to file containing the target domains list OnResult: func(r runner.Result) { diff --git a/runner/options.go b/runner/options.go index c7b8dcf..fb5550c 100644 --- a/runner/options.go +++ b/runner/options.go @@ -34,6 +34,7 @@ import ( const ( two = 2 + defaultThreads = 50 DefaultResumeFile = "resume.cfg" DefaultOutputDirectory = "output" ) @@ -386,7 +387,7 @@ func ParseOptions() *Options { ) flagSet.CreateGroup("rate-limit", "Rate-Limit", - flagSet.IntVarP(&options.Threads, "threads", "t", 50, "number of threads to use"), + flagSet.IntVarP(&options.Threads, "threads", "t", defaultThreads, "number of threads to use"), flagSet.IntVarP(&options.RateLimit, "rate-limit", "rl", 150, "maximum requests to send per second"), flagSet.IntVarP(&options.RateLimitMinute, "rate-limit-minute", "rlm", 0, "maximum number of requests to send per minute"), ) @@ -680,6 +681,11 @@ func (options *Options) ValidateOptions() error { return fmt.Errorf("invalid protocol: %s", options.Protocol) } + if options.Threads == 0 { + gologger.Info().Msgf("Threads automatically set to %d", defaultThreads) + options.Threads = defaultThreads + } + return nil }