Repository navigation
Description
Summary
-axfr is the one discovery feature that cannot be practised in a lab: -simulate-zone refuses it. The lab DNS server can already answer zone transfers, though. Let a scenario allow a transfer, point -axfr at the lab server, and add a lab for it.
Where
internal/cli/cli.go:359:{"axfr", f.axfr}, // transfers from the zone's real name serversin the-simulate-zonerefusal listinternal/dnsserver/server.go:57(Transfer) and:575(dnsmessage.TypeAXFR: addTransfer): the server already serves AXFRdocs/labs.md:241-244: documents that-simulate-zonecannot be combined with-axfrexamples/labs/: six scenarios (first scan, wildcard, rate limit, recursive, failures, IPv6), none for zone transfers
Details
The refusal exists because -axfr dials the target's real name servers, which would send traffic off the machine. In a lab run, the NS lookup already goes to the lab server, so the transfer could be sent to that same server instead. The scenario format ($DELAY, $REFUSE-ABOVE, ...) would need one more directive, for example $TRANSFER allow, to turn Transfer on.
Impact
Learners and contributors cannot see what a successful (or refused) zone transfer looks like, or how its names appear with source axfr, without finding a misconfigured real server. That is the wrong thing to send beginners looking for.
Suggested fix
- Add a
$TRANSFER allow|refusescenario directive ininternal/labzone, mapped todnsserver'sTransfer. - In lab mode, send
-axfrtransfers to the lab server's address and port instead of the NS addresses, and dropaxfrfrom the refusal list. - Add
examples/labs/lab7-zone-transfer.zoneand a "Lab 7" section: one transfer that is allowed, then the same zone refused, with questions about where the extra names came from (sources).
Acceptance criteria
-
subenum -simulate-zone lab7 -axfr lab.examplereports transferred names with sourceaxfrand sends no packet off loopback. - A scenario without
$TRANSFER allowreports the transfer as refused. -
docs/labs.mdhas the new lab and no longer lists-axfras incompatible.
Getting started
- Relevant files:
internal/cli/cli.go,internal/cli/axfr.go,internal/labzone/labzone.go,internal/dnsserver/server.go,docs/labs.md - How to run tests:
go test ./... - Related docs:
docs/labs.md("Writing your own scenario")
Filed by repo-audit/feature-ideas at 090df0a. Severity: low. Effort: M. audit-key: enhancement|internal/cli/cli.go|simulate-zone-axfr
Activity
Let MCP scans run a permutation pass and a zone transfer (#405)
TMHSDigital commentedon Nov 19, 2026
Fixed in e821702.
axfr.Optionsgains aServerfield. When it's set, every transfer and the DNSSEC denial probe go to thathost:portinstead of the name servers' addresses, which are still looked up.Serverto the lab server, so-simulate-zoneno longer refuses-axfr.$TRANSFER allow|refuseis a new scenario directive. Withallow, the lab server answers a transfer of the scanned domain with every name the file defines (not the apex, wildcards or failing names). The default,refuse, and a transfer of a name below the apex get REFUSED.examples/labs/lab7-zone-transfer.zoneand a Lab 7 section indocs/labs.mdcover one allowed transfer and the refused case.docs/labs.mdno longer lists-axfras incompatible, and the scenario format documents$TRANSFER.Acceptance:
subenum -simulate-zone lab7 -axfr lab.examplereportsbilling-legacyandk8s-ingress-eu2withsources: ["axfr"]. Lab 7's name server address is in TEST-NET (192.0.2.53), so a transfer that went off loopback could not succeed. The tests pass only because it goes to the lab server.$TRANSFER allowgets no names, and-statshas noaxfr_allowed.Verified with
go test ./...and golangci-lint v2.15.0. The new and updated tests areTestTransferDirective(labzone) andTestE2ELabAXFR, which replacesTestE2ELabRefusesAXFR.lab_scan'szone_transfer(#405) could now be offered too, but it isn't part of this change.