diff --git a/main.go b/main.go index a271cec9..b5644bf1 100644 --- a/main.go +++ b/main.go @@ -170,7 +170,13 @@ func main() { if err != nil { continue } - printSearchResults(conf, pos, copt.Time, opts.General.Searchhash) + ok, reason := ffuf.HistoryReplayable(conf) + if ok { + printSearchResults(conf, pos, copt.Time, opts.General.Searchhash) + } else { + fmt.Printf("[ERR] Hash cannot be mapped back because %s\n", reason) + } + } if err != nil { fmt.Printf("[ERR] %s\n", err) diff --git a/pkg/ffuf/history.go b/pkg/ffuf/history.go index 072b3dcd..b3302adc 100644 --- a/pkg/ffuf/history.go +++ b/pkg/ffuf/history.go @@ -72,6 +72,15 @@ func SearchHash(hash string) ([]ConfigOptionsHistory, int, error) { return coptions, int(position), err } +func HistoryReplayable(conf *Config) (bool, string) { + for _, w := range conf.Wordlists { + if w == "-" || strings.HasPrefix(w, "-:") { + return false, "stdin input was used for one of the wordlists" + } + } + return true, "" +} + func configFromHistory(dirname string) (ConfigOptionsHistory, error) { jsonOptions, err := os.ReadFile(filepath.Join(dirname, "options")) if err != nil {