Added check to avoid skype heuristic false positives

This commit is contained in:
Luca Deri
2023-06-12 23:29:20 +02:00
parent 4e284b5e40
commit b02adcc381
2 changed files with 12 additions and 7 deletions
+8 -3
View File
@@ -78,7 +78,7 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s
const uint8_t id_flags_iv_crc_len = 11;
const uint8_t crc_len = sizeof(flow->l4.udp.skype_crc);
const uint8_t crc_offset = id_flags_iv_crc_len - crc_len;
/* Look for two pkts with the same crc */
if((payload_len >= id_flags_iv_crc_len) &&
(packet->payload[2] == 0x02 /* Payload flag */ )) {
@@ -87,8 +87,13 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s
} else {
if(memcmp(flow->l4.udp.skype_crc, &packet->payload[crc_offset], crc_len) == 0) {
NDPI_LOG_INFO(ndpi_struct, "found SKYPE_TEAMS\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE_TEAMS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
return;
/* As there is some heuristic we need to double check before detecting the protocol */
if((flow->guessed_protocol_id_by_ip == NDPI_PROTOCOL_MICROSOFT_AZURE)
|| (flow->guessed_protocol_id_by_ip == NDPI_PROTOCOL_SKYPE_TEAMS)) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE_TEAMS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
return;
}
}
}
/* No idea if the two pkts need to be consecutive; in doubt wait for some more pkts */
+4 -4
View File
@@ -1,8 +1,8 @@
Guessed flow protos: 0
DPI Packets (UDP): 2 (2.00 pkts/flow)
DPI Packets (UDP): 4 (4.00 pkts/flow)
Confidence DPI : 1 (flows)
Num dissector calls: 126 (126.00 diss/flow)
Num dissector calls: 164 (164.00 diss/flow)
LRU cache ookla: 0/0/0 (insert/search/found)
LRU cache bittorrent: 0/0/0 (insert/search/found)
LRU cache zoom: 0/0/0 (insert/search/found)
@@ -20,6 +20,6 @@ Patricia risk mask: 2/0 (search/found)
Patricia risk: 0/0 (search/found)
Patricia protocols: 2/0 (search/found)
Skype_Teams 5 339 1
Skype_TeamsCall 5 339 1
1 UDP 192.168.1.2:35990 <-> 24.224.190.149:39262 [proto: 125/Skype_Teams][IP: 0/Unknown][Encrypted][Confidence: DPI][DPI packets: 2][cat: VoIP/10][4 pkts/279 bytes <-> 1 pkts/60 bytes][Goodput ratio: 40/30][72.51 sec][Plen Bins: 100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
1 UDP 192.168.1.2:35990 <-> 24.224.190.149:39262 [proto: 125.38/Skype_Teams.Skype_TeamsCall][IP: 0/Unknown][Encrypted][Confidence: DPI][DPI packets: 4][cat: VoIP/10][4 pkts/279 bytes <-> 1 pkts/60 bytes][Goodput ratio: 40/30][72.51 sec][Plen Bins: 100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]