From 5fb1e4a0ec0a867da183cbd353c6ceeb31fe0066 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 15 Sep 2023 18:53:29 +0300 Subject: [PATCH 1/4] Report if request times out while time matcher / filter is active --- pkg/ffuf/job.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkg/ffuf/job.go b/pkg/ffuf/job.go index e80bddf8..c130f95e 100644 --- a/pkg/ffuf/job.go +++ b/pkg/ffuf/job.go @@ -411,6 +411,28 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) { } else { j.runTask(input, position, true) } + if os.IsTimeout(err) { + for name, _ := range j.Config.MatcherManager.GetMatchers() { + if name == "time" { + inputmsg := "" + for k, v := range input { + inputmsg = inputmsg + fmt.Sprintf("{} : {} // ", k, v) + } + j.Output.Info("Timeout while 'time' matcher is active: " + inputmsg) + return + } + } + for name, _ := range j.Config.MatcherManager.GetFilters() { + if name == "time" { + inputmsg := "" + for k, v := range input { + inputmsg = inputmsg + fmt.Sprintf("{} : {} // ", k, v) + } + j.Output.Info("Timeout while 'time' filter is active: " + inputmsg) + return + } + } + } return } if j.SpuriousErrorCounter > 0 { From 7103663cf7ec5146314822cf5ee8d8abd60c9133 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 15 Sep 2023 18:54:52 +0300 Subject: [PATCH 2/4] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e31498..6789103d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fix csv output file format - Fixed divide by 0 error when setting rate limit to 0 manually. - Automatic brotli and deflate decompression + - Report if request times out when a time based matcher or filter is active - v2.0.0 - New From 425f060f6feffb348115bcf951c3e0dbb41352df Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 15 Sep 2023 18:59:34 +0300 Subject: [PATCH 3/4] Fix sprintf statement --- pkg/ffuf/job.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ffuf/job.go b/pkg/ffuf/job.go index c130f95e..d8ed5425 100644 --- a/pkg/ffuf/job.go +++ b/pkg/ffuf/job.go @@ -416,7 +416,7 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) { if name == "time" { inputmsg := "" for k, v := range input { - inputmsg = inputmsg + fmt.Sprintf("{} : {} // ", k, v) + inputmsg = inputmsg + fmt.Sprintf("%s : %s // ", k, v) } j.Output.Info("Timeout while 'time' matcher is active: " + inputmsg) return @@ -426,7 +426,7 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) { if name == "time" { inputmsg := "" for k, v := range input { - inputmsg = inputmsg + fmt.Sprintf("{} : {} // ", k, v) + inputmsg = inputmsg + fmt.Sprintf("%s : %s // ", k, v) } j.Output.Info("Timeout while 'time' filter is active: " + inputmsg) return From ffd982ecd53113338a0bc47c70622a5023040e1f Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 15 Sep 2023 19:01:07 +0300 Subject: [PATCH 4/4] Make linter happy --- pkg/ffuf/job.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ffuf/job.go b/pkg/ffuf/job.go index d8ed5425..fdc84175 100644 --- a/pkg/ffuf/job.go +++ b/pkg/ffuf/job.go @@ -412,7 +412,7 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) { j.runTask(input, position, true) } if os.IsTimeout(err) { - for name, _ := range j.Config.MatcherManager.GetMatchers() { + for name := range j.Config.MatcherManager.GetMatchers() { if name == "time" { inputmsg := "" for k, v := range input { @@ -422,7 +422,7 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) { return } } - for name, _ := range j.Config.MatcherManager.GetFilters() { + for name := range j.Config.MatcherManager.GetFilters() { if name == "time" { inputmsg := "" for k, v := range input {