From 5462b861b4b4f9c885cc9170bd86a3823fc11799 Mon Sep 17 00:00:00 2001 From: Giardi Date: Thu, 8 Jan 2026 11:47:13 +0100 Subject: [PATCH] Accept files from any placeholder key --- config.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/config.go b/config.go index 20c8ab46..1b9d1870 100644 --- a/config.go +++ b/config.go @@ -33,20 +33,24 @@ func NewConfig(filePath string) (*Config, error) { return nil, err } - var words []string - for _, p := range cfg.Payloads["word"] { - if !fileutil.FileExists(p) { - words = append(words, p) - } else { - wordBytes, err := os.ReadFile(p) - if err != nil { - gologger.Error().Msgf("failed to read wordlist from %v got %v", p, err) - continue + // Process file paths for all payload keys + for payloadKey, payloadValues := range cfg.Payloads { + var processedValues []string + for _, p := range payloadValues { + if !fileutil.FileExists(p) { + processedValues = append(processedValues, p) + } else { + wordBytes, err := os.ReadFile(p) + if err != nil { + gologger.Error().Msgf("failed to read wordlist from %v got %v", p, err) + continue + } + processedValues = append(processedValues, strings.Fields(string(wordBytes))...) } - words = append(words, strings.Fields(string(wordBytes))...) } + cfg.Payloads[payloadKey] = processedValues } - cfg.Payloads["word"] = words + return &cfg, nil }