Commit graph

585 commits

Author SHA1 Message Date
Ivan Nardi
69c89f9061
TLS: heuristics: fix memory allocations (#2577)
Allocate heuristics state only if really needed.
Fix memory leak (it happened with WebSocket traffic on port 443)
2024-09-30 16:55:07 +02:00
Ivan Nardi
ddd08f913c
Add some heuristics to detect encrypted/obfuscated/proxied TLS flows (#2553)
Based on the paper: "Fingerprinting Obfuscated Proxy Traffic with
Encapsulated TLS Handshakes".
See: https://www.usenix.org/conference/usenixsecurity24/presentation/xue-fingerprinting

Basic idea:
* the packets/bytes distribution of a TLS handshake is quite unique
* this fingerprint is still detectable if the handshake is
encrypted/proxied/obfuscated

All heuristics are disabled by default.
2024-09-24 14:20:31 +02:00
Nardi Ivan
686d0e3839 Fix Sonos trace 2024-09-24 13:28:19 +02:00
Luca Deri
806f47337d Added Sonos protocol detection 2024-09-24 10:55:48 +02:00
Ivan Nardi
2bf869ca59
TLS: improve handling of Change Cipher message (#2564) 2024-09-23 17:58:21 +02:00
Ivan Nardi
456bc2a52c
Tls out of order (#2561)
* Revert "Added fix for handling Server Hello before CLient Hello"

This reverts commit eb15b22e77.

* TLS: add some tests with unidirectional traffic

* TLS: another attempt to process CH received after the SH

Obviously, we will process unidirectional traffic longer, because we are
now waiting for messages in both directions
2024-09-18 21:04:03 +02:00
Luca
eb15b22e77 Added fix for handling Server Hello before CLient Hello 2024-09-17 19:04:01 +02:00
Luca
eeb1c281ad Fixed handling of spurious TCP retransmissions 2024-09-17 19:04:01 +02:00
Ivan Nardi
a1602dd0a5
dns: add a check before setting NDPI_MALFORMED_PACKET risk (#2558)
"Invalid DNS Header"-risk should be set only if the flow has been
already classified as DNS. Otherwise, almost any non-DNS flows on port 53
will end up having the `NDPI_MALFORMED_PACKET` risk set, which is a little
bit confusing for non DNS traffic
2024-09-16 22:21:14 +02:00
Ivan Nardi
0ddbda1f82
Add an heuristic to detect encrypted/obfuscated OpenVPN flows (#2547)
Based on the paper: "OpenVPN is Open to VPN Fingerprinting"
See: https://www.usenix.org/conference/usenixsecurity22/presentation/xue-diwen

Basic idea:
* the distribution of the first byte of the messages (i.e. the distribution
of the op-codes) is quite unique
* this fingerprint might be still detectable even if the OpenVPN packets are
somehow fully encrypted/obfuscated

The heuristic is disabled by default.
2024-09-16 18:38:26 +02:00
Nardi Ivan
9e5d0e05d3 QUIC: add a basic heuristic to detect mid-flows 2024-09-10 19:32:31 +02:00
Ivan Nardi
bc9472277d
RTMP: improve detection (#2549) 2024-09-10 16:33:06 +02:00
Ivan Nardi
92507c0146
oracle: fix dissector (#2548)
We can do definitely better, but this change is a big improvements
respect the current broken code
2024-09-07 12:00:31 +02:00
Nardi Ivan
2964c23ca1 Add detection of Windscribe VPN 2024-09-05 16:36:50 +02:00
Nardi Ivan
c99646e4af Add detection of CactusVPN 2024-09-05 16:36:50 +02:00
Nardi Ivan
5b0374c28b Add detection of SurfShark VPN 2024-09-05 16:36:50 +02:00
Nardi Ivan
85ebda434d OpenVPN, Wireguard: improve sub-classification
Allow sub-classification of OpenVPN/Wireguard flows using their server IP.
That is useful to detect the specific VPN application/app used.
At the moment, the supported protocols are: Mullvad, NordVPN, ProtonVPN.

This feature is configurable.
2024-09-05 16:36:50 +02:00
Nardi Ivan
f350379e95 Add detection of NordVPN 2024-09-05 16:36:50 +02:00
Nardi Ivan
c713c894b6 OpenVPN: improve detection 2024-09-05 16:36:50 +02:00
Vladimir Gavrilov
81eaa3bd52
Add Lustre protocol detection support (#2544) 2024-09-04 10:22:04 +02:00
Toni
bf93f77f02
Align serialized risk names to all others (first letter; uppercase letter) (#2541)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2024-09-03 13:02:33 +02:00
Nardi Ivan
5d8edccef8 Bittorrent: improve detection of UTPv1 and avoid false positives 2024-09-03 12:39:07 +02:00
Nardi Ivan
91531ed040 Bittorrent: fix extra dissection
On extra-dissection data-path we only need to look for the hash (the
flow is already classified as Bittorrent).
As a nice side-effect, the confidence is now always with the right
value.
2024-09-03 12:39:07 +02:00
Vladimir Gavrilov
3189f19b0f
Fix CNP-IP false positives (#2531) 2024-08-30 13:31:34 +02:00
Vladimir Gavrilov
64a5dc3cb3
Add TRDP protocol support (#2528)
The Train Real Time Data Protocol (TRDP) is a UDP/TCP-based communication protocol designed for IP networks in trains, enabling data exchange between devices such as door controls and air conditioning systems. It is standardized by the IEC under IEC 61375-2-3 and is not related to the Remote Desktop Protocol (RDP).
2024-08-25 13:31:39 +02:00
Luca Deri
763a9c6474 Tests output update 2024-08-25 11:53:15 +02:00
wssxsxxsx
8894ebc76f
Add Automatic Tank Gauge protocol (#2527)
See also #2523

---------

Co-authored-by: Nardi Ivan <nardi.ivan@gmail.com>
2024-08-23 22:35:08 +02:00
Vladimir Gavrilov
a10c48c80a
Add CNP/IP protocol support (#2521)
ISO/IEC 14908-4 defines how to tunnel Control Network Protocol (CNP) over IP networks. It encapsulates protocols like EIA-709, EIA-600, and CNP, making it a versatile solution for building automation and control systems.
2024-08-22 15:26:32 +02:00
Nardi Ivan
5d33312be7 Sync unit tests results 2024-08-07 11:56:16 +02:00
Luca Deri
fc4fb4d409 Fixed probing attempt risk that was creating false positives 2024-08-07 11:38:41 +02:00
Ivan Nardi
2740a4f4e3
Update all IP lists (#2515)
The `suffix_id` is simply an incremental index (see
`ndpi_load_domain_suffixes`), so its value might changes every time we
update the public suffix list.
2024-08-02 15:06:08 +02:00
Luca Deri
f3ea8ca6be Improved ICMP malformed packet risk description 2024-07-25 12:54:59 +02:00
Ivan Nardi
85501c9aaa
FPC: add DPI information (#2514)
If the flow is classified (via DPI) after the first packet, we should
use this information as FPC
2024-07-23 08:50:27 +02:00
Vladimir Gavrilov
b15337a32b
Add OpenWire support (#2513) 2024-07-22 19:20:44 +02:00
Ivan Nardi
65e31b0ea3
FPC: small improvements (#2512)
Add printing of fpc_dns statistics and add a general cconfiguration option.
Rework the code to be more generic and ready to handle other logics.
2024-07-22 17:42:23 +02:00
mmanoj
67f5cdafc0
FPC: add DNS correlation (#2497)
Use DNS information to get a better First Packet Classification.

See: #2322

---------

Co-authored-by: Nardi Ivan <nardi.ivan@gmail.com>
2024-07-22 11:34:07 +02:00
Vladimir Gavrilov
6a77a891a8
Add Nano (XNO) protocol support (#2508) 2024-07-18 16:18:12 +02:00
Luca
86b67e6687 Added ClickHouse protocol 2024-07-17 14:21:45 +02:00
Vladimir Gavrilov
c3fff52646
Add HLS support (#2502) 2024-07-16 12:01:28 +02:00
Ivan Nardi
c3ba65311e
fuzzing: improve coverage (#2495)
Fix detection of WebDAV and Gnutella (over HTTP)
Fix detection of z3950

Add two fuzzers to test `ndpi_memmem()` and `ndpi_strnstr()`

Remove some dead code:
* RTP: the same exact check is performed at the very beginning of the
function
* MQTT: use a better helper to exclude the protocol
* Colletd: `ndpi_hostname_sni_set()` never fails

Update pl7m code (fix a Use-of-uninitialized-value error)
2024-07-12 14:22:25 +02:00
Ivan Nardi
456f0fd427
Improve detection of Cloudflare WARP traffic (#2491)
See: #2484
2024-07-04 08:59:04 +02:00
Ivan Nardi
843e487270
Add infrastructure for explicit support of Fist Packet Classification (#2488)
Let's start with some basic helpers and with FPC based on flow addresses.

See: #2322
2024-07-03 18:02:07 +02:00
Ivan Nardi
1e411e98fa
Reduce snaplen of some traces (#2490)
To avoid the following error with some old libpcap versions:
```
ERROR: could not open pcap file: invalid file capture length 524288, bigger than maximum of 262144
```
2024-07-03 16:17:08 +02:00
Ivan Nardi
fc334d56c4
tunnelbear: improve detection over wireguard (#2485)
See #2484
2024-07-01 08:20:18 +02:00
Ivan Nardi
4f05d21441
Improve detection of Twitter/X (#2482) 2024-07-01 08:20:04 +02:00
Ivan Nardi
26cc1f131f
fuzz: improve fuzzing coverage (#2474)
Remove some code never triggered

AFP: the removed check is included in the following one
MQTT: fix flags extraction
2024-06-17 13:45:47 +02:00
Nardi Ivan
a35fae6b75 Sync unit tests results 2024-06-17 11:23:39 +02:00
Toni
8fd649ab1e
Add Ripe Atlas probe protocol. (#2473)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2024-06-17 11:00:38 +02:00
Nardi Ivan
bbe52da5cf Zoom: harden RTP/RTCP detection 2024-06-17 10:19:55 +02:00
Nardi Ivan
526cf6f291 Zoom: remove "stun_zoom" LRU cache
Since 070a0908b we are able to detect P2P calls directly from the packet
content, without any correlation among flows
2024-06-17 10:19:55 +02:00