diff --git a/CHANGELOG.md b/CHANGELOG.md index a24c222..e5b5907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Fixed the issue where the option -ac was overwriting existing filters. Now auto-calibration will add them where needed. - The `-w` flag now accepts comma delimited values in the form of `file1:W1,file2:W2`. - Links in the HTML report are now clickable + - Fixed panic during wordlist flag parsing in Windows systems. - v1.1.0 - New diff --git a/pkg/ffuf/optionsparser.go b/pkg/ffuf/optionsparser.go index 0e305d9..1a12b80 100644 --- a/pkg/ffuf/optionsparser.go +++ b/pkg/ffuf/optionsparser.go @@ -176,7 +176,11 @@ func ConfigFromOptions(parseOpts *ConfigOptions, ctx context.Context, cancel con // The wordlist was supplied without a keyword parameter wl = []string{v} } else { - filepart := v[:strings.LastIndex(v, ":")] + filepart := v + if strings.Contains(filepart, ":") { + filepart = v[:strings.LastIndex(filepart, ":")] + } + if FileExists(filepart) { wl = []string{filepart, v[strings.LastIndex(v, ":")+1:]} } else { diff --git a/pkg/ffuf/util.go b/pkg/ffuf/util.go index 56c61aa..327fa6a 100644 --- a/pkg/ffuf/util.go +++ b/pkg/ffuf/util.go @@ -31,11 +31,13 @@ func UniqStringSlice(inslice []string) []string { return ret } -//FileExists checks if the filepath exists and is not a directory +//FileExists checks if the filepath exists and is not a directory. +//Returns false in case it's not possible to describe the named file. func FileExists(path string) bool { md, err := os.Stat(path) - if os.IsNotExist(err) { + if err != nil { return false } + return !md.IsDir() }