feat: port Go library features — JA4D, QUIC JA4S, cleanup API, raw fingerprint fix#9
Merged
Conversation
…PI, raw fingerprint fix
- Add JA4D DHCP fingerprinter: 18 message types, option/param list builder,
format {msg_type}{max_size}{req_ip}{fqdn}_{options}_{params}, ported from Go ja4d.go
- Add QUIC Server Initial decryption to JA4S: add parse_quic_server_initial()
to quic_utils.py using server-side HKDF key derivation; JA4SFingerprinter
now tracks client DCIDs and decrypts server Initials for QUIC JA4S fingerprints
- Add cleanup_connection() API to all fingerprinters: no-op default on
BaseFingerprinter; per-connection eviction on JA4L, JA4SSH, JA4H, JA4X, JA4S,
JA4D to prevent memory leaks in long-running monitors
- Fix JA4 raw fingerprint format divergence: remove "JA4_r = " / "JA4_ro = "
label prefixes from get_raw_fingerprint() return values — return clean strings
- 52 new tests (529 total, 477 baseline)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{msg_type}{max_size}{req_ip}{fqdn}_{options}_{params}quic_utils.py)cleanup_connection(src_ip, src_port, dst_ip, dst_port, proto)to all fingerprinters — no-op default onBaseFingerprinter, per-connection eviction on stateful fingerprinters (JA4L, JA4SSH, JA4H, JA4X, JA4S) to prevent memory leaks in long-running monitors"JA4_r = "/"JA4_ro = "label prefixes fromget_raw_fingerprint()return values — now returns clean data strings matching Go behaviorTest Plan
tests/test_ja4d.py— 30 tests covering all message types, option/param list building, section format, flags, edge casestests/test_cleanup_connection.py— 12 tests covering all stateful fingerprinterstests/test_quic_utils.py— QUIC server Initial parsing + JA4S DCID state tracking529 passed, 86 subtests passed