Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify header count in JA4H #173

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/ja4h.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def to_ja4h(x, debug_stream=-1):
unsorted_cookie_values = []

x['headers'] = [ h.split(':')[0] for h in x['headers'] ]
x['headers'] = [ h for h in x['headers']
if not h.startswith(':') and not h.lower().startswith('cookie')
x['headers'] = [ h for h in x['headers']
if not h.startswith(':') and not h.lower().startswith('cookie')
and h.lower() != 'referer' and h ]

raw_headers = x['headers'][:]

#x['headers'] = [ '-'.join([ y.capitalize() for y in h.split('-')]) for h in x['headers'] ]
header_len = '{:02d}'.format(len(x['headers']))
header_len = '{:02d}'.format(min(len(x['headers']), 99))

if 'cookies' in x:
if isinstance(x['cookies'], list):
Expand Down
9 changes: 9 additions & 0 deletions technical_details/JA4H.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# JA4H: HTTP Client Fingerprint

![JA4H](https://github.com/FoxIO-LLC/ja4/blob/main/technical_details/JA4H.png)

JA4H fingerprints the HTTP client based on each HTTP request.

### Number of Headers:
2 digit number of headers, not counting Cookie and Referer. For 3 headers the value is "03".
If there are more than 99, the output is 99.