Include full line colors (#446)

* Include full line colors

* Update CHANGELOG and CONTRIBUTORS
This commit is contained in:
Gustavo Costa 2021-05-16 19:35:55 -03:00 committed by GitHub
parent 965f282c0b
commit 3c78f89c83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -34,3 +34,4 @@
* [Shaked](https://github.com/Shaked)
* [SolomonSklash](https://github.com/SolomonSklash)
* [l4yton](https://github.com/l4yton)
* [xfgusta](https://github.com/xfgusta)

View file

@ -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) {