From 7d123089deac8a9445648dcd01ca35c6ee1bd41f Mon Sep 17 00:00:00 2001 From: Gustavo Costa Date: Sun, 16 May 2021 16:01:20 -0300 Subject: [PATCH 1/2] Include full line colors --- pkg/output/stdout.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index 3758f225..429805f7 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -401,8 +401,7 @@ func (s *Stdoutput) resultQuiet(res ffuf.Result) { func (s *Stdoutput) resultMultiline(res ffuf.Result) { var res_hdr, res_str string res_str = "%s%s * %s: %s\n" - res_hdr = fmt.Sprintf("%s[Status: %d, Size: %d, Words: %d, Lines: %d]", TERMINAL_CLEAR_LINE, res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines) - res_hdr = s.colorize(res_hdr, res.StatusCode) + res_hdr = fmt.Sprintf("%s%s[Status: %d, Size: %d, Words: %d, Lines: %d]%s", TERMINAL_CLEAR_LINE, s.colorize(res.StatusCode), res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines, ANSI_CLEAR) reslines := "" if s.config.Verbose { reslines = fmt.Sprintf("%s%s| URL | %s\n", reslines, TERMINAL_CLEAR_LINE, res.Url) @@ -427,13 +426,13 @@ func (s *Stdoutput) resultMultiline(res ffuf.Result) { } func (s *Stdoutput) resultNormal(res ffuf.Result) { - resnormal := fmt.Sprintf("%s%-23s [Status: %s, Size: %d, Words: %d, Lines: %d]", TERMINAL_CLEAR_LINE, s.prepareInputsOneLine(res), s.colorize(fmt.Sprintf("%d", res.StatusCode), res.StatusCode), res.ContentLength, res.ContentWords, res.ContentLines) + resnormal := fmt.Sprintf("%s%s%-23s [Status: %d, Size: %d, Words: %d, Lines: %d]%s", TERMINAL_CLEAR_LINE, s.colorize(res.StatusCode), s.prepareInputsOneLine(res), res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines, ANSI_CLEAR) fmt.Println(resnormal) } -func (s *Stdoutput) colorize(input string, status int64) string { +func (s *Stdoutput) colorize(status int64) string { if !s.config.Colors { - return input + return "" } colorCode := ANSI_CLEAR if status >= 200 && status < 300 { @@ -448,7 +447,7 @@ func (s *Stdoutput) colorize(input string, status int64) string { if status >= 500 && status < 600 { colorCode = ANSI_RED } - return fmt.Sprintf("%s%s%s", colorCode, input, ANSI_CLEAR) + return colorCode } func printOption(name []byte, value []byte) { From 57d103e0110d55943e671387f8b417cb31749305 Mon Sep 17 00:00:00 2001 From: Gustavo Costa Date: Sun, 16 May 2021 16:11:04 -0300 Subject: [PATCH 2/2] Update CHANGELOG and CONTRIBUTORS --- CHANGELOG.md | 1 + CONTRIBUTORS.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4845da5..f1c02802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - master - New - Added a CLI flag to specify TLS SNI value + - Added full line colors - Changed - Fixed an issue where output file was created regardless of `-or` - Fixed an issue where output (often a lot of it) would be printed after entering interactive mode diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4d0fd07c..32fa46d4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -33,3 +33,4 @@ * [Shaked](https://github.com/Shaked) * [SolomonSklash](https://github.com/SolomonSklash) * [l4yton](https://github.com/l4yton) +* [xfgusta](https://github.com/xfgusta)