TUI labels Follow Records results as wordlist names and omits records_found

未關閉 適合新手
#494 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
88/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
cli

研究方向

從 internal/tui/model.go 開始,特別查看 updateScan、record 和 summary,接著比較 internal/cli/session.go 和 internal/cli/summary.go 中的 CLI 處理。檢查 internal/tui/form.go 和現有測試 internal/tui/passes_test.go;執行 go test ./internal/tui/。完成條件是:後續結果在兩個階段都標示為記錄,報告包含 records_found,且有一個 TUI 測試涵蓋這兩點。

由索引模型根據 Issue 內容生成。

描述

area: tui bug good first issue severity: low

Summary

With Follow Records on, the TUI does not know which results came from a found name's records. The engine marks them (Event.Followed), and the command line labels them sources: ["records"] and counts them in records_found; the TUI drops the mark, so they are labelled as wordlist names (or as permutation hits) and the report has no records_found.

Where

  • internal/tui/model.go (updateScan: m.record(ev.Result) passes the result without ev.Followed; record; summary never sets RecordsFound)
  • internal/tui/form.go (formValues.attributed does not count Follow Records, so with only that toggle on the results file has no sources at all)
  • For comparison: internal/cli/session.go (emitFrom: case ev.Followed: res.Sources = candidates.FromRecords) and internal/cli/summary.go (t.RecordsFound = res.foundBy[candidates.Records])

Details

// internal/tui/model.go
case ev.Kind == scan.EventResult:
	m.record(ev.Result)

record then picks the sources from the stage and the candidate set only. A followed name is not in the candidate set, and SourcesOf answers ["wordlist"] for any name it does not know.

Impact

TUI users who turn on Follow Records with Sources, Permute, Zone Transfer, NSEC Walk, Service Names or PTR Lookups get results files that say a followed name (for example lb-7.int.example.com behind app CNAME lb-7.int) came from the wordlist. With Follow Records alone, the file names no sources. The Stats File and the JSONL summary lack records_found, which the command line writes for the same scan.

Steps to reproduce

  1. Serve a zone where app.example.com has CNAME lb-7.int.example.com and lb-7.int.example.com has an A record.
  2. In the TUI: wordlist app, Record Types A,CNAME, Follow Records and Permute on, an Output file in jsonl.
  3. The line for lb-7.int.example.com has "sources":["wordlist"]; the summary line has no records_found. The command line with -follow-records -permute writes "sources":["records"] and "records_found":1.

Suggested fix

Pass the event (or its Followed flag) to record, label a followed result candidates.FromRecords before the stage and candidate-set cases, count Follow Records in attributed, and set t.RecordsFound = m.foundBy[candidates.Records] in summary.

Acceptance criteria

  • A followed name's result in a TUI output file has sources ["records"], in the main pass and in a later pass.
  • The TUI's report has records_found when Follow Records found names.
  • A test in internal/tui covers both.

Getting started

  • Relevant files: internal/tui/model.go, internal/tui/form.go, internal/tui/passes_test.go
  • How to run tests: go test ./internal/tui/
  • Related: #476, #432

Filed by repo-audit/fix-issues at b8afd4d. Severity: low. Effort: S. audit-key: bug|internal/tui/model.go|record

主要語言
Go
星號
1
分支
1
平均合併
10 小時
30 天內合併 PR
26

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/subenum 的其他 Issue

查看 TMHSDigital/subenum 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。