Adds opt-in honeypot detection that tracks match density per host and flags deceptive targets (e.g., Shodan honeypots that deliberately match every nuclei template to fool scanners).
pkg/honeypot package with concurrent-safe Detector using sync.Map-hpt/-honeypot-threshold (int, 0 = disabled) and -hpsu/-honeypot-suppress (bool)StandardWriter.Write() — zero overhead when disabled (threshold=0)honeypot_detected field in JSON/JSONL output for automated post-processing[HONEYPOT] tag in screen output for flagged results(host, templateID) pair[HONEYPOT] warning is emitted per flagged host-honeypot-suppress, results from flagged hosts are silently droppedhoneypot_detected: true# Warn when a host matches more than 100 distinct templates
nuclei -u targets.txt -honeypot-threshold 100
# Same but suppress results from flagged hosts
nuclei -u targets.txt -hpt 100 -hpsu
pkg/honeypot/honeypot.go — Core detector logic (host normalization, match tracking, signature detection)pkg/honeypot/honeypot_test.go — 14 tests (threshold, suppression, concurrency, normalization, signatures)pkg/output/output.go — Integration in Write() and Close() (summary)pkg/output/format_screen.go — [HONEYPOT] tag in terminal outputpkg/types/types.go — HoneypotThreshold and HoneypotSuppress optionscmd/nuclei/main.go — CLI flag registration=== RUN TestNormalizeHost (16 sub-tests) --- PASS
=== RUN TestDetectorDisabled --- PASS
=== RUN TestDetectorNil --- PASS
=== RUN TestDetectorThreshold --- PASS
=== RUN TestDetectorDuplicateTemplates --- PASS
=== RUN TestDetectorMultipleHosts --- PASS
=== RUN TestDetectorSuppression --- PASS
=== RUN TestDetectorConcurrency --- PASS
=== RUN TestDetectorEmptyHost --- PASS
=== RUN TestContainsKnownSignature (9 sub) --- PASS
=== RUN TestDetectorWarningOnlyOnce --- PASS
=== RUN TestDetectorURLVariationsNormalize --- PASS
ok github.com/projectdiscovery/nuclei/v3/pkg/honeypot 0.002s
$ go test -race ./pkg/honeypot/... -count=1
ok github.com/projectdiscovery/nuclei/v3/pkg/honeypot 1.009s
$ go build ./cmd/nuclei/...
# no errors
$ go test ./pkg/output/... ./pkg/types/... ./internal/runner/... -count=1
ok github.com/projectdiscovery/nuclei/v3/pkg/output 0.063s
ok github.com/projectdiscovery/nuclei/v3/internal/runner 0.066s
OPTIMIZATIONS:
-hpt, -honeypot-threshold int threshold of unique template matches before flagging a host as honeypot (0 = disabled)
-hpsu, -honeypot-suppress suppress results from hosts flagged as honeypots
dev)/claim #6403
--honeypot-threshold (int) and --honeypot-suppress (bool)Solari Systems
@SolariResearch
ProjectDiscovery
@projectdiscovery