Fixes #6403 — adds honeypot detection to reduce noise from hosts that match everything.
New --honeypot-detection (-hd) flag enables per-host tracking of unique template matches. When a host exceeds the threshold (default 10, configurable via --honeypot-threshold), it is flagged as a honeypot and all further results are suppressed.
nuclei -l targets.txt -hd
nuclei -l targets.txt -hd -hdt 15 # custom threshold
When a honeypot is detected, a warning is logged:
[WRN] Honeypot detected: 192.168.1.100 (10 unique template matches, suppressing further results)
sync.Mutex protects concurrent access during multi-threaded scansTemplateIDs count — a noisy single template won’t trigger false positivesnet/url.Parse + net.SplitHostPort to handle URLs, IPv6 brackets, ports consistentlyWrite() to avoid unnecessary work| File | Change |
|---|---|
pkg/output/honeypot.go |
HoneypotTracker with Check() and normalizeHost() |
pkg/output/honeypot_test.go |
Tests: basic, multi-host, normalization, concurrency |
pkg/output/output.go |
Hook tracker into StandardWriter.Write() |
pkg/types/types.go |
Add HoneypotDetection and HoneypotThreshold options |
cmd/nuclei/main.go |
Register -hd and -hdt CLI flags |
=== RUN TestHoneypotTracker_Basic
--- PASS: TestHoneypotTracker_Basic (0.00s)
=== RUN TestHoneypotTracker_DifferentHosts
--- PASS: TestHoneypotTracker_DifferentHosts (0.00s)
=== RUN TestHoneypotTracker_HostNormalization
--- PASS: TestHoneypotTracker_HostNormalization (0.00s)
=== RUN TestHoneypotTracker_Concurrent
--- PASS: TestHoneypotTracker_Concurrent (0.00s)
=== RUN TestNormalizeHost
--- PASS: TestNormalizeHost (0.00s)
PASS
dev branchgo vet passes/claim #6403
a638011
@a638011
ProjectDiscovery
@projectdiscovery