Documentation
¶
Overview ¶
Package ja4 implements BSD-3-Clause-licensed JA4 TLS client fingerprinting. JA4+ methods are intentionally isolated from this package and official builds.
Index ¶
- Constants
- func ComputeJA4(data *ClientHelloData) string
- func FormatJA4(fingerprint string) string
- func GetSupportedVersion(extensions []uint16, supportedVersionsData []byte) uint16
- func JA4Raw(data *ClientHelloData) string
- func ParseCipherSuites(ciphers []int32) []uint16
- func ParseExtensions(extensions []int32) []uint16
- func ValidateJA4(fingerprint string) bool
- type ClientHelloData
Constants ¶
const ( ExtensionSNI uint16 = 0 // Server Name Indication ExtensionALPN uint16 = 16 // Application-Layer Protocol Negotiation )
TLS Extension types to exclude from JA4_c
Variables ¶
This section is empty.
Functions ¶
func ComputeJA4 ¶
func ComputeJA4(data *ClientHelloData) string
ComputeJA4 computes the JA4 fingerprint for a TLS ClientHello Format: {ja4_a}_{ja4_b}_{ja4_c} Example: t13d1516h2_8daaf6152771_e5627efa2ab1
func GetSupportedVersion ¶
GetSupportedVersion extracts the TLS 1.3 supported_versions value from extensions Returns 0 if not found
func JA4Raw ¶
func JA4Raw(data *ClientHelloData) string
JA4Raw returns the raw (unhashed) JA4 fingerprint for debugging Format: {ja4_a}_{sorted_ciphers}_{sorted_extensions_signature_algorithms}
func ParseCipherSuites ¶
ParseCipherSuites converts int32 slice to uint16 slice
func ParseExtensions ¶
ParseExtensions converts int32 slice to uint16 slice
func ValidateJA4 ¶
ValidateJA4 checks if a JA4 fingerprint has the correct format
Types ¶
type ClientHelloData ¶
type ClientHelloData struct {
Version uint16 // TLS version from handshake
CipherSuites []uint16 // Cipher suites offered
Extensions []uint16 // Extensions present
SNI string // Server Name Indication
ALPNs []string // Application-Layer Protocol Negotiation values
SupportedVers uint16 // Supported versions extension value (for TLS 1.3)
IsQUIC bool // Whether this is QUIC (not TCP/TLS)
SignatureAlgorithms []uint16 // Signature algorithms from extension 13 (signature_algorithms)
}
ClientHelloData contains the data needed to compute a JA4 fingerprint