From b2c1f9471f5bc275912c9c8194e88593d2636597 Mon Sep 17 00:00:00 2001 From: Maxime Catrice Date: Sun, 19 Feb 2023 13:41:37 +0100 Subject: [PATCH] Fix HTML output (#640) --- pkg/output/file_html.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/output/file_html.go b/pkg/output/file_html.go index 5a130d9..697e6ae 100644 --- a/pkg/output/file_html.go +++ b/pkg/output/file_html.go @@ -23,6 +23,8 @@ type htmlResult struct { ResultFile string Url string Host string + HTMLColor string + FfufHash string } type htmlFileOutput struct { @@ -82,12 +84,11 @@ const (
-|result_raw|StatusCode|Input|Position|ContentLength|ContentWords|ContentLines|ContentType|Duration|Resultfile|ScraperData| +|result_raw|StatusCode{{ range $keyword := .Keys }}|{{ $keyword | printf "%s" }}{{ end }}|Url|RedirectLocation|Position|ContentLength|ContentWords|ContentLines|ContentType|Duration|Resultfile|ScraperData|FfufHash|
-{{ range .Keys }} -{{ end }} +{{ range .Keys }} {{ end }} @@ -98,13 +99,14 @@ const ( + {{range $result := .Results}}
-|result_raw|{{ $result.StatusCode }}{{ range $keyword, $value := $result.Input }}|{{ $value | printf "%s" }}{{ end }}|{{ $result.Url }}|{{ $result.RedirectLocation }}|{{ $result.Position }}|{{ $result.ContentLength }}|{{ $result.ContentWords }}|{{ $result.ContentLines }}|{{ $result.ContentType }}| +|result_raw|{{ $result.StatusCode }}{{ range $keyword, $value := $result.Input }}|{{ $value | printf "%s" }}{{ end }}|{{ $result.Url }}|{{ $result.RedirectLocation }}|{{ $result.Position }}|{{ $result.ContentLength }}|{{ $result.ContentWords }}|{{ $result.ContentLines }}|{{ $result.ContentType }}|{{ $result.Duration }}|{{ $result.ResultFile }}|{{ $result.ScraperData }}|{{ $result.FfufHash }}|
@@ -120,7 +122,8 @@ const ( - + {{ end }} @@ -209,9 +212,14 @@ func writeHTML(filename string, config *ffuf.Config, results []ffuf.Result) erro htmlResults := make([]htmlResult, 0) for _, r := range results { + ffufhash := "" strinput := make(map[string]string) for k, v := range r.Input { - strinput[k] = string(v) + if k == "FFUFHASH" { + ffufhash = string(v) + } else { + strinput[k] = string(v) + } } strscraper := "" for k, v := range r.ScraperData { @@ -242,6 +250,8 @@ func writeHTML(filename string, config *ffuf.Config, results []ffuf.Result) erro ResultFile: r.ResultFile, Url: r.Url, Host: r.Host, + HTMLColor: r.HTMLColor, + FfufHash: ffufhash, } htmlResults = append(htmlResults, hres) }
Status{{ . }}{{ . }}URL Redirect location PositionDuration Resultfile Scraper dataFfuf Hash
{{ $result.StatusCode }}{{ $result.ContentType }} {{ $result.Duration }} {{ $result.ResultFile }}{{ $result.ScraperData }} + {{ $result.ScraperData }}{{ $result.FfufHash }}