Skip to content

Cheap wins before brute-forcing: try AXFR and detect NSEC-walkable zones #85

Closed

Description

@TMHSDigital

Why it matters

  • A misconfigured authoritative server that allows zone transfer (AXFR) gives the complete answer in one query, versus millions of brute-force queries.
  • Zones signed with plain NSEC (not NSEC3) can be walked to list every name.

Checking both first is standard tradecraft (dnsrecon, fierce). It costs almost nothing, and it fits subenum's "minimize queries, trust the result" positioning.

Proposal

  • -axfr (or on by default with a notice):
    • Look up the target's NS records.
    • Attempt AXFR against each authoritative server.
    • On success, report the zone transfer as a finding and merge the names into the results, tagged source: axfr.
  • Detect NSEC versus NSEC3 and print a notice when the zone is walkable. Walking it could be a later -nsec-walk.
  • Charge these queries against -rate and -max-queries.
  • Probably requires the miekg/dns migration proposed in -rate still under-counts wire queries: CNAME sends 3 queries and Go's resolver retries internally #50, since the stdlib resolver can't do AXFR.

Done when

Against a test server allowing AXFR, subenum reports the transfer and every name in the zone, with the queries counted.

Activity

  1. added
    priority: low
    area: dns
    feature
    on Oct 5, 2026
  2. TMHSDigital commented on Nov 13, 2026

    @TMHSDigital
    OwnerAuthor

    The zone-transfer half shipped in d256b7d as -axfr. NSEC-walkable detection is split into #234.

    How it works

    • The target's NS records come from -dns-server.
    • Each name server (up to 8, two addresses each) is asked for an AXFR over TCP (internal/dns.Transfer, built on x/net's dnsmessage, so no new dependency and no miekg/dns migration).
    • A server that allows the transfer is reported on stderr and in the run-quality report (axfr_allowed, axfr_names).
    • The zone's names become candidates after the wordlist, and -permute seeds, through the same path as -ct. Each is still verified by a lookup, so a stale zone entry is never reported.
    • Refusals (REFUSED, NOTAUTH, NOTIMP, an ordinary answer, or a closed connection) are the correct configuration and stay quiet unless -v.

    Accounting

    • The NS and address lookups and the transfers count in queries_sent.
    • They are not paced by -rate: there are a handful per target, before the scan.

    Safety and resume

    • Simulation ignores -axfr, and lab mode refuses it, because a transfer would reach the zone's real name servers.
    • The resume state keeps the transferred names.

    Done-when check: against a test server that allows AXFR, the CLI reports the transfer and the server, finds the zone's resolvable names, and counts the queries. Unit tests cover allow, refuse and timeout, and e2e tests cover allowed, refused, and lab/simulate refusal. CI is green on every job.

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

    area: dnsfeaturepriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions