Skip to content

Commit

Permalink
allow unused wordlist in config file (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazegard committed Sep 15, 2023
1 parent 8453335 commit a7dea16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/ffuf/optionsparser.go
Expand Up @@ -571,19 +571,25 @@ func ConfigFromOptions(parseOpts *ConfigOptions, ctx context.Context, cancel con

conf.CommandLine = strings.Join(os.Args, " ")

newInputProviders := []InputProviderConfig{}
for _, provider := range conf.InputProviders {
if provider.Template != "" {
if !templatePresent(provider.Template, &conf) {
errmsg := fmt.Sprintf("Template %s defined, but not found in pairs in headers, method, URL or POST data.", provider.Template)
errs.Add(fmt.Errorf(errmsg))
} else {
newInputProviders = append(newInputProviders, provider)
}
} else {
if !keywordPresent(provider.Keyword, &conf) {
errmsg := fmt.Sprintf("Keyword %s defined, but not found in headers, method, URL or POST data.", provider.Keyword)
errs.Add(fmt.Errorf(errmsg))
_, _ = fmt.Fprintf(os.Stderr, "%s\n", fmt.Errorf(errmsg))
} else {
newInputProviders = append(newInputProviders, provider)
}
}
}
conf.InputProviders = newInputProviders

// If sniper mode, ensure there is no FUZZ keyword
if conf.InputMode == "sniper" {
Expand Down

0 comments on commit a7dea16

Please sign in to comment.