Repository navigation
Description
Summary
subenum never asks reverse DNS. The addresses it finds often sit in ranges where the owner publishes PTR records under the target domain (host-12.dc1.example.com), which is a cheap, keyless source of names no wordlist will guess. Add an opt-in reverse pass over the found addresses.
Where
- No PTR query or
LookupAddrcall exists anywhere underinternal/orpkg/. internal/candidates/candidates.go:17: the candidate sources (wordlist,axfr,permute, plus passivect/wayback)internal/dns/scope.go:50(InternalScope): addresses are already classified per result, so private/loopback ones can be skipped.
Details
Results carry their A/AAAA values (internal/dns/resolver.go:23), but nothing turns them back into names. Tools in the same space treat a reverse sweep as a standard enumeration step.
Impact
Users mapping an organisation's own hosting miss hostnames that are only discoverable through PTR. This matters most for on-prem and self-hosted ranges, where brute-forcing is weakest.
Suggested fix
-ptr(default off): after the main pass, take the unique public A/AAAA values of found names (skippinginternal_addressones and wildcard fingerprints) and query PTR for each.- Optional
-ptr-neighbours N: also query the N addresses on each side of every IPv4 hit, capped so a/24costs at most 256 queries per range. IPv6 stays exact-match only. - PTR names under the target and in scope become candidates with source
ptr, are then resolved forward like any candidate (so a stale PTR is not reported as existing), and count toward-rate,-max-queriesand-stats.
Trade-offs: neighbour sweeps send traffic to address space the user may not own. Keep it opt-in, document it next to -exclude, and skip ranges that belong to shared CDNs or clouds (a forward-confirmed PTR under the target is still safe to report).
Acceptance criteria
- With a dnstest server that answers PTR, a name only reachable through PTR is reported with source
ptrafter forward confirmation. - Without
-ptr, query counts are unchanged. - PTR queries respect
-rate, budgets and-exclude, and appear in-stats.
Getting started
- Relevant files:
internal/dns/resolver.go,internal/candidates/candidates.go,internal/cli/permute.go(pattern for a follow-up pass),internal/dnsserver(to add PTR answers for tests; seedocs/ROADMAP.md"Known limitations") - How to run tests:
go test ./...
Filed by repo-audit/feature-ideas at 090df0a. Severity: low. Effort: M. audit-key: enhancement|internal/candidates/candidates.go|ptr-sweep
Activity
TMHSDigital commentedon Nov 21, 2026
Implemented in 2fb80e4.
What changed
-ptrflag (off by default). After the main pass and any-permutepass, each target's unique public A/AAAA values get one PTR query.internal_addressones (private, loopback, link-local, CGNAT) and addresses from the wildcard fingerprint are skipped.sources: ["ptr"].-rate(and by-rate-per-resolverthrough-r) and stop when-max-durationruns out. A reverse name that-excluderules out (for example*.2.0.192.in-addr.arpa) is never queried, and at most-max-queriesaddresses are asked. The name pass gets its own-max-queriesbudget, as the-permutepass does and as-nsec-walktreats its walk.-statsaddsptr_addresses,ptr_queries,ptr_namesandptr_found, andqueries_sentincludes the PTR queries and the name pass. Without-ptr, no PTR query is sent and counts are unchanged.-ptrhits with their source and keeps them out of the-permuteseeds. Its PTR lookups start over rather than picking up where the stopped run left off.internal/dnsserveranswers PTR (Reply.PTR). Lab scenarios take<address> PTR <host>lines.Verification
TestE2EPTRuses a local dnstest server. It checks that a PTR-only name is reported with sourceptrafter forward confirmation, that a stale PTR name is not reported, and the-statscounts. It also checks that private addresses and off-target or excluded names are never queried, that an excluded reverse zone gets no PTR query, that-max-queries 1caps the PTR queries, and that a run without-ptrsends no PTR query.TestPTRResume,TestPTRAddresses,TestLookupPTR,TestReverseNameandTestPTRRecords(lab zones) cover the rest.go test -shuffle=on ./...andgo mod tidy -diffall pass locally. The Go CI run on the commit passed.Left out
-ptr-neighbours Nsweep. It sends traffic to address space the user may not own, so it needs an owner decision first.pkg/subenumandsubenum mcpdon't expose-ptr. The library has no follow-up passes.-rateis not checked by timing in a test. The PTR lookups use the same rate limiter and per-query accounting as the scan's lookups.