Limit the use of -e to a single keyword (#106)

* Limit the use of extension to a single wordlist

* Update README
This commit is contained in:
Joona Hoikkala 2019-11-16 22:22:14 +02:00 committed by GitHub
parent d04a2d80ae
commit c33a431716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

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

View file

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

View file

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