TUI labels Follow Records results as wordlist names and omits records_found

Aperta Adatta ai principianti
#494 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Inizia da internal/tui/model.go, in particolare da updateScan, record e summary, poi confronta la gestione della CLI in internal/cli/session.go e internal/cli/summary.go. Esamina internal/tui/form.go e i test esistenti in internal/tui/passes_test.go; esegui go test ./internal/tui/. Il lavoro è completato quando i risultati del follow-up sono etichettati come record in entrambi i passaggi, i report includono records_found e un test TUI copre entrambi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
1
Fork
1
Merge medio
10h
PR unite (30g)
26

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/subenum

Tutte le issue di TMHSDigital/subenum

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.