Repository navigation
Description
Summary
-axfr and the NSEC denial probe live in package main and internal/, so users of pkg/subenum (and the MCP server built on it) cannot reach them.
Where
pkg/subenum/sources.go:15pkg/subenum/sources.go:26main_axfr.go:59main_axfr.go:39docs/library.md:111
Details
pkg/subenum offers two built-in sources, CertificateTransparency() and WaybackMachine() (sources.go:26-35); a search of the package's non-test files for axfr and nsec finds nothing. The CLI's -axfr lives in package main: zoneTransfer (main_axfr.go:59) calling dns.Transfer (main_axfr.go:111) and dns.ProbeDenial (main_axfr.go:39), both in internal/, so a library user cannot reach them. docs/library.md:9 says the library is "the same engine the command line runs". Since subenum mcp builds on subenum.Config (main_mcp.go:623), agents lack it too. Checked against #77, #85, #197, #234, #265 and the open list.
Impact
Embedders miss the cheapest win before brute force (a server that allows AXFR hands over the zone) and the NSEC-walkable signal, unless they reimplement AXFR.
Suggested fix
Export ZoneTransfer(opts) returning a Source whose Names resolves the NS set and tries AXFR with the CLI's limits (8 servers, 2 addresses each), plus a small ProbeZone(ctx, domain, resolver) (ZoneInfo{TransferAllowed []string, Denial string}, error) for the report fields. Move the shared logic from main_axfr.go into an internal package both call, as #265 did for passive sources. Trade-off: the Source doc says sources work "without querying the domain's DNS" (sources.go:12), so either reword it or keep AXFR as a separate Config.ZoneTransfer bool; transfers are not paced by Rate, which must be documented as it is for the CLI.
Acceptance criteria
-
pkg/subenumexposes a zone-transfer attempt with the CLI's limits - The CLI and the library share one implementation
- docs/library.md documents it, including that transfers are not paced by
Rate
Getting started
- Relevant files:
pkg/subenum/sources.go,main_axfr.go,docs/library.md - How to run tests:
make test(orgo test ./...). Tests must stay hermetic: use-simulate,-simulate-zoneor the local DNS test server, never a live domain. - Related docs:
docs/DEVELOPER_GUIDE.md,docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at d0c56f0. Severity: medium. Effort: M. audit-key: enhancement|pkg/subenum/sources.go|ZoneTransfer
Activity
TMHSDigital commentedon Nov 15, 2026
Fixed in c799597.
pkg/subenumgains:ProbeZone(ctx, domain, ZoneOptions) (ZoneInfo, error): asks the domain's name servers for a zone transfer and probes its denial proofs.ZoneInfoholds the transferredNames,TransferAllowedandDenial(nsec,nsec3or none). A refused transfer is not an error; a failed name-server lookup or a cancelled context is.ZoneTransfer(ZoneOptions) Source: the same transfer as a source forConfig.Sources, so its names become candidates that are each verified by a lookup.The transfer code moved from the CLI into
internal/axfrwith the same limits (8 name servers, 2 addresses each); the CLI's-axfrmessages are unchanged.docs/library.mdhas a new section, including that these queries go to the domain's own name servers and are not paced byRate.Differences from the suggestion:
ProbeZonetakes aZoneOptions(resolver and timeout) rather than a bare resolver,ZoneInfoalso returns the names, and there is noConfig.ZoneTransferflag;ZoneTransfer()is used throughConfig.Sources.Verified with four new tests in
pkg/subenum/zone_test.goagainst the in-process DNS server (allowed, refused, as a scan source, and error cases); the existing CLI AXFR tests pass unchanged.go test ./...andgolangci-lint runpass.Library: try a zone transfer and report a walkable zone (TMHSDigital#314