Resumed -follow-records hits come back with source wordlist

Đang mở
#441 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@bfs2021 đang làm issue này rồi.

Từ ngày 21/11/2026.

  • #442 của @bfs2021 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
backend, cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
1
Fork
1
Merge trung bình
8 giờ 3 phút
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/subenum

Tất cả issue của TMHSDigital/subenum

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.