Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- TUI: a **Follow Records** toggle, `-follow-records`; `-tui -follow-records` now fills it in instead of warning that the flag is ignored (#476).

### Changed
- `-diff`'s removed-name check subtracts the names the `-ptr` pass tested from the `-max-queries` budget; the report's new `ptr_processed` gives that count (#495).
- `-max-queries` is one budget per target on the command line and in the TUI (**Max Names**), as it already was in the library and the MCP server: the `-permute` pass and the names the `-ptr` pass tests get what the passes before them left, where each pass used to get the full number. A pass with nothing left reports its candidates as skipped by the cap, so the target is `degraded`. `-ptr` still looks up at most `-max-queries` addresses, and `-nsec-walk` still sends at most that many queries, on their own. Raise `-max-queries` if you relied on the per-pass meaning (#478).
- CI: the weekly Vulncheck workflow has a **Pin freshness** job that lists, as warnings and in its summary, the SHA-pinned actions, digest-pinned images, GoReleaser and golangci-lint versions that a newer release has passed. It reports and never fails on a stale pin (#485).
- The `-permute` and `-ptr` passes (and the TUI's permutation pass) reuse the main pass's wildcard check of the same target instead of sending the wildcard probes again, so each extra pass sends only its apex lookup before it starts; wildcard filtering is unchanged (#464).
Expand Down
2 changes: 1 addition & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Text output is one name per line. `-show-records` appends the records as ` TYPE=
| `nsec_names`, `nsec_found`, `nsec_stop` | integer, integer, string | when set | `-nsec-walk`: names the walk listed, results it proposed, and why it stopped before the end of the chain or did not run. |
| `parent_checks`, `parent_queries` | integer, integer | when set | `-type NS`: names that failed with SERVFAIL whose delegation was asked of the zone's own name servers, and the queries that took (the name server lookups included; `queries_sent` counts them too). A subzone whose every name server is gone is found this way and flagged `dangling-ns`. |
| `records_found` | integer | when set | `-follow-records`: results that a found name's `CNAME`, `MX`, `NS` or `HTTPS` record pointed at. |
| `ptr_addresses`, `ptr_queries`, `ptr_names`, `ptr_found` | integer | when set | `-ptr`: public addresses looked up, PTR queries sent (`queries_sent` includes them and the lookups of the names), names under the target the answers gave that were tested, and results they proposed. |
| `ptr_addresses`, `ptr_queries`, `ptr_names`, `ptr_processed`, `ptr_found` | integer | when set | `-ptr`: public addresses looked up, PTR queries sent (`queries_sent` includes them and the lookups of the names), names under the target the answers gave that were tested, the lookups the scan of those names did (`-diff` spends the `-max-queries` budget less these), and results they proposed. |
| `zone_denial` | string | when set | The DNSSEC probe of `-axfr` or `-nsec-walk`: `nsec` (anyone can list the zone), `nsec3` or `none`. |
| `pool_hits`, `confirmed`, `unconfirmed` | integer | when set | `-r`: pool hits, and how many the trusted resolver confirmed or denied. |
| `wildcard` | boolean | always | `true` when the target answers names that do not exist. |
Expand Down
1 change: 1 addition & 0 deletions docs/schemas/stats.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"ptr_addresses": { "type": "integer", "minimum": 0, "description": "-ptr: public addresses whose PTR records were looked up. Absent when 0." },
"ptr_queries": { "type": "integer", "minimum": 0, "description": "-ptr: PTR queries sent; queries_sent includes them. Absent when 0." },
"ptr_names": { "type": "integer", "minimum": 0, "description": "-ptr: names under the target the PTR answers gave that were tested. Absent when 0." },
"ptr_processed": { "type": "integer", "minimum": 0, "description": "-ptr: lookups the scan of the PTR names did; -diff subtracts them from the -max-queries budget. Absent when 0." },
"ptr_found": { "type": "integer", "minimum": 0, "description": "-ptr: results the PTR answers proposed, each confirmed by a forward lookup. Absent when 0." },
"zone_denial": { "type": "string", "enum": ["nsec", "nsec3", "none"], "description": "How the zone proves a name does not exist, from the DNSSEC probe of -axfr or -nsec-walk: nsec means anyone can list it by walking it. Absent when not probed or no server answered." },
"pool_hits": { "type": "integer", "minimum": 0, "description": "-r: names a pool resolver said exist. Absent when 0." },
Expand Down
1 change: 1 addition & 0 deletions internal/cli/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func emitRemoved(ctx context.Context, s *session, summary *output.Summary) int64
if t.Permutation != nil {
left -= t.Permutation.Processed
}
left -= t.PTRProcessed
}
if left < 1 {
out.Info("Note: -diff is not checking removed names because the -max-queries budget is spent")
Expand Down
17 changes: 17 additions & 0 deletions internal/cli/ptr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,3 +407,20 @@ func TestE2EPTRSharesMaxQueries(t *testing.T) {
t.Errorf("-max-queries 1: verdict %q (%s), want degraded", ts.Verdict, ts.Reason)
}
}

// TestE2EDiffBudgetCountsPTRNames: the -diff removed-name check spends what
// the scan and the -ptr pass left of -max-queries. The scan tests 1 name and
// the PTR pass 3, so under -max-queries 5 one of the two missing names can be
// checked and the other is unverified.
func TestE2EDiffBudgetCountsPTRNames(t *testing.T) {
t.Parallel()
z := &ptrTrioZone{}
prev := writeFile(t, "prev.txt", "trio.example.com\ngone-1.example.com\ngone-2.example.com\n")
_, out, ts := runPTRTrio(t, dnstest.Start(t, z.answer), "-max-queries", "5", "-diff", prev)
if ts.PTRProcessed != 3 {
t.Errorf("ptr_processed %d, want 3\n%s", ts.PTRProcessed, out)
}
if !strings.Contains(out, "the remaining -max-queries budget covers 1 of them") {
t.Errorf("want the removed-name check limited to 1 of 2 names:\n%s", out)
}
}
4 changes: 3 additions & 1 deletion internal/output/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ type TargetSummary struct {
// PTRAddresses counts the public addresses -ptr looked up, PTRQueries
// the PTR queries that took (queries_sent includes them and the scan of
// the names), PTRNames the names under the target the answers gave that
// were tested, and PTRFound the ones that resolved (#436).
// were tested, PTRProcessed the lookups the scan of them did, and PTRFound
// the ones that resolved (#436).
PTRAddresses int `json:"ptr_addresses,omitempty"`
PTRQueries int64 `json:"ptr_queries,omitempty"`
PTRNames int `json:"ptr_names,omitempty"`
PTRProcessed int64 `json:"ptr_processed,omitempty"`
PTRFound int `json:"ptr_found,omitempty"`
// ZoneDenial is how the zone proves a name does not exist, from the
// DNSSEC probe of -axfr or -nsec-walk: "nsec" (walkable: every name can be listed), "nsec3" or
Expand Down
1 change: 1 addition & 0 deletions internal/report/ptr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func PTR(t *output.TargetSummary, p PTRPass, interrupted bool, name func(scan.Se
case p.Final != nil:
final := p.Final
t.QueriesSent += final.Stats.QueriesSent
t.PTRProcessed = final.Processed
// Its results count toward the target's takeover and internal
// totals like the main pass's (#458).
t.Takeover += final.Stats.Takeover
Expand Down
Loading