Improved dnscrypt midstream detection. (#1241)

* fixed skype false-positive detection of dnscrypt traffic

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni
2021-07-13 15:10:18 +02:00
committed by GitHub
parent cccf794265
commit e4453938d5
4 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ void ndpi_search_dnscrypt(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG(ndpi_struct, "search dnscrypt\n");
if (flow->packet_counter > 2)
if (flow->packet_counter > 3)
{
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
+9
View File
@@ -35,6 +35,15 @@ static int ndpi_check_skype_udp_again(struct ndpi_detection_module_struct *ndpi_
const uint8_t crc_len = sizeof(flow->l4.udp.skype_crc);
const uint8_t crc_offset = id_flags_iv_crc_len - crc_len;
if (flow->packet_counter > 2)
{
/*
* Process only one packet after the initial packet received.
* This is required to prevent fals-positives with other protocols e.g. dnscrypt.
*/
return 0;
}
if ((payload_len >= id_flags_iv_crc_len) && (packet->payload[2] == 0x02 /* Payload flag */ )) {
u_int8_t detected = 1;
Binary file not shown.
@@ -0,0 +1,7 @@
Guessed flow protos: 0
DPI Packets (UDP): 4 (4.00 pkts/flow)
DNScrypt 6 2380 1
1 UDP 192.168.2.100:46858 <-> 212.47.228.136:443 [proto: 208/DNScrypt][cat: Network/14][3 pkts/1662 bytes <-> 3 pkts/718 bytes][Goodput ratio: 92/82][5137.13 sec][bytes ratio: 0.397 (Upload)][IAT c2s/s2c min/avg/max/stddev: 300005/300005 2568548/2568547 4837091/4837089 2268543/2268542][Pkt Len c2s/s2c min/avg/max/stddev: 554/154 554/239 554/282 0/60][PLAIN TEXT (OYy Tp)][Plen Bins: 0,0,0,16,0,0,0,33,0,0,0,0,0,0,0,0,50,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]