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

Remove JA4 fingerprints from wireshark plugin #137

Merged
merged 3 commits into from
Jul 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
Binary file modified wireshark/binaries/windows/4.2.0/ja4.dll
Binary file not shown.
31 changes: 17 additions & 14 deletions wireshark/source/packet-ja4.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,14 @@ char *ja4t (ja4t_info_t *data, conn_info_t *conn) {
wmem_strbuf_append_printf(display, "%c", '_');
for (int i=1; i<conn->syn_ack_count; i++) {
long diff = timediff(&conn->syn_ack_times[i], &conn->syn_ack_times[i-1]);
wmem_strbuf_append_printf(display, "%" PRId64, diff); //(int) latency.nsecs / 100000000);
wmem_strbuf_append_printf(display, "%" PRId64, (long long) diff);
if (i < (conn->syn_ack_count - 1)) {
wmem_strbuf_append_printf(display, "%c", '-');
}
}
if (!nstime_is_zero(&conn->rst_time)) {
long diff = timediff(&conn->rst_time, &conn->syn_ack_times[conn->syn_ack_count-1]);
wmem_strbuf_append_printf(display, "-R%" PRId64, diff); //(int) latency.nsecs / 100000000);
wmem_strbuf_append_printf(display, "-R%" PRId64, (long long) diff);
}
}

Expand Down Expand Up @@ -1239,14 +1239,15 @@ dissect_ja4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *dummy
mark_complete(pinfo->num);
}

// Since JA4 (not JA4+) is now supported by wireshark directly, it is no longer supported in our plugin.
/*if ((handshake_type == 1) || (handshake_type == 2) || (handshake_type == 11) || (http_req != -100)) {
if (ja4_tree == NULL) {
ti = proto_tree_add_item(locate_tree(tree, "tls"), proto_ja4, tvb, 0, -1, ENC_NA);
ja4_tree = proto_item_add_subtree(ti, ett_ja4);
}
}*/

if (handshake_type == 1) {
/*if (handshake_type == 1) {
set_ja4_ciphers(tree, &ja4_data);
set_ja4_extensions(tree, &ja4_data);
if (wmem_strbuf_get_len(ja4_data.signatures) > 3) {
Expand All @@ -1256,7 +1257,7 @@ dissect_ja4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *dummy
update_tree_item(pinfo->num, tvb, tree, &ja4_tree, hf_ja4_raw, ja4_r(&ja4_data), proto);
update_tree_item(pinfo->num, tvb, tree, &ja4_tree, hf_ja4_raw_original, ja4_ro(&ja4_data), proto);
mark_complete(pinfo->num);
}
}*/

if (handshake_type == 2) {
set_ja4_ciphers(tree, &ja4_data);
Expand Down Expand Up @@ -1335,13 +1336,13 @@ static void init_globals (void) {
ret = register_tap_listener("dtls", &hf_ja4s, "dtls.handshake.type == 2", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("dtls", &hf_ja4s_raw, "dtls.handshake.type == 2", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);

ret = register_tap_listener("tls", &hf_ja4, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("tls", &hf_ja4_raw, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("tls", &hf_ja4_raw_original, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("tls", &hf_ja4, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("tls", &hf_ja4_raw, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("tls", &hf_ja4_raw_original, "tls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);

ret = register_tap_listener("dtls", &hf_ja4, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("dtls", &hf_ja4_raw, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("dtls", &hf_ja4_raw_original, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("dtls", &hf_ja4, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("dtls", &hf_ja4_raw, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
//ret = register_tap_listener("dtls", &hf_ja4_raw_original, "dtls.handshake.type == 1", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);

ret = register_tap_listener("tls", &hf_ja4x, "tls.handshake.type == 11", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
ret = register_tap_listener("tls", &hf_ja4x_raw, "tls.handshake.type == 11", TL_REQUIRES_PROTO_TREE, NULL, tap_all, NULL, NULL);
Expand Down Expand Up @@ -1374,11 +1375,12 @@ void
proto_register_ja4(void)
{
static hf_register_info hf[] = {
{ &hf_ja4_raw,
// Since JA4 (not JA4+) is now supported by wireshark directly, it is no longer supported in our plugin.
/*{ &hf_ja4_raw,
{ "JA4 Raw", "ja4.ja4_r",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
},*/
{ &hf_ja4_raw_original,
{ "JA4 Raw (Original)", "ja4.ja4_ro",
FT_STRING, BASE_NONE, NULL, 0x0,
Expand All @@ -1394,11 +1396,12 @@ proto_register_ja4(void)
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_ja4,
// Since JA4 (not JA4+) is now supported by wireshark directly, it is no longer supported in our plugin.
/*{ &hf_ja4,
{ "JA4", "ja4.ja4",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
},*/
{ &hf_ja4x_raw,
{ "JA4X Raw", "ja4.ja4x_r",
FT_STRING, BASE_NONE, NULL, 0x0,
Expand Down