Skip to main content

JA4+ network fingerprinting library for TLS, TCP, HTTP, SSH, and X.509 analysis

Project description

JA4+

A Python library for JA4+ network fingerprinting. Implements all eight JA4+ methods for identifying and classifying network traffic based on TLS, TCP, HTTP, SSH, and X.509 characteristics.

JA4+ is a set of network fingerprinting standards created by FoxIO. This library is an independent Python implementation of the published specification. For the original spec, see the FoxIO JA4+ repository.

Supported Fingerprint Types

Type Protocol Description
JA4 TLS Client fingerprint from ClientHello messages
JA4S TLS Server fingerprint from ServerHello messages
JA4H HTTP Client fingerprint from request headers and cookies
JA4T TCP Client OS fingerprint from SYN packets
JA4TS TCP Server fingerprint from SYN-ACK packets
JA4L TCP Light distance and latency estimation
JA4X X.509 Certificate structure fingerprint from OID sequences
JA4SSH SSH Session type classification from traffic patterns

Installation

pip install ja4plus

Or install from source:

git clone https://github.com/Crank-Git/ja4plus.git
cd ja4plus
pip install -e .

Quick Start

from scapy.all import rdpcap
from ja4plus import JA4Fingerprinter

packets = rdpcap("capture.pcap")

fp = JA4Fingerprinter()
for packet in packets:
    result = fp.process_packet(packet)
    if result:
        print(f"JA4: {result}")

Usage

Class-Based API

Each fingerprinter processes packets and collects results:

from ja4plus import JA4Fingerprinter, JA4SFingerprinter, JA4TFingerprinter

ja4 = JA4Fingerprinter()
ja4s = JA4SFingerprinter()
ja4t = JA4TFingerprinter()

for packet in packets:
    ja4.process_packet(packet)
    ja4s.process_packet(packet)
    ja4t.process_packet(packet)

for entry in ja4.get_fingerprints():
    print(entry["fingerprint"])

Function-Based API

For one-shot fingerprinting of individual packets:

from ja4plus import generate_ja4, generate_ja4s, generate_ja4h

fingerprint = generate_ja4(packet)

All Fingerprinters

from ja4plus import (
    JA4Fingerprinter,      # TLS Client
    JA4SFingerprinter,     # TLS Server
    JA4HFingerprinter,     # HTTP
    JA4TFingerprinter,     # TCP Client (SYN)
    JA4TSFingerprinter,    # TCP Server (SYN-ACK)
    JA4LFingerprinter,     # Latency
    JA4XFingerprinter,     # X.509 Certificate
    JA4SSHFingerprinter,   # SSH
)

All fingerprinters share a common interface:

Method Description
process_packet(pkt) Process a packet, returns fingerprint string or None
get_fingerprints() Returns list of all collected fingerprint dicts
reset() Clears all collected state

See docs/usage.md for detailed usage of each fingerprinter.

Fingerprint Formats

Type Format Example
JA4 {proto}{ver}{sni}{ciphcnt}{extcnt}{alpn}_{hash}_{hash} t13d1516h2_8daaf6152771_e5627efa2ab1
JA4S {proto}{ver}{extcnt}{alpn}_{cipher}_{hash} t130200_1301_a56c5b993250
JA4H {method}{ver}{cookie}{ref}{cnt}{lang}_{hash}_{hash}_{hash} ge11cr0800_edb4461d7a83_4817af47a558_...
JA4T {window}_{options}_{mss}_{wscale} 65535_2-4-8-1-3_1460_7
JA4TS {window}_{options}_{mss}_{wscale} 14600_2-4-8-1-3_1460_0
JA4L {latency_us}_{ttl} 2500_56
JA4X {issuer_hash}_{subject_hash}_{ext_hash} a37f49ba31e2_a37f49ba31e2_dd4f1a0ef8b2
JA4SSH c{mode}s{mode}_c{pkts}s{pkts}_c{acks}s{acks} c36s36_c51s80_c69s0

Requirements

Development

git clone https://github.com/Crank-Git/ja4plus.git
cd ja4plus
pip install -e ".[dev]"
pytest tests/ -v

License

BSD 3-Clause License. See LICENSE for details.

Acknowledgments

JA4+ was created by John Althouse at FoxIO. This library is an independent implementation of the published specification. For the original spec and reference implementation, see github.com/FoxIO-LLC/ja4.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ja4plus-0.2.0.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ja4plus-0.2.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file ja4plus-0.2.0.tar.gz.

File metadata

  • Download URL: ja4plus-0.2.0.tar.gz
  • Upload date:
  • Size: 64.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ja4plus-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bdcf90d2097da4cd2916fa8e4d80d316d674e7eb9b25133c6541d48060c6f055
MD5 ad4181023ecd9e933d1e15254d22fb37
BLAKE2b-256 f23bf7532ee682d08e2eed76aaffe054aa453bba8743dae625b18b8224b48e43

See more details on using hashes here.

File details

Details for the file ja4plus-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ja4plus-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ja4plus-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59a77f667f2eeeb0e42d4a2c0cc87fe4bb9e2b728aa16cfeaeefb6041706fc23
MD5 133d8df9ca8011a1a77455588b1129f2
BLAKE2b-256 0b429b350007d8653a7d7cf49c66ca8dd8ba4d840987ee53fb775a2a71619e5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page