/claim #6403
Adds opt-in honeypot detection to reduce noisy results from decoy services that match an unusual number of templates.
New flags (optimization group)
-nhp / --no-honeypot: disable honeypot detection-mhm N / --max-host-match: absolute threshold; flag host after N unique template matchesDetection modes
-mhm > 0): flag when unique matches >= -mhm-mhm is not set): flag when a host matches >= 50% of loaded templates, but only if >= 20 templates are loaded (to reduce false positives on small targeted scans)Signature boosting
Integration points
pkg/protocols/common/honeypotcache: host-keyed cache tracking unique template IDspkg/core/executors.go: checks the cache to skip honeypot hosts and emits a structured ResultEvent with Error: "host was skipped as it was identified as a honeypot" (mirrors HostErrorsCache behavior)SetTotalTemplates is set after templates are loadedBuild:
go build ./...
Targeted tests:
go test ./pkg/protocols/common/honeypotcache/... -count=1 -v
go test ./pkg/core -run Test_executeTemplateOnInput_CallbackPath -count=1
Environment notes (not caused by this PR):
-race requires CGO (CGO_ENABLED=1), so go test ... -race is environment-limited here.go test ./... can fail in this Windows environment due to:
pkg/protocols/headless/engine: temp dir permission issue under C:\WINDOWS\...pkg/testutils/fuzzplayground: go-sqlite3 requires CGOdev-h; no separate docs added)Enkae
@enkae-code
ProjectDiscovery
@projectdiscovery