Repository navigation
Description
Summary
The MCP scan and lab_scan tools cannot run a permutation pass or a zone transfer, although the library already exposes both. An agent driving subenum mcp gets a weaker scan than the CLI.
Where
internal/cli/mcp_tools.go:100-105,211-221(scanArgsandremediation)internal/cli/mcp_tools.go:153-207(lab_scan)pkg/subenum/subenum.go:463(Permutations)pkg/subenum/zone.go:42-54,88-95(ProbeZone,ZoneTransferas a Source)
Details
scanArgs takes Domain, Words, Types, MaxQueries, Offset, Sources plus remediation{RetryInconclusive, AutoRate, Exclude, Depth}. Nothing maps to the CLI's -permute or -axfr. explain_stats already explains the AXFR and permutation sections of CLI reports.
Impact
An agent cannot find names that show up only as variants of found ones. It also cannot learn that a target's name server allows AXFR, which is a finding in its own right, or that the zone is NSEC-walkable. To get permutations it has to reimplement them and pass the result as words. A call such as {"domain":"x","permute":true} is rejected as an unknown field.
Suggested fix
- Add
permute(bool) toremediation. It runs the permutation pass over the found names, seeded bysubenum.Permutations, within the samemax_queriesbudget. - Add an operator opt-in
-axfrforsubenum mcpthat exposes azone_transferbool onscan, usingProbeZone/ZoneTransfer. Keep it operator-gated, like sources, because its queries go to the target's own name servers and are not paced. - Report the AXFR/denial and permutation summaries in the structured result, as
-statsdoes. - Allow both on
lab_scanunconditionally so agents can practise.
Acceptance criteria
-
scanandlab_scanacceptpermute, and the result reports the permutation pass -
zone_transferis refused unless the server was started with-axfr - Documented in
docs/mcp.md, with tests ininternal/cli/mcp_test.go
Getting started
- Relevant files:
internal/cli/mcp_tools.go,internal/cli/mcp.go,docs/mcp.md - How to run tests:
go test ./internal/cli/ -run MCP
Filed by repo-audit/full-audit at dd5b156. Severity: medium. Effort: M. audit-key: enhancement|internal/cli/mcp_tools.go|scanArgs
Activity
TMHSDigital commentedon Nov 19, 2026
Fixed in b8ffe26.
permuteonscanandlab_scanruns a second pass after the scan. It tests the variants of the names found (subenum.Permutations) that the scan did not already test, within what the scan left ofmax_queriesand-max-duration. Its finds joinresults. The report'spermutationgivescandidates,tested,found,skipped_by_cap, and its ownverdictandreason.subenum mcp -axfraddszone_transfertoscan. It asks the domain's name servers for a transfer before the scan, skips name servers underexclude, and verifies the transferred names like a source's. The report'szone_transfergivesnames,allowed(the servers that allowed a transfer) anddenial. Without-axfr, a call that sets it is refused with "zone transfers are off".lab_scanhas nozone_transferyet, because the lab server does not answer transfers. Labs cannot practise -axfr; let a scenario serve a zone transfer #434 covers that.docs/mcp.mdand the output schema.Verified with
go test ./...,-raceon the MCP tests, and golangci-lint v2.15.0. The new tests ininternal/cli/mcp_permute_test.gorun against a local DNS server: a variant found only by the pass, a budget the scan spends entirely or in part,lab_scanwith permute,zone_transferrefused without-axfr, the transfer report, and an excluded name server that is never asked.