Skip to content

Detect NSEC-walkable zones before brute-forcing #234

Closed

Description

@TMHSDigital

Summary

Split from #85, whose zone-transfer half shipped as -axfr. A zone signed with plain NSEC (not NSEC3) can be walked to list every name, so a scan should say when a target's zone is walkable, before it brute-forces.

Where

  • main_axfr.go (the pre-scan step to extend, next to the zone transfer)
  • internal/dns/axfr.go (the raw dnsmessage client pattern to reuse)
  • internal/dnsserver/server.go (the test server would need NSEC/NSEC3 answers)

Proposal

  • Ask one of the target's authoritative name servers for a random nonexistent name, with the DNSSEC OK bit (EDNS0 DO) set, and read the authority section of the NXDOMAIN answer:
    • NSEC means the zone is walkable: print a notice and add nsec_walkable: true to the report.
    • NSEC3 or no proof means it is not walkable.
  • One query per target, counted in queries_sent, and behind a flag (or as part of -axfr).
  • Actually walking the zone (-nsec-walk) can come later.

Acceptance criteria

  • An NSEC-signed zone on the test server is reported as walkable; NSEC3 and unsigned zones are not
  • The query is counted, and lab mode refuses it like -axfr

Getting started


Filed by repo-audit/fix-issues at 38a0ee5. Severity: low. Effort: M. audit-key: enhancement|main_axfr.go|nsec-walkable

Activity

  1. added
    enhancement
    help wanted
    area: dns
    severity: low
    on Nov 13, 2026
  2. TMHSDigital commented on Nov 13, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 33ca905 (test race fixed in 76c0174). -axfr now also sends one DNSSEC probe per target to an authoritative address. It asks about a random name that doesn't exist, with the DO bit set in an EDNS0 OPT record, over UDP, and falls back to TCP if the answer is truncated.

    internal/dns.ProbeDenial reads the authority section of the answer:

    • Plain NSEC: the zone is walkable. This is reported on stderr as Zone walkable and in the run-quality report as zone_denial: "nsec".
    • NSEC3 or no DNSSEC proof: reported as zone_denial: "nsec3" or "none".

    The probe counts in queries_sent, the result is kept in the resume state, and lab mode refuses it along with -axfr. subenum doesn't walk the zone itself; ROADMAP now lists -nsec-walk as possible future work.

    Verified:

    • Unit tests cover NSEC, NSEC3, unsigned, NODATA, SERVFAIL and a silent server.
    • E2E tests cover a walkable zone and an NSEC3 zone; the test DNS server signs negative answers via Reply.Denial.
    • go test -race and lint pass.
    • CI is green on every job at 76c0174. The first CI run caught a race in the new test, which 76c0174 fixes.
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: dnsenhancementhelp wantedseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions