Skip to content

TLS fingerprints

Compute JA3, JA3S, and JA4 TLS fingerprints from raw handshake bytes or extracted fields

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/tlsfp/index.md to help me query TLS fingerprints with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Identify TLS clients from handshake fingerprints

Use binary files containing raw TLS ClientHello handshake messages, including the handshake header. These functions do not read whole PCAP files.

SELECT filename, tlsfp.main.ja3(content) AS ja3, tlsfp.main.ja4(content) AS ja4
FROM read_blob('captures/*.bin');

Quick start

Choose where to run TLS fingerprints, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'tlsfp' AS tlsfp (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-tlsfp'
);

3. Run a query

query.sql
SELECT filename, tlsfp.main.ja3(content) AS ja3, tlsfp.main.ja4(content) AS ja4
FROM read_blob('captures/*.bin');
More example queries →
Technical details
Verified connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'tlsfp' AS tlsfp (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

TLS client/server fingerprinting (JA3, JA3S, JA4 TLS-client) as pure SQL scalars over raw handshake bytes.

Catalog

Everything tlsfp exposes once attached — read straight from the worker's released build.

tlsfp 1 schema
main 10 functions

TLS fingerprint functions: ja3/ja3s/ja4 and their string/raw/from-parts companions, parse_client_hello, and the is_tls_handshake guard.

Schema examples (8)
Examples (8)

Cluster a set of captured ClientHellos by their JA3 and JA4 fingerprints, most frequent first — the headline threat-hunting query.

SELECT tlsfp.main.ja3(client_hello) AS ja3,
  tlsfp.main.ja4(client_hello) AS ja4, count(*) AS n
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))) AS t(client_hello)
GROUP BY 1, 2
ORDER BY n DESC;

Compute the JA3S server fingerprint of a captured ServerHello.

SELECT tlsfp.main.ja3s(from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832')) AS ja3s;

Compute JA3 from ClientHello fields already parsed by a tool such as Zeek (no raw bytes needed).

SELECT tlsfp.main.ja3_from_parts(771, [47, 53, 4865], [0, 11, 10], [29, 23], [0]) AS ja3;

Decode a ClientHello and project its SNI host name and cipher-suite list.

SELECT (tlsfp.main.parse_client_hello(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))).sni AS sni,
  (tlsfp.main.parse_client_hello(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))).ciphers AS ciphers;
4 more examples

Fingerprint only the rows that structurally look like TLS handshakes, skipping junk bytes with the is_tls_handshake guard.

SELECT tlsfp.main.ja4(pkt) AS ja4
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('00'))) AS t(pkt)
WHERE tlsfp.main.is_tls_handshake(pkt);

Pivot from a JA4 fingerprint to the server names it contacted: drop non-handshake rows with is_tls_handshake, group the rest by ja4, and collect each fingerprint's distinct SNI host names from parse_client_hello. Two ClientHellos from the same client stack (to example.com and example.org) collapse to one JA4 with both names; the junk row is dropped.

WITH h AS (SELECT pkt FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e6f7267000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('00'))) AS t(pkt) WHERE tlsfp.main.is_tls_handshake(pkt)) SELECT tlsfp.main.ja4(pkt) AS ja4, count(*) AS handshakes, list_sort(list(DISTINCT (tlsfp.main.parse_client_hello(pkt)).sni)) AS server_names
FROM h
GROUP BY 1
ORDER BY handshakes DESC, ja4;

Profile TLS sessions by their JA3/JA3S client-server pair (the classic C2-detection pairing): fingerprint the ClientHello with ja3 and the ServerHello with ja3s for each captured session, then count sessions per pair.

SELECT tlsfp.main.ja3(s.client_hello) AS ja3,
  tlsfp.main.ja3s(s.server_hello) AS ja3s, count(*) AS sessions
FROM (VALUES (1, from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'), from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832')), (2, from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e6f7267000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'), from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832'))) AS s(session_id, client_hello, server_hello)
GROUP BY 1, 2
ORDER BY sessions DESC, ja3, ja3s;

Audit a JA3 fingerprint: show the pre-hash ja3_string next to ja3 and confirm the fingerprint is exactly the MD5 of that string.

SELECT tlsfp.main.ja3_string(c.client_hello) AS ja3_string,
  tlsfp.main.ja3(c.client_hello) AS ja3,
  md5(tlsfp.main.ja3_string(c.client_hello)) = tlsfp.main.ja3(c.client_hello) AS hash_matches
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))) AS c(client_hello)
ORDER BY ja3;
Scalar functions
is_tls_handshake (bytes BLOB) 1 example

Return TRUE if the bytes look like a TLS ClientHello/ServerHello handshake (optionally wrapped in a TLS record), else FALSE; NULL input → NULL

Arguments
bytes BLOB
The raw bytes to test, e.g. a captured TLS record or handshake message. Returns TRUE if they look like a ClientHello/ServerHello handshake.
ReturnsBOOLEAN
Example

Filter a column to plausible TLS handshakes before fingerprinting.

SELECT tlsfp.main.is_tls_handshake(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'));
Link
ja3 (client_hello BLOB) 3 examples

Compute the JA3 fingerprint (MD5, 32 hex) of a raw TLS ClientHello; NULL if the bytes do not parse

Arguments
client_hello BLOB
Raw TLS ClientHello bytes — either a full TLS record (starting 0x16…) or the bare handshake message (starting 0x01…). Malformed/truncated bytes yield NULL.
ReturnsVARCHAR
Examples (3)

Compute the JA3 fingerprint of a captured ClientHello.

SELECT tlsfp.main.ja3(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'));
SELECT tlsfp.main.ja3(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')) AS ja3;
SELECT tlsfp.main.ja3_from_parts(771, [47,53,4865], [0,11,10], [29,23], [0]) AS ja3;
Link
ja3_from_parts (version INTEGER, ciphers INTEGER[], extensions INTEGER[], curves INTEGER[], point_formats INTEGER[]) 1 example

Compute the JA3 fingerprint (MD5, 32 hex) from already-extracted ClientHello fields (version, ciphers, extensions, curves, point_formats)

Arguments
version INTEGER
The ClientHello legacy TLS version code point, e.g. 771 for TLS 1.2.
ciphers INTEGER[]
The offered cipher-suite code points, in wire order; GREASE values are ignored.
extensions INTEGER[]
The extension type code points, in wire order; GREASE values are ignored.
curves INTEGER[]
The supported elliptic-curve / named-group code points, in wire order.
point_formats INTEGER[]
The EC point-format code points, in wire order, e.g. [0] for uncompressed.
ReturnsVARCHAR
Example

Compute JA3 from fields already parsed by Zeek/pcap tooling.

SELECT tlsfp.main.ja3_from_parts(771, [47,53,4865], [0,11,10], [29,23], [0]);
Link
ja3_string (client_hello BLOB) 2 examples

Return the pre-hash JA3 string (version,ciphers,extensions,curves,point_formats) of a raw ClientHello; NULL if it does not parse

Arguments
client_hello BLOB
Raw TLS ClientHello bytes — either a full TLS record (starting 0x16…) or the bare handshake message (starting 0x01…). Malformed/truncated bytes yield NULL.
ReturnsVARCHAR
Examples (2)

Inspect the un-hashed JA3 string for audit/debugging.

SELECT tlsfp.main.ja3_string(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'));

Audit a JA3 fingerprint: show the pre-hash ja3_string next to ja3 and confirm the fingerprint is exactly the MD5 of that string.

SELECT tlsfp.main.ja3_string(c.client_hello) AS ja3_string,
  tlsfp.main.ja3(c.client_hello) AS ja3,
  md5(tlsfp.main.ja3_string(c.client_hello)) = tlsfp.main.ja3(c.client_hello) AS hash_matches
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))) AS c(client_hello)
ORDER BY ja3;
Link
ja3s (server_hello BLOB) 2 examples

Compute the JA3S fingerprint (MD5, 32 hex) of a raw TLS ServerHello; NULL if the bytes do not parse

Arguments
server_hello BLOB
Raw TLS ServerHello bytes — a full TLS record (0x16…) or the bare handshake message (0x02…). Malformed/truncated bytes yield NULL.
ReturnsVARCHAR
Examples (2)

Fingerprint the server side of a handshake with JA3S.

SELECT tlsfp.main.ja3s(from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832'));

Profile TLS sessions by their JA3/JA3S client-server pair (the classic C2-detection pairing): fingerprint the ClientHello with ja3 and the ServerHello with ja3s for each captured session, then count sessions per pair.

SELECT tlsfp.main.ja3(s.client_hello) AS ja3,
  tlsfp.main.ja3s(s.server_hello) AS ja3s, count(*) AS sessions
FROM (VALUES (1, from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'), from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832')), (2, from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e6f7267000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'), from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832'))) AS s(session_id, client_hello, server_hello)
GROUP BY 1, 2
ORDER BY sessions DESC, ja3, ja3s;
Link
ja3s_from_parts (version INTEGER, cipher INTEGER, extensions INTEGER[]) 1 example

Compute the JA3S fingerprint (MD5, 32 hex) from already-extracted ServerHello fields (version, selected cipher, extensions)

Arguments
version INTEGER
The ServerHello TLS version code point, e.g. 771 for TLS 1.2.
cipher INTEGER
The single cipher-suite code point the server selected, e.g. 49199.
extensions INTEGER[]
The extension type code points the server returned, in wire order; GREASE values are ignored.
ReturnsVARCHAR
Example

Compute JA3S from fields already parsed by Zeek/pcap tooling.

SELECT tlsfp.main.ja3s_from_parts(771, 49199, [65281, 16]);
Link
ja4 (client_hello BLOB) 2 examples

Compute the JA4 (base TLS-client) fingerprint of a raw TLS ClientHello; NULL if the bytes do not parse

Arguments
client_hello BLOB
Raw TLS ClientHello bytes — a full TLS record (0x16…) or the bare handshake message (0x01…). Malformed/truncated bytes yield NULL.
ReturnsVARCHAR
Examples (2)

Compute the JA4 fingerprint of a captured ClientHello.

SELECT tlsfp.main.ja4(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'));

Pivot from a JA4 fingerprint to the server names it contacted: drop non-handshake rows with is_tls_handshake, group the rest by ja4, and collect each fingerprint's distinct SNI host names from parse_client_hello. Two ClientHellos from the same client stack (to example.com and example.org) collapse to one JA4 with both names; the junk row is dropped.

WITH h AS (SELECT pkt FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e6f7267000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('00'))) AS t(pkt) WHERE tlsfp.main.is_tls_handshake(pkt)) SELECT tlsfp.main.ja4(pkt) AS ja4, count(*) AS handshakes, list_sort(list(DISTINCT (tlsfp.main.parse_client_hello(pkt)).sni)) AS server_names
FROM h
GROUP BY 1
ORDER BY handshakes DESC, ja4;
Link
ja4_from_parts (version INTEGER, ciphers INTEGER[], extensions INTEGER[], sig_algs INTEGER[], alpn VARCHAR) 1 example

Compute the JA4 (base TLS-client) fingerprint from already-extracted ClientHello fields (effective TLS version, ciphers, extensions, signature algorithms, ALPN)

Arguments
version INTEGER
The effective TLS version code point (the highest non-GREASE supported_versions value), e.g. 772 for TLS 1.3 or 771 for TLS 1.2.
ciphers INTEGER[]
The offered cipher-suite code points; GREASE is ignored and the list is sorted before hashing.
extensions INTEGER[]
The extension type code points; GREASE is ignored. Include 0 (SNI) to mark SNI present; SNI and ALPN are removed from the hashed set.
sig_algs INTEGER[]
The signature-algorithm code points, kept in original order in the JA4_c hash.
alpn VARCHAR
The first ALPN protocol value, e.g. 'h2'; pass an empty string when no ALPN was offered.
ReturnsVARCHAR
Example

Compute JA4 from fields already parsed by Zeek/pcap tooling.

SELECT tlsfp.main.ja4_from_parts(772, [4865,4866], [0,43,13], [1027,2052], 'h2');
Link
ja4_raw (client_hello BLOB) 1 example

Return the un-hashed JA4_r string (ja4_a_) of a raw ClientHello; NULL if it does not parse

Arguments
client_hello BLOB
Raw TLS ClientHello bytes — a full TLS record (0x16…) or the bare handshake message (0x01…). Malformed/truncated bytes yield NULL.
ReturnsVARCHAR
Example

Inspect the un-hashed JA4_r string for audit/debugging.

SELECT tlsfp.main.ja4_raw(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'));
Link
parse_client_hello (client_hello BLOB) 1 example

Decode a raw TLS ClientHello into STRUCT(version, sni, ciphers, extensions, curves, alpn); NULL struct if the bytes do not parse

Arguments
client_hello BLOB
Raw TLS ClientHello bytes — a full TLS record (0x16…) or the bare handshake message (0x01…). Malformed/truncated bytes yield a NULL struct.
ReturnsSTRUCT of 6 fields
STRUCT 6 fields
  • versionINTEGER
  • sniVARCHAR
  • ciphersINTEGER[]
  • extensionsINTEGER[]
  • curvesINTEGER[]
  • alpnVARCHAR[]
Example

Decode the fingerprint-relevant fields of a ClientHello.

SELECT (tlsfp.main.parse_client_hello(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))).sni;
Link

Try these queries

Cluster a set of captured ClientHellos by their JA3 and JA4 fingerprints, most frequent first — the headline threat-hunting query.

SELECT tlsfp.main.ja3(client_hello) AS ja3,
  tlsfp.main.ja4(client_hello) AS ja4, count(*) AS n
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))) AS t(client_hello)
GROUP BY 1, 2
ORDER BY n DESC

Uses ja3ja4

Compute the JA3S server fingerprint of a captured ServerHello.

SELECT tlsfp.main.ja3s(from_hex('020000360303222222222222222222222222222222222222222222222222222222222222222200c02f00000eff01000100001000050003026832')) AS ja3s

Uses ja3s

Compute JA3 from ClientHello fields already parsed by a tool such as Zeek (no raw bytes needed).

SELECT tlsfp.main.ja3_from_parts(771, [47, 53, 4865], [0, 11, 10], [29, 23], [0]) AS ja3

Uses ja3_from_parts

Decode a ClientHello and project its SNI host name and cipher-suite list.

SELECT (tlsfp.main.parse_client_hello(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))).sni AS sni,
  (tlsfp.main.parse_client_hello(from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100'))).ciphers AS ciphers

Uses parse_client_hello

Fingerprint only the rows that structurally look like TLS handshakes, skipping junk bytes with the is_tls_handshake guard.

SELECT tlsfp.main.ja4(pkt) AS ja4
FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('00'))) AS t(pkt)
WHERE tlsfp.main.is_tls_handshake(pkt)

Uses ja4is_tls_handshake

Pivot from a JA4 fingerprint to the server names it contacted: drop non-handshake rows with is_tls_handshake, group the rest by ja4, and collect each fingerprint's distinct SNI host names from parse_client_hello. Two ClientHellos from the same client stack (to example.com and example.org) collapse to one JA4 with both names; the junk row is dropped.

WITH h AS (SELECT pkt FROM (VALUES (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e636f6d000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('010000cf030311111111111111111111111111111111111111111111111111111111111111110000200a0a002f0035009c009d130113021303c013c014c02bc02cc02fc030cca8cca90100008600000010000e00000b6578616d706c652e6f7267000500050100000000000a000a0008001d001700180019000b00020100000d0012001004030804040105030805050108060601001000050003026832001200000015000000170000001b00001a1a000000230000002b0007060a0a03040303002d000201000033000044690000ff01000100')), (from_hex('00'))) AS t(pkt) WHERE tlsfp.main.is_tls_handshake(pkt)) SELECT tlsfp.main.ja4(pkt) AS ja4, count(*) AS handshakes, list_sort(list(DISTINCT (tlsfp.main.parse_client_hello(pkt)).sni)) AS server_names
FROM h
GROUP BY 1
ORDER BY handshakes DESC, ja4

Uses is_tls_handshakeja4parse_client_hello

14 more examples in the Catalog, each listed under the table or function it uses.

TLS fingerprints is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.