-
Notifications
You must be signed in to change notification settings - Fork 722
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
Add JA3 fingerprinting #3817
Add JA3 fingerprinting #3817
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reading the tests!
tls/s2n_fingerprint.c
Outdated
const bool s2n_grease_values[] = { | ||
[0x0A] = true, [0x1A] = true, [0x2A] = true, [0x3A] = true, | ||
[0x4A] = true, [0x5A] = true, [0x6A] = true, [0x7A] = true, | ||
[0x8A] = true, [0x9A] = true, [0xAA] = true, [0xBA] = true, | ||
[0xCA] = true, [0xDA] = true, [0xEA] = true, [0xFA] = true, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a table for this? https://godbolt.org/z/4dcro7MK3
You should be able to just
ENSURE_EQ((byte1 | 0xF0), 0xFA);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.rfc-editor.org/rfc/rfc8701.html
These values were allocated sparsely to discourage server implementations from conditioning on them.
You're messing up the GREASE strategy Cameron, they're supposed to be hard to match on :)
Description of changes:
Add JA3 fingerprinting functionality. For now, it's not publicly accessible.
JA3 is a method for identifying clients. See this blog post from its creator: https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/
We provide two methods, one to retrieve the full JA3 string and one to retrieve just the hash of the JA3 string. While the hash should be sufficient to identify a client, some customers have requested access to the full JA3 string.
Callouts
Testing:
I wrote unit tests and a small number of known value tests.
In the future, I'd like to add fuzzing and call the API in s2nd so that it gets run for all the integration tests. Let me know if you have other testing ideas!
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.