SSL certificate analysis improvement
This commit is contained in:
@@ -749,13 +749,13 @@ char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
|
|||||||
|
|
||||||
/* ********************************** */
|
/* ********************************** */
|
||||||
|
|
||||||
static char* print_cipher(u_int8_t c) {
|
static char* print_cipher(ndpi_cipher_weakness c) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case NDPI_CIPHER_INSECURE:
|
case ndpi_cipher_insecure:
|
||||||
return(" (INSECURE)");
|
return(" (INSECURE)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NDPI_CIPHER_WEAK:
|
case ndpi_cipher_weak:
|
||||||
return(" (WEAK)");
|
return(" (WEAK)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ typedef struct ndpi_flow_info {
|
|||||||
struct {
|
struct {
|
||||||
char client_info[64], server_info[64], server_organization[64],
|
char client_info[64], server_info[64], server_organization[64],
|
||||||
ja3_client[33], ja3_server[33];
|
ja3_client[33], ja3_server[33];
|
||||||
u_int8_t client_unsafe_cipher:2, server_unsafe_cipher:2, _pad:4;
|
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
|
||||||
} ssh_ssl;
|
} ssh_ssl;
|
||||||
|
|
||||||
void *src_id, *dst_id;
|
void *src_id, *dst_id;
|
||||||
|
|||||||
+24
-18
@@ -369,7 +369,7 @@ typedef enum {
|
|||||||
} ndpi_http_method;
|
} ndpi_http_method;
|
||||||
|
|
||||||
struct ndpi_lru_cache {
|
struct ndpi_lru_cache {
|
||||||
u_int32_t num_entries, *entries;
|
u_int32_t num_entries, *entries;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ndpi_id_struct {
|
struct ndpi_id_struct {
|
||||||
@@ -480,14 +480,14 @@ struct ndpi_flow_tcp_struct {
|
|||||||
|
|
||||||
/* NDPI_PROTOCOL_WHATSAPP */
|
/* NDPI_PROTOCOL_WHATSAPP */
|
||||||
u_int8_t wa_matched_so_far;
|
u_int8_t wa_matched_so_far;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_TDS */
|
/* NDPI_PROTOCOL_TDS */
|
||||||
u_int8_t tds_login_version;
|
u_int8_t tds_login_version;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_IRC */
|
/* NDPI_PROTOCOL_IRC */
|
||||||
u_int8_t irc_stage;
|
u_int8_t irc_stage;
|
||||||
u_int8_t irc_port;
|
u_int8_t irc_port;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_H323 */
|
/* NDPI_PROTOCOL_H323 */
|
||||||
u_int8_t h323_valid_packets;
|
u_int8_t h323_valid_packets;
|
||||||
|
|
||||||
@@ -555,7 +555,7 @@ struct ndpi_flow_tcp_struct {
|
|||||||
u_int32_t seen_syn:1;
|
u_int32_t seen_syn:1;
|
||||||
u_int32_t seen_syn_ack:1;
|
u_int32_t seen_syn_ack:1;
|
||||||
u_int32_t seen_ack:1;
|
u_int32_t seen_ack:1;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_ICECAST */
|
/* NDPI_PROTOCOL_ICECAST */
|
||||||
u_int32_t icecast_stage:1;
|
u_int32_t icecast_stage:1;
|
||||||
|
|
||||||
@@ -801,7 +801,7 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_CATEGORY_SHOPPING,
|
NDPI_PROTOCOL_CATEGORY_SHOPPING,
|
||||||
NDPI_PROTOCOL_CATEGORY_PRODUCTIVITY,
|
NDPI_PROTOCOL_CATEGORY_PRODUCTIVITY,
|
||||||
NDPI_PROTOCOL_CATEGORY_FILE_SHARING,
|
NDPI_PROTOCOL_CATEGORY_FILE_SHARING,
|
||||||
|
|
||||||
/* Some custom categories */
|
/* Some custom categories */
|
||||||
CUSTOM_CATEGORY_MINING = 99,
|
CUSTOM_CATEGORY_MINING = 99,
|
||||||
CUSTOM_CATEGORY_MALWARE = 100,
|
CUSTOM_CATEGORY_MALWARE = 100,
|
||||||
@@ -819,7 +819,7 @@ typedef enum {
|
|||||||
|
|
||||||
in ndpi_main.c
|
in ndpi_main.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
||||||
NOTE: Keep this as last member
|
NOTE: Keep this as last member
|
||||||
Unused as value but useful to getting the number of elements
|
Unused as value but useful to getting the number of elements
|
||||||
@@ -834,7 +834,7 @@ typedef enum {
|
|||||||
ndpi_pref_disable_metadata_export,
|
ndpi_pref_disable_metadata_export,
|
||||||
ndpi_pref_enable_category_substring_match
|
ndpi_pref_enable_category_substring_match
|
||||||
} ndpi_detection_preference;
|
} ndpi_detection_preference;
|
||||||
|
|
||||||
/* ntop extensions */
|
/* ntop extensions */
|
||||||
typedef struct ndpi_proto_defaults {
|
typedef struct ndpi_proto_defaults {
|
||||||
char *protoName;
|
char *protoName;
|
||||||
@@ -961,7 +961,7 @@ struct ndpi_detection_module_struct {
|
|||||||
void *ipAddresses, *ipAddresses_shadow; /* Patricia */
|
void *ipAddresses, *ipAddresses_shadow; /* Patricia */
|
||||||
u_int8_t categories_loaded;
|
u_int8_t categories_loaded;
|
||||||
} custom_categories;
|
} custom_categories;
|
||||||
|
|
||||||
/* IP-based protocol detection */
|
/* IP-based protocol detection */
|
||||||
void *protocols_ptree;
|
void *protocols_ptree;
|
||||||
|
|
||||||
@@ -1015,12 +1015,18 @@ struct ndpi_detection_module_struct {
|
|||||||
disable_metadata_export:1, /* No metadata is exported */
|
disable_metadata_export:1, /* No metadata is exported */
|
||||||
enable_category_substring_match:1 /* Default is perfect match */
|
enable_category_substring_match:1 /* Default is perfect match */
|
||||||
;
|
;
|
||||||
|
|
||||||
void *hyperscan; /* Intel Hyperscan */
|
void *hyperscan; /* Intel Hyperscan */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* NDPI_LIB_COMPILATION */
|
#endif /* NDPI_LIB_COMPILATION */
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ndpi_cipher_safe = NDPI_CIPHER_SAFE,
|
||||||
|
ndpi_cipher_weak = NDPI_CIPHER_WEAK,
|
||||||
|
ndpi_cipher_insecure = NDPI_CIPHER_INSECURE
|
||||||
|
} ndpi_cipher_weakness;
|
||||||
|
|
||||||
struct ndpi_flow_struct {
|
struct ndpi_flow_struct {
|
||||||
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -1041,7 +1047,7 @@ struct ndpi_flow_struct {
|
|||||||
u_int8_t max_extra_packets_to_check;
|
u_int8_t max_extra_packets_to_check;
|
||||||
u_int8_t num_extra_packets_checked;
|
u_int8_t num_extra_packets_checked;
|
||||||
u_int8_t num_processed_pkts; /* <= WARNING it can wrap but we do expect people to giveup earlier */
|
u_int8_t num_processed_pkts; /* <= WARNING it can wrap but we do expect people to giveup earlier */
|
||||||
|
|
||||||
int (*extra_packets_func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow);
|
int (*extra_packets_func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1093,15 +1099,15 @@ struct ndpi_flow_struct {
|
|||||||
struct {
|
struct {
|
||||||
char client_certificate[64], server_certificate[64], server_organization[64];
|
char client_certificate[64], server_certificate[64], server_organization[64];
|
||||||
char ja3_client[33], ja3_server[33];
|
char ja3_client[33], ja3_server[33];
|
||||||
u_int8_t client_unsafe_cipher:2, server_unsafe_cipher:2, _pad:4;
|
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
|
||||||
} ssl;
|
} ssl;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u_int8_t num_udp_pkts, num_processed_pkts, num_binding_requests, is_skype;
|
u_int8_t num_udp_pkts, num_processed_pkts, num_binding_requests, is_skype;
|
||||||
} stun;
|
} stun;
|
||||||
|
|
||||||
/* We can have STUN over SSL thus they need to live together */
|
/* We can have STUN over SSL thus they need to live together */
|
||||||
} stun_ssl;
|
} stun_ssl;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char client_signature[48], server_signature[48];
|
char client_signature[48], server_signature[48];
|
||||||
@@ -1139,10 +1145,10 @@ struct ndpi_flow_struct {
|
|||||||
NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
|
NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
|
||||||
|
|
||||||
ndpi_protocol_category_t category;
|
ndpi_protocol_category_t category;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_REDIS */
|
/* NDPI_PROTOCOL_REDIS */
|
||||||
u_int8_t redis_s2d_first_char, redis_d2s_first_char;
|
u_int8_t redis_s2d_first_char, redis_d2s_first_char;
|
||||||
|
|
||||||
u_int16_t packet_counter; // can be 0 - 65000
|
u_int16_t packet_counter; // can be 0 - 65000
|
||||||
u_int16_t packet_direction_counter[2];
|
u_int16_t packet_direction_counter[2];
|
||||||
u_int16_t byte_counter[2];
|
u_int16_t byte_counter[2];
|
||||||
@@ -1158,7 +1164,7 @@ struct ndpi_flow_struct {
|
|||||||
/* NDPI_PROTOCOL_HTTP */
|
/* NDPI_PROTOCOL_HTTP */
|
||||||
u_int8_t http_detected:1;
|
u_int8_t http_detected:1;
|
||||||
u_int16_t http_upper_protocol, http_lower_protocol;
|
u_int16_t http_upper_protocol, http_lower_protocol;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_RTSP */
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
u_int8_t rtsprdt_stage:2, rtsp_control_flow:1;
|
u_int8_t rtsprdt_stage:2, rtsp_control_flow:1;
|
||||||
|
|
||||||
@@ -1173,7 +1179,7 @@ struct ndpi_flow_struct {
|
|||||||
|
|
||||||
/* NDPI_PROTOCOL_THUNDER */
|
/* NDPI_PROTOCOL_THUNDER */
|
||||||
u_int8_t thunder_stage:2; // 0 - 3
|
u_int8_t thunder_stage:2; // 0 - 3
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_OSCAR */
|
/* NDPI_PROTOCOL_OSCAR */
|
||||||
u_int8_t oscar_ssl_voice_stage:3, oscar_video_voice:1;
|
u_int8_t oscar_ssl_voice_stage:3, oscar_video_voice:1;
|
||||||
|
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ struct ja3_info {
|
|||||||
|
|
||||||
struct cipher_weakness {
|
struct cipher_weakness {
|
||||||
u_int16_t cipher_id;
|
u_int16_t cipher_id;
|
||||||
u_int8_t weakness_type;
|
ndpi_cipher_weakness weakness_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct cipher_weakness safe_ssl_ciphers[] =
|
static struct cipher_weakness safe_ssl_ciphers[] =
|
||||||
|
|||||||
Reference in New Issue
Block a user