Resumed -follow-records hits come back with source wordlist

Aberta
#441 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@bfs2021 já está trabalhando nisso.

Desde 21/11/2026.

  • #442 de @bfs2021 — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
go
Domínio
backend, cli

Direção de pesquisa

Read internal/cli/session.go around restoreTarget and emitFrom, then review the resume tests in internal/cli. Add a hermetic resume test for a -follow-records hit and run go test ./internal/cli. Done means resumed results report records and records_found matches an uninterrupted run; pull request #442 is already open against this issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

area: cli bug good first issue severity: low

Summary

When a run with -follow-records is resumed, results that the record-follow step found come back with sources: ["wordlist"] instead of ["records"]. The results file, -stats (records_found), and the source breakdown then disagree with the uninterrupted run.

Where

  • internal/cli/session.go:908 (restoreTarget)
  • internal/cli/session.go:653 (emitFrom)
  • internal/candidates/candidates.go:126 (SourcesOf)

Details

restoreTarget re-emits each saved result as scan.Event{Result: r.Result}. Only -ptr hits get their saved sources back (ptrHit, added in #436). For everything else emitFrom works out the sources again:

case ev.Followed:
	res.Sources = candidates.FromRecords
case !permutation:
	res.Sources = s.cands.SourcesOf(res.Subdomain)

The restored event never has Followed set, and a record-follow target is not in the candidate set, so SourcesOf falls back to FromWordlist. s.foundBy then counts it under wordlist, not records.

Impact

For resumed -follow-records scans, results files and -stats report record-follow hits as wordlist hits. -diff against an uninterrupted run's file can also differ in sources. Low severity: the names themselves are correct.

Steps to reproduce

  1. Run a lab scan with -follow-records and -resume state.json against a zone where a CNAME, MX or NS target is a new in-scope name.
  2. Interrupt it after that name is found, then resume.
  3. In the JSON output, the followed name has "sources": ["wordlist"].

Suggested fix

In restoreTarget, pass the saved r.Sources to emitFrom whenever they are present, as the -ptr branch already does, instead of recomputing them. Add a resume test that covers a -follow-records hit.

Acceptance criteria

  • A resumed run reports record-follow hits with source records, and records_found matches the uninterrupted run
  • A test covers it

Getting started

  • Relevant files: internal/cli/session.go, internal/cli/resume.go, the existing resume tests in internal/cli
  • How to run tests: go test ./internal/cli (tests must stay hermetic: use -simulate, a lab zone or internal/dnstest)
  • Related: #432, #436

Filed by repo-audit/fix-issues at 2fb80e4. Severity: low. Effort: S. audit-key: bug|internal/cli/session.go|restoreTarget-sources

Linguagem predominante
Go
Estrelas
1
Forks
1
Merge médio
8h 3min
PRs com merge (30d)
31

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/subenum

Todas as issues de TMHSDigital/subenum

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.