From c682e5723b9eb62ff307c83617c243c1b0195d3c Mon Sep 17 00:00:00 2001 From: Johanna Amann Date: Mon, 6 Nov 2023 12:48:30 +0000 Subject: [PATCH] Spicy TLS: rename the analyzer to SSL Naming the analyzer different than the old one was a mistake that required unnecessary code changes; keeping the old name makes things like StartTLS in other protocol work without additional code changes. --- scripts/base/protocols/ssl/dpd.sig | 4 +- src/analyzer/protocol/CMakeLists.txt | 1 - src/analyzer/protocol/ssl/CMakeLists.txt | 2 + .../protocol/ssl/spicy/CMakeLists.txt | 1 + src/analyzer/protocol/ssl/spicy/SSL.evt | 86 +++++++++++++++++++ .../{tls/TLS.spicy => ssl/spicy/SSL.spicy} | 26 +++--- src/analyzer/protocol/tls/CMakeLists.txt | 1 - src/analyzer/protocol/tls/TLS.evt | 86 ------------------- 8 files changed, 104 insertions(+), 103 deletions(-) create mode 100644 src/analyzer/protocol/ssl/spicy/CMakeLists.txt create mode 100644 src/analyzer/protocol/ssl/spicy/SSL.evt rename src/analyzer/protocol/{tls/TLS.spicy => ssl/spicy/SSL.spicy} (99%) delete mode 100644 src/analyzer/protocol/tls/CMakeLists.txt delete mode 100644 src/analyzer/protocol/tls/TLS.evt diff --git a/scripts/base/protocols/ssl/dpd.sig b/scripts/base/protocols/ssl/dpd.sig index 3bcf034dde..2603441d9a 100644 --- a/scripts/base/protocols/ssl/dpd.sig +++ b/scripts/base/protocols/ssl/dpd.sig @@ -3,7 +3,7 @@ signature dpd_tls_server { # SSL3 / TLS Server hello. payload /^(\x15\x03[\x00\x01\x02\x03]....)?\x16\x03[\x00\x01\x02\x03]..\x02...((\x03[\x00\x01\x02\x03\x04])|(\x7F[\x00-\x50])).*/ tcp-state responder - enable "tls" + enable "ssl" } signature dpd_tls_client { @@ -11,7 +11,7 @@ signature dpd_tls_client { # SSL3 / TLS Client hello. payload /^\x16\x03[\x00\x01\x02\x03]..\x01...\x03[\x00\x01\x02\x03].*/ tcp-state originator - enable "tls" + enable "ssl" } signature dpd_dtls_client { diff --git a/src/analyzer/protocol/CMakeLists.txt b/src/analyzer/protocol/CMakeLists.txt index 4c808d6e5e..79e5b6cea0 100644 --- a/src/analyzer/protocol/CMakeLists.txt +++ b/src/analyzer/protocol/CMakeLists.txt @@ -42,6 +42,5 @@ add_subdirectory(ssh) add_subdirectory(ssl) add_subdirectory(syslog) add_subdirectory(tcp) -add_subdirectory(tls) add_subdirectory(xmpp) add_subdirectory(zip) diff --git a/src/analyzer/protocol/ssl/CMakeLists.txt b/src/analyzer/protocol/ssl/CMakeLists.txt index 4d49622f57..a6688a123a 100644 --- a/src/analyzer/protocol/ssl/CMakeLists.txt +++ b/src/analyzer/protocol/ssl/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(spicy) + zeek_add_plugin( Zeek SSL diff --git a/src/analyzer/protocol/ssl/spicy/CMakeLists.txt b/src/analyzer/protocol/ssl/spicy/CMakeLists.txt new file mode 100644 index 0000000000..2b7e766f7f --- /dev/null +++ b/src/analyzer/protocol/ssl/spicy/CMakeLists.txt @@ -0,0 +1 @@ +spicy_add_analyzer(NAME SSL SOURCES SSL.spicy SSL.evt) diff --git a/src/analyzer/protocol/ssl/spicy/SSL.evt b/src/analyzer/protocol/ssl/spicy/SSL.evt new file mode 100644 index 0000000000..facb77120e --- /dev/null +++ b/src/analyzer/protocol/ssl/spicy/SSL.evt @@ -0,0 +1,86 @@ +protocol analyzer SSL over TCP: + parse with SSL::Message, + port 443/tcp; + + protocol analyzer DTLS over UDP: + parse with SSL::Message, + port 443/udp; + +import SSL; +import zeek; +import spicy; + +on SSL::ClientHello -> event ssl_client_hello($conn, self.client_version, msg.record_version, cast