diff --git a/.gitignore b/.gitignore index da585383..3a7b66e2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,5 @@ cmd/functional-test/*.cfg .devcontainer /httpx /dist -/resume.cfg +resume.cfg vendor/ \ No newline at end of file diff --git a/runner/resume.go b/runner/resume.go index ce2d3752..e489dd07 100644 --- a/runner/resume.go +++ b/runner/resume.go @@ -5,4 +5,5 @@ type ResumeCfg struct { Index int current string currentIndex int + lastPrinted string } diff --git a/runner/runner.go b/runner/runner.go index b708f6a4..f64aef91 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -1096,6 +1096,12 @@ func (r *Runner) RunEnumeration() { gologger.Silent().Msgf("%s\n", resp.str) } + // Update resume state after output to avoid skipping unprocessed targets on interrupt + if r.options.resumeCfg != nil { + r.options.resumeCfg.lastPrinted = resp.Input + + } + // store responses or chain in directory if resp.Err == nil { URL, _ := urlutil.Parse(resp.URL) @@ -2582,7 +2588,7 @@ func extractPotentialFavIconsURLs(resp []byte) (candidates []string, baseHref st func (r *Runner) SaveResumeConfig() error { var resumeCfg ResumeCfg resumeCfg.Index = r.options.resumeCfg.currentIndex - resumeCfg.ResumeFrom = r.options.resumeCfg.current + resumeCfg.ResumeFrom = r.options.resumeCfg.lastPrinted return goconfig.Save(resumeCfg, DefaultResumeFile) }