Renamed TLS requested server name

This commit is contained in:
Luca
2020-01-02 07:37:03 +01:00
parent f6c7a33177
commit 8b01056b21
6 changed files with 16 additions and 12 deletions
+5 -3
View File
@@ -1017,7 +1017,8 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
snprintf(flow->telnet.username, sizeof(flow->telnet.username), "%s", flow->ndpi_flow->protos.telnet.username);
snprintf(flow->telnet.password, sizeof(flow->telnet.password), "%s", flow->ndpi_flow->protos.telnet.password);
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SSH)) {
snprintf(flow->ssh_tls.client_info, sizeof(flow->ssh_tls.client_info), "%s",
snprintf(flow->ssh_tls.client_requested_server_name,
sizeof(flow->ssh_tls.client_requested_server_name), "%s",
flow->ndpi_flow->protos.ssh.client_signature);
snprintf(flow->ssh_tls.server_info, sizeof(flow->ssh_tls.server_info), "%s",
flow->ndpi_flow->protos.ssh.server_signature);
@@ -1032,8 +1033,9 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|| (flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client[0] != '\0')
) {
flow->ssh_tls.ssl_version = flow->ndpi_flow->protos.stun_ssl.ssl.ssl_version;
snprintf(flow->ssh_tls.client_info, sizeof(flow->ssh_tls.client_info), "%s",
flow->ndpi_flow->protos.stun_ssl.ssl.client_certificate);
snprintf(flow->ssh_tls.client_requested_server_name,
sizeof(flow->ssh_tls.client_requested_server_name), "%s",
flow->ndpi_flow->protos.stun_ssl.ssl.client_requested_server_name);
if(flow->ndpi_flow->protos.stun_ssl.ssl.server_names_len > 0)
flow->ssh_tls.server_names = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.server_names);
+1 -1
View File
@@ -195,7 +195,7 @@ typedef struct ndpi_flow_info {
struct {
u_int16_t ssl_version;
char client_info[64], server_info[64],
char client_requested_server_name[64], server_info[64],
client_hassh[33], server_hassh[33], *server_names,
server_organization[64],
ja3_client[33], ja3_server[33],
+1 -1
View File
@@ -1220,7 +1220,7 @@ struct ndpi_flow_struct {
struct {
struct {
u_int16_t ssl_version, server_names_len;
char client_certificate[64], *server_names, server_organization[64];
char client_requested_server_name[64], *server_names, server_organization[64];
u_int32_t notBefore, notAfter;
char ja3_client[33], ja3_server[33];
u_int16_t server_cipher;
+4 -4
View File
@@ -4219,7 +4219,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|| (flow->guessed_protocol_id == NDPI_PROTOCOL_WHATSAPP_CALL))
ndpi_set_detected_protocol(ndpi_str, flow, flow->guessed_protocol_id, NDPI_PROTOCOL_UNKNOWN);
else if((flow->l4.tcp.tls.hello_processed == 1)
&& (flow->protos.stun_ssl.ssl.client_certificate[0] != '\0')) {
&& (flow->protos.stun_ssl.ssl.client_requested_server_name[0] != '\0')) {
ndpi_set_detected_protocol(ndpi_str, flow, NDPI_PROTOCOL_TLS, NDPI_PROTOCOL_UNKNOWN);
} else {
if((flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN)
@@ -4620,11 +4620,11 @@ void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_str,
}
}
if(flow->protos.stun_ssl.ssl.client_certificate[0] != '\0') {
if(flow->protos.stun_ssl.ssl.client_requested_server_name[0] != '\0') {
unsigned long id;
int rc = ndpi_match_custom_category(ndpi_str,
(char *)flow->protos.stun_ssl.ssl.client_certificate,
strlen(flow->protos.stun_ssl.ssl.client_certificate),
(char *)flow->protos.stun_ssl.ssl.client_requested_server_name,
strlen(flow->protos.stun_ssl.ssl.client_requested_server_name),
&id);
if(rc == 0) {
+2 -1
View File
@@ -1043,7 +1043,8 @@ int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct,
if(!unknown_tls_version) {
ndpi_serialize_start_of_block(serializer, "tls");
ndpi_serialize_string_string(serializer, "version", version);
ndpi_serialize_string_string(serializer, "client_cert", flow->protos.stun_ssl.ssl.client_certificate);
ndpi_serialize_string_string(serializer, "client_requested_server_name",
flow->protos.stun_ssl.ssl.client_requested_server_name);
if(flow->protos.stun_ssl.ssl.server_names)
ndpi_serialize_string_string(serializer, "server_names", flow->protos.stun_ssl.ssl.server_names);
ndpi_serialize_string_string(serializer, "issuer", flow->protos.stun_ssl.ssl.server_organization);
+3 -2
View File
@@ -987,8 +987,9 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
cleanupServerName(buffer, sizeof(buffer));
snprintf(flow->protos.stun_ssl.ssl.client_certificate,
sizeof(flow->protos.stun_ssl.ssl.client_certificate), "%s", buffer);
snprintf(flow->protos.stun_ssl.ssl.client_requested_server_name,
sizeof(flow->protos.stun_ssl.ssl.client_requested_server_name),
"%s", buffer);
if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TLS, buffer, strlen(buffer)))
flow->l4.tcp.tls.subprotocol_detected = 1;