Skip to content

feat(modules): add fingerprint module type#356

Open
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:spike/fingerprint-type
Open

feat(modules): add fingerprint module type#356
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:spike/fingerprint-type

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

a fingerprint module identifies a technology by weighted body/header signatures scored into a confidence, with an optional version regex, rather than a boolean match. it fires one finding carrying the score once it reaches the threshold (default 0.5) - the framework detectors' scoring approach, in the module format, so a custom tech fingerprint can live alongside other modules. validated at load (signatures present, non-empty patterns, finite weights, confidence in [0,1], version regex compiles) and covered by yaml round-trip, validation, header, version and default-threshold tests. documented in docs/modules.md.

depends on #355: the first two commits here are that PR's shared sifpath/httpx helpers (fingerprint.go uses httpx.ReadCappedBody), included so this branch builds standalone. once #355 merges, rebasing this one should drop those two commits as already-applied and leave only the fingerprint commit.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 9, 2026 22:15
@codecov-commenter

codecov-commenter commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 79.56989% with 19 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@a38ba0a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/modules/fingerprint.go 80.23% 9 Missing and 8 partials ⚠️
internal/modules/yaml.go 71.42% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #356   +/-   ##
=======================================
  Coverage        ?   65.04%           
=======================================
  Files           ?       89           
  Lines           ?     7951           
  Branches        ?        0           
=======================================
  Hits            ?     5172           
  Misses          ?     2378           
  Partials        ?      401           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added scan changes to scan engine modules changes to scan modules docs documentation changes tests test changes size/xl 500+ lines changed labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

pr summary

6 files changed (+494 -15)

category files
go source 5
tests 2

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scoring lines up with the framework detector's MatchSignatures, and the boundary's right: score == threshold fires, 0.4 body-alone stays quiet. validation covers the nan/inf weight and regex-compile cases too, good.

two non-blocking notes:

  • version + evidence are both body-only. scoreFingerprint runs the regex on body, and the finding's evidence is truncateEvidence(bodyStr). so a header-scoped fingerprint like your acme example can't pull a Server: nginx/1.2.3 version, and the evidence won't contain the thing that actually matched. worth a follow-up, a lot of real fingerprints are server-header versions.
  • no user-agent on the probe, the http executor sets sif/1.0. some hosts vary or block on go's default UA, so this can move detection accuracy. cheap to add.

confidence: 0 quietly becomes 0.5 via the == 0 check so you can't express always-fire, minor corner. in.

a `fingerprint` module identifies a technology by weighted body/header
signatures scored into a confidence, with an optional version regex, rather
than a boolean match. it fires one finding carrying the score once it reaches
the threshold (default 0.5). this is the framework detectors' scoring in the
module format, so a custom tech fingerprint lives alongside other modules.

validated at load (signatures present, non-empty patterns, finite weights,
confidence in [0,1], version regex compiles) and covered by yaml round-trip,
validation, header, version and default-threshold tests. documented in
docs/modules.md. shares the response body cap via httpx.ReadCappedBody.
@TBX3D
TBX3D force-pushed the spike/fingerprint-type branch from 5f80900 to 830ad7b Compare July 23, 2026 00:10
@TBX3D

TBX3D commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

rebased. #355 merged, so the two shared-helper commits this was stacked on dropped as already-upstream and the branch is just the fingerprint module type now. the only resolution was the docs type line, which lists http, tcp and fingerprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs documentation changes modules changes to scan modules scan changes to scan engine size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants