Repository navigation
Backlog
Labels
area: scanScan engine / dispatcherhelp wantedExtra attention is neededperformanceSpeed or memory usageseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost
Description
Summary
Before any candidate is dispatched, each scan pass sends one apex lookup and then 5 wildcard fingerprint probes one after another, while the worker pool waits. The -permute and -ptr passes repeat all of it for a target the main pass just measured. Under -dL that is at least 6 serial round trips per target per pass.
Where
internal/scan/runner.go:490-516(preflight: apex lookup, thenFingerprintWildcard)internal/dns/resolver.go:664,:711(for i := 0; i < probes; i++ { probe() },fingerprintProbes = 5)internal/cli/permute.go:94,internal/cli/ptr.go:224(each callsscanTarget->scan.Runagain)internal/cli/session.go:720(targets run one at a time)
Impact
Take 10k bug-bounty roots with the bundled 5k list at -t 100 and about 200 ms RTT. The scan takes about 10 s per target, and the serial checks add about 1.2 s per pass, or 3.6 s with both extra passes. That is 10 to 35% of wall time with the pool idle, about 3 to 10 hours over the run.
Suggested fix
- Send the 5 initial probes and the apex lookup concurrently (they are independent; join them as
ResolveTypesalready does for record types). Keep the rotation-saturating follow-up loop sequential. - Pass the main pass's fingerprint and preflight result to the same target's
-permuteand-ptrpasses (for example aConfigfield that skips the probes) instead of measuring again. - Later: overlap target i+1's preflight with target i's tail, the way
fetchAheadoverlaps passive lookups.
Acceptance criteria
- Against a local server with 200 ms added latency, time-to-first-dispatch per pass drops from about 6 RTT to about 1 to 2 RTT.
-
-permute/-ptrpasses reuse the main pass's fingerprint; wildcard filtering results are unchanged (existing wildcard tests pass).
Getting started
- Relevant files:
internal/dns/resolver.go,internal/scan/runner.go,internal/scan/wildcard.go - How to run tests:
go test ./internal/dns ./internal/scan
Filed by repo-audit/full-audit at a45b999. Severity: medium. Effort: M. audit-key: performance|internal/dns/resolver.go|checkWildcard
Metadata
Metadata
Assignees
Labels
area: scanScan engine / dispatcherhelp wantedExtra attention is neededperformanceSpeed or memory usageseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost
Activity