commit to last commit

This commit is contained in:
Doğan Can Bakır 2024-06-12 14:34:30 +03:00
parent d77348b8da
commit dece6fce63
2 changed files with 7 additions and 2 deletions

View File

@ -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) {

View File

@ -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
}