From c33a431716d0201c8160ee31959c88e8151e49ab Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Sat, 16 Nov 2019 22:22:14 +0200 Subject: [PATCH] Limit the use of -e to a single keyword (#106) * Limit the use of extension to a single wordlist * Update README --- README.md | 1 + main.go | 2 +- pkg/input/wordlist.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ebe5b4d..09aecfa 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ The only dependency of ffuf is Go 1.11. No dependencies outside of Go standard l - master - New - Changed + - Limit the use of `-e` (extensions) to a single keyword: FUZZ - v0.12 - New diff --git a/main.go b/main.go index d7a3fe9..8437545 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,7 @@ func main() { conf := ffuf.NewConfig(ctx) opts := cliOptions{} var ignored bool - flag.StringVar(&opts.extensions, "e", "", "Comma separated list of extensions to apply. Each extension provided will extend the wordlist entry once.") + flag.StringVar(&opts.extensions, "e", "", "Comma separated list of extensions to apply. Each extension provided will extend the wordlist entry once. Only extends a wordlist with (default) FUZZ keyword.") flag.BoolVar(&conf.DirSearchCompat, "D", false, "DirSearch style wordlist compatibility mode. Used in conjunction with -e flag. Replaces %EXT% in wordlist entry with each of the extensions provided by -e.") flag.Var(&opts.headers, "H", "Header `\"Name: Value\"`, separated by colon. Multiple -H flags are accepted.") flag.StringVar(&conf.Url, "u", "", "Target URL") diff --git a/pkg/input/wordlist.go b/pkg/input/wordlist.go index 4240652..73ccd28 100644 --- a/pkg/input/wordlist.go +++ b/pkg/input/wordlist.go @@ -121,7 +121,7 @@ func (w *WordlistInput) readFile(path string) error { } } else { data = append(data, []byte(reader.Text())) - if len(w.config.Extensions) > 0 { + if w.keyword == "FUZZ" && len(w.config.Extensions) > 0 { for _, ext := range w.config.Extensions { data = append(data, []byte(reader.Text()+ext)) }