Improved IPSec/ISAKMP detection. (#1600)

Signed-off-by: lns <matzeton@googlemail.com>
This commit is contained in:
Toni
2022-06-16 09:16:18 +02:00
committed by GitHub
parent c43360f8e6
commit 20a29c393f
11 changed files with 257 additions and 26 deletions
+6 -3
View File
@@ -1283,8 +1283,8 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
"STUN", NDPI_PROTOCOL_CATEGORY_NETWORK,
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 3478, 0, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_str, 0 /* encrypted */, 0 /* nw proto */, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_IP_IPSEC,
"IPsec", NDPI_PROTOCOL_CATEGORY_VPN,
ndpi_set_proto_defaults(ndpi_str, 0 /* encrypted */, 0 /* nw proto */, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_IPSEC,
"IPSec", NDPI_PROTOCOL_CATEGORY_VPN,
ndpi_build_default_ports(ports_a, 500, 0, 0, 0, 0) /* TCP */,
ndpi_build_default_ports(ports_b, 500, 4500, 0, 0, 0) /* UDP */);
ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, 0 /* nw proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_IP_GRE,
@@ -3140,7 +3140,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
switch(proto) {
case NDPI_IPSEC_PROTOCOL_ESP:
case NDPI_IPSEC_PROTOCOL_AH:
return(NDPI_PROTOCOL_IP_IPSEC);
return(NDPI_PROTOCOL_IPSEC);
break;
case NDPI_GRE_PROTOCOL_TYPE:
return(NDPI_PROTOCOL_IP_GRE);
@@ -4421,6 +4421,9 @@ static int ndpi_callback_init(struct ndpi_detection_module_struct *ndpi_str) {
/* RSH */
init_rsh_dissector(ndpi_str, &a, detection_bitmask);
/* IPsec */
init_ipsec_dissector(ndpi_str, &a, detection_bitmask);
#ifdef CUSTOM_NDPI_PROTOCOLS
#include "../../../nDPI-custom/custom_ndpi_main_init.c"
#endif