diff --git a/main.go b/main.go index ffdeef5..2e6ba3b 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,7 @@ func main() { flag.StringVar(&opts.matcherWords, "mw", "", "Match amount of words in response") flag.StringVar(&conf.Method, "X", "GET", "HTTP method to use.") flag.BoolVar(&conf.Quiet, "s", false, "Do not print additional information (silent mode)") - flag.IntVar(&conf.Threads, "t", 20, "Number of concurrent threads.") + flag.IntVar(&conf.Threads, "t", 40, "Number of concurrent threads.") flag.Parse() if err := prepareConfig(&opts, &conf); err != nil { fmt.Fprintf(os.Stderr, "Encountered error(s): %s\n", err) diff --git a/pkg/ffuf/job.go b/pkg/ffuf/job.go index ffc4989..767b57b 100644 --- a/pkg/ffuf/job.go +++ b/pkg/ffuf/job.go @@ -75,13 +75,20 @@ func (j *Job) updateProgress() { // Do not print progress status in silent mode return } + runningSecs := int((time.Now().Sub(j.startTime)) / time.Second) + var reqRate int + if runningSecs > 0 { + reqRate = int(j.Counter / runningSecs) + } else { + reqRate = 0 + } dur := time.Now().Sub(j.startTime) hours := dur / time.Hour dur -= hours * time.Hour mins := dur / time.Minute dur -= mins * time.Minute secs := dur / time.Second - progString := fmt.Sprintf(":: Progress: [%d/%d] :: Duration: [%d:%02d:%02d] ::", j.Counter, j.Total, hours, mins, secs) + progString := fmt.Sprintf(":: Progress: [%d/%d] :: %d req/sec :: Duration: [%d:%02d:%02d] ::", j.Counter, j.Total, int(reqRate), hours, mins, secs) j.Output.Error(progString) } diff --git a/pkg/runner/simple.go b/pkg/runner/simple.go index 8ca8e8d..5608532 100644 --- a/pkg/runner/simple.go +++ b/pkg/runner/simple.go @@ -27,10 +27,11 @@ func NewSimpleRunner(conf *ffuf.Config) ffuf.RunnerProvider { simplerunner.config = conf simplerunner.client = &http.Client{ - CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, Timeout: time.Duration(10 * time.Second), Transport: &http.Transport{ + MaxIdleConns: 100, + MaxIdleConnsPerHost: 100, TLSClientConfig: &tls.Config{ InsecureSkipVerify: conf.TLSSkipVerify, },