diff --git a/CHANGELOG.md b/CHANGELOG.md index 43cf540..8b75034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ - New - Added response time logging and filtering - 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 83e5a2c..4c2f8b0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -34,3 +34,4 @@ * [Shaked](https://github.com/Shaked) * [SolomonSklash](https://github.com/SolomonSklash) * [l4yton](https://github.com/l4yton) +* [xfgusta](https://github.com/xfgusta) diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index cc8bfbd..0c68dcc 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -402,8 +402,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, Duration: %dms]", TERMINAL_CLEAR_LINE, res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines, res.Duration.Milliseconds()) - res_hdr = s.colorize(res_hdr, res.StatusCode) + res_hdr = fmt.Sprintf("%s%s[Status: %d, Size: %d, Words: %d, Lines: %d, Duration: %dms]%s", TERMINAL_CLEAR_LINE, s.colorize(res.StatusCode), res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines, res.Duration.Milliseconds(), ANSI_CLEAR) reslines := "" if s.config.Verbose { reslines = fmt.Sprintf("%s%s| URL | %s\n", reslines, TERMINAL_CLEAR_LINE, res.Url) @@ -428,13 +427,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, Duration: %dms]", TERMINAL_CLEAR_LINE, s.prepareInputsOneLine(res), s.colorize(fmt.Sprintf("%d", res.StatusCode), res.StatusCode), res.ContentLength, res.ContentWords, res.ContentLines, res.Duration.Milliseconds()) + resnormal := fmt.Sprintf("%s%s%-23s [Status: %d, Size: %d, Words: %d, Lines: %d, Duration: %dms]%s", TERMINAL_CLEAR_LINE, s.colorize(res.StatusCode), s.prepareInputsOneLine(res), res.StatusCode, res.ContentLength, res.ContentWords, res.ContentLines, res.Duration.Milliseconds(), 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 { @@ -449,7 +448,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) {