Skip to content

MCP scan tools cannot run a permutation pass or a zone transfer #405

Closed

Description

@TMHSDigital

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 (scanArgs and remediation)
  • internal/cli/mcp_tools.go:153-207 (lab_scan)
  • pkg/subenum/subenum.go:463 (Permutations)
  • pkg/subenum/zone.go:42-54, 88-95 (ProbeZone, ZoneTransfer as 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) to remediation. It runs the permutation pass over the found names, seeded by subenum.Permutations, within the same max_queries budget.
  • Add an operator opt-in -axfr for subenum mcp that exposes a zone_transfer bool on scan, using ProbeZone/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 -stats does.
  • Allow both on lab_scan unconditionally so agents can practise.

Acceptance criteria

  • scan and lab_scan accept permute, and the result reports the permutation pass
  • zone_transfer is refused unless the server was started with -axfr
  • Documented in docs/mcp.md, with tests in internal/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

  1. added
    enhancement
    help wanted
    severity: medium
    on Nov 17, 2026
  2. TMHSDigital commented on Nov 19, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in b8ffe26.

    • permute on scan and lab_scan runs 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 of max_queries and -max-duration. Its finds join results. The report's permutation gives candidates, tested, found, skipped_by_cap, and its own verdict and reason.
    • subenum mcp -axfr adds zone_transfer to scan. It asks the domain's name servers for a transfer before the scan, skips name servers under exclude, and verifies the transferred names like a source's. The report's zone_transfer gives names, allowed (the servers that allowed a transfer) and denial. Without -axfr, a call that sets it is refused with "zone transfers are off".
    • lab_scan has no zone_transfer yet, because the lab server does not answer transfers. Labs cannot practise -axfr; let a scenario serve a zone transfer #434 covers that.
    • Documented in docs/mcp.md and the output schema.

    Verified with go test ./..., -race on the MCP tests, and golangci-lint v2.15.0. The new tests in internal/cli/mcp_permute_test.go run against a local DNS server: a variant found only by the pass, a budget the scan spends entirely or in part, lab_scan with permute, zone_transfer refused without -axfr, the transfer report, and an excluded name server that is never asked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions