From 79fe3c0c91211c28059db0badce29472ce734c8a Mon Sep 17 00:00:00 2001 From: Kiblyn11 <4669951+Kiblyn11@users.noreply.github.com> Date: Thu, 24 Sep 2020 11:09:03 +0200 Subject: [PATCH] Change banner logging to stderr (#282) * Change banner logging to stderr * Edit CHANGELOG and CONTRIBUTORS * fix: add to contributors according to sort order --- CHANGELOG.md | 1 + CONTRIBUTORS.md | 1 + pkg/output/stdout.go | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 761d23f..2dbc5b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - master - New - New CLI flag `-rate` to set maximum rate of requests per second. The adjustment is dynamic. + - Change banner logging to stderr instead of stdout. - Changed - Pre-flight errors are now displayed also after the usage text to prevent the need to scroll through backlog. diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ac9805a..2d34667 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,6 +16,7 @@ * [jimen0](https://github.com/jimen0) * [joohoi](https://github.com/joohoi) * [jvesiluoma](https://github.com/jvesiluoma) +* [Kiblyn11](https://github.com/Kiblyn11) * [lc](https://github.com/lc) * [nnwakelam](https://twitter.com/nnwakelam) * [oh6hay](https://github.com/oh6hay) diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index d3cd3be..19ac8a9 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -51,7 +51,7 @@ func NewStdoutput(conf *ffuf.Config) *Stdoutput { } func (s *Stdoutput) Banner() error { - fmt.Printf("%s\n v%s\n%s\n\n", BANNER_HEADER, ffuf.VERSION, BANNER_SEP) + fmt.Fprintf(os.Stderr ,"%s\n v%s\n%s\n\n", BANNER_HEADER, ffuf.VERSION, BANNER_SEP) printOption([]byte("Method"), []byte(s.config.Method)) printOption([]byte("URL"), []byte(s.config.Url)) @@ -142,7 +142,7 @@ func (s *Stdoutput) Banner() error { for _, f := range s.config.Filters { printOption([]byte("Filter"), []byte(f.Repr())) } - fmt.Printf("%s\n\n", BANNER_SEP) + fmt.Fprintf(os.Stderr, "%s\n\n", BANNER_SEP) return nil } @@ -430,7 +430,7 @@ func (s *Stdoutput) colorize(input string, status int64) string { } func printOption(name []byte, value []byte) { - fmt.Printf(" :: %-16s : %s\n", name, value) + fmt.Fprintf(os.Stderr, " :: %-16s : %s\n", name, value) } func inSlice(key string, slice []string) bool {