Telegram: improve identification

Follow up of 31c706c3db and
75485e177c.

Allow fast classification by ip, but give time to other dissectors to
kick in (for example, the TLS code for the Telegram Web flows).

Even if we don't classify it anymore at the very first packet (i.e. SYN)
we fully classify Telegram traffic at the first packet with payload, as
*any* other protocol.
This way, we always have the proper category, the proper confidence
for the UDP flows and we don't overwrite previous classifications (TLS
or ICMP)

Remove old and stale identification logic for TCP flows
This commit is contained in:
Nardi Ivan
2024-02-26 09:26:21 +01:00
committed by Ivan Nardi
parent c95e8c184e
commit ed5ba179f6
10 changed files with 126 additions and 130 deletions
-8
View File
@@ -8454,14 +8454,6 @@ static ndpi_protocol ndpi_internal_detection_process_packet(struct ndpi_detectio
/* Zoom cache */
if((ret.app_protocol == NDPI_PROTOCOL_ZOOM) && (flow->l4_proto == IPPROTO_TCP))
ndpi_add_connection_as_zoom(ndpi_str, flow);
/*
Telegram
With MTProto 2.0 telegram is no longr TLS-based (altoug based on TCP/443) so
we need to detect it with Telegram IPs
*/
if(ret.protocol_by_ip == NDPI_PROTOCOL_TELEGRAM)
ret.app_protocol = NDPI_PROTOCOL_TELEGRAM, flow->confidence = NDPI_CONFIDENCE_MATCH_BY_IP;
if(ndpi_str->cfg.fully_encrypted_heuristic &&
ret.app_protocol == NDPI_PROTOCOL_UNKNOWN && /* Only for unknown traffic */