Label Follow Records results as records in the TUI and count records_found

Closed
BE
11h ago
+108-3

Description

The TUI dropped Event.Followed, so a name found through a found name's records was saved with sources: ["wordlist"] (or the permutation or PTR pass's source), and the report had no records_found. Now record takes the followed flag and labels such a result records before the stage and candidate-set cases (as emitFrom in internal/cli/session.go does), formValues.attributed counts Follow Records so the results file has sources with that toggle alone, and summary sets RecordsFound from foundBy[candidates.Records].

Before (wordlist app, Record Types A,CNAME, Follow Records and Permute on, jsonl output):

{"subdomain":"lb-7.int.example.com",...,"sources":["wordlist"]}
summary: no records_found

After:

{"subdomain":"lb-7.int.example.com",...,"sources":["records"]}
summary: "records_found":1

Related Issue

Fixes #494

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added/updated appropriate comments to the code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)

Ethical Considerations

  • This change maintains or improves the security controls in the tool
  • This change follows the educational/legitimate security testing focus of the project
  • I have considered potential misuse cases and taken appropriate steps to prevent them

Additional Information

New tests in internal/tui/follow_test.go fail without the fix and pass with it: an end-to-end TUI run (Follow Records alone, and with Permute) and a check that a followed result in the permutation or PTR stage keeps source records. go test ./... passes.


Summary by cubic

Fixes the TUI dropping Event.Followed so a name named by a found name's records was saved with the wrong source and the report had no records_found. Now such results are labeled records before the stage and candidate-set cases, formValues.attributed includes Follow Records so the results file sources show records, and the summary sets records_found from foundBy[candidates.Records].