diff --git a/pkg/input/wordlist.go b/pkg/input/wordlist.go index be487d6..135c7f5 100644 --- a/pkg/input/wordlist.go +++ b/pkg/input/wordlist.go @@ -3,7 +3,7 @@ package input import ( "bufio" "os" - "strings" + "regexp" "github.com/ffuf/ffuf/pkg/ffuf" ) @@ -91,11 +91,13 @@ func (w *WordlistInput) readFile(path string) error { var data [][]byte reader := bufio.NewScanner(file) + re := regexp.MustCompile(`(?i)%ext%`) for reader.Scan() { if w.config.DirSearchCompat && len(w.config.Extensions) > 0 { - if strings.Index(reader.Text(), "%EXT%") != -1 { + text := []byte(reader.Text()) + if re.Match(text) { for _, ext := range w.config.Extensions { - contnt := strings.Replace(reader.Text(), "%EXT%", ext, -1) + contnt := re.ReplaceAll(text, []byte(ext)) data = append(data, []byte(contnt)) } } else {