mirror of
https://github.com/ffuf/ffuf
synced 2024-11-12 23:17:12 +00:00
allow unused wordlist in config file (#652)
This commit is contained in:
parent
8453335088
commit
a7dea16d62
1 changed files with 7 additions and 1 deletions
|
@ -571,19 +571,25 @@ func ConfigFromOptions(parseOpts *ConfigOptions, ctx context.Context, cancel con
|
||||||
|
|
||||||
conf.CommandLine = strings.Join(os.Args, " ")
|
conf.CommandLine = strings.Join(os.Args, " ")
|
||||||
|
|
||||||
|
newInputProviders := []InputProviderConfig{}
|
||||||
for _, provider := range conf.InputProviders {
|
for _, provider := range conf.InputProviders {
|
||||||
if provider.Template != "" {
|
if provider.Template != "" {
|
||||||
if !templatePresent(provider.Template, &conf) {
|
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)
|
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))
|
errs.Add(fmt.Errorf(errmsg))
|
||||||
|
} else {
|
||||||
|
newInputProviders = append(newInputProviders, provider)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !keywordPresent(provider.Keyword, &conf) {
|
if !keywordPresent(provider.Keyword, &conf) {
|
||||||
errmsg := fmt.Sprintf("Keyword %s defined, but not found in headers, method, URL or POST data.", provider.Keyword)
|
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 sniper mode, ensure there is no FUZZ keyword
|
||||||
if conf.InputMode == "sniper" {
|
if conf.InputMode == "sniper" {
|
||||||
|
|
Loading…
Reference in a new issue