Commit graph

179 commits

Author SHA1 Message Date
Ivan Nardi
4421ae2cc9
Fix CI failures (#3327)
* Update WebattackRCE.pcap.out to the new "Known Proto on Non Std
  Port" risk description
* Windows: add missing MAX_NUM_TLS_MONITORED_BLOCKS define
* Mingw: avoid %zu in printf formats; with GCC 13 and mingw-w64 13
  headers (Ubuntu 26.04) it is rejected by -Wformat
* Python: switch from 3.9 (not available on Ubuntu 26.04) to 3.14
  and explicitly install setuptools
2026-11-13 17:38:19 +01:00
Ivan Nardi
0bcc7e82e6
PROFINET/IO: improve detection over DCERPC (#3322)
* Move PROFINET/IO detection into the DCERPC dissector: match the
  PROFINET/IO interface UUIDs (Device, Controller, Supervisor,
  ParameterServer) and the full object UUID prefix, and recognize the
  Endpoint Mapper lookups for PROFINET/IO interfaces. Remove the
  standalone PROFINET/IO dissector,
* After a generic EPM classification, look for PROFINET/IO calls in the
  next packets of the flow
* Add UDP 34964 as PROFINET/IO default port and don't trigger the
  `NDPI_KNOWN_PROTOCOL_ON_NON_STANDARD_PORT` flow risk for PROFINET/IO:
  responses and following calls use dynamic ports
* Fix the byte order check of the connectionless DCERPC fragment length
2026-11-10 17:07:30 +01:00
Toni
b17e3ae776
Add L2TP protocol dissector (#3301)
* dissect L2TP hostname

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2026-10-29 10:15:27 +01:00
Luca Deri
b22957735c Added Windows define 2026-10-27 18:43:43 +01:00
Ivan Nardi
d9aa834639
PowerShell: detect Active Directory Web Services and Task Scheduler traffic (#3300)
* Active Directory Web Services (ADWS, TCP/9389), used by the PowerShell
  ActiveDirectory module (Get-ADUser & co.): new dissector looking at the
  clear-text .NET Message Framing (MC-NMF) preamble sent by the client
* Task Scheduler (MS-TSCH, i.e. schtasks.exe, atexec): "atsvc" named pipe
  over SMB and ITaskSchedulerService/ATSvc/SASec interfaces in DCE/RPC BIND
  requests
2026-10-27 13:50:45 +01:00
Luca Deri
61337dad12
Reworked code to split flow definition in core and metadata 2026-09-05 15:48:02 +02:00
W.N.D.Damsana
717c9e33f9
Add Free Fire protocol (#3221)
Detect Garena Free Fire via UDP gameplay signatures, TCP control
markers, and Free Fire-specific hostnames.
2026-08-21 09:14:35 +02:00
Toni
252e2a5548
Add Nebula protocol dissector (#3210)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2026-07-28 12:50:58 +02:00
Toni
ff29e7579e
Add Meshtastic protocol dissector (TCP Client API) (#3208)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2026-07-25 10:46:30 +02:00
Toni
8e9fca8aed
Add Yggdrasil protocol dissector (#3207)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2026-07-25 09:28:11 +02:00
Chad Monroe
54e194a64f
Add NetMotion Mobility (IMP) protocol detection (#3195)
NetMotion Mobility (Mobility XE) tunnels clients to the Mobility
server using the Internet Mobility Protocol (IMP), by default over
UDP/5008. The payload is encrypted, but every datagram carries a
fixed header: a 0x4c magic, a self-inclusive length prefix, a
per-direction connection id plus sequence, and a per-direction
session token. Detection verifies these framing invariants are
constant within a direction and differ across directions, following
the same stateful approach as the Hamachi dissector.

Add NDPI_PROTOCOL_NETMOTION (VPN category) with the netmotion
dissector and its unit test. The remaining unit-test results are
regenerated because the new protocol id shifts the auto-numbered
custom-rule ids and adds one dissector call per UDP flow.

Signed-off-by: Chad Monroe <chad@monroe.io>
2026-07-14 16:33:06 +02:00
Bryan K.
04f6b2f2cc
Add new dissector for iris protocol (#3179)
Co-authored-by: bryan brauna <bryan.brauna@zerum.com>
Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2026-05-11 15:47:39 +02:00
Luca Deri
915ba442ee
Recoded some legaci nDPI code (#3170)
* Removed zattoo protocol

* Removed unused ndpi_bytestream_to_*** functions
Rewritten ndpi_handle_ipv6_extension_headers and ndpi_detection_get_l4_internal

* Uodared test results

* Recoded ndpi_init_packet()

* Cleaned up and recoded ndpi_parse_packet_line_info()

* Recoded and optimized dhcp and dhcp6 code

* Removed legacy code (zattoo) no longer used

* Fix fuzzing compilation and updtae unit tests results

* Zattoo: remove some leftovers

---------

Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2026-04-21 21:20:52 +02:00
Ivan Nardi
853d5931dc
Rework internal unit tests (#3149)
Put all the internal unit tests in a separate file.
The tests suite run (via `ndpiReader`):
* if the option `--run-tests` is used,
* always if the library is compiled with `-DNDPI_EXTENDED_SANITY_CHECKS`
  (useful in CI)

Extend tests using part of #3146.

We keep `tests/unit/unit.c` for serialization tests, like now, because
that is the only code that depends on the external library libjson-c
2026-04-16 13:32:07 +02:00
Ivan Nardi
bbbd117fe5
icecast: remove dissector; detection only over HTTP (#3155)
It seems nowadays icecast uses only TLS or HTTP.
Example of a pcap with the old protocol:
https://thecodeartist.blogspot.com/2013/02/shoutcast-internet-radio-protocol.html

See also: https://cast.readme.io/docs/icecast
2026-04-14 15:02:21 +02:00
Toni
9eb914d587
Add Simple Binary Encoding (SBE) protocol dissector (#3154)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2026-04-13 12:27:42 +02:00
Luca Deri
5ce0a0cd62
Added new API calls for implementing anomaly detection (#3137)
void* ndpi_alloc_iforest(const double *data, int n_samples, int n_features);
void ndpi_free_iforest(void *forest);
double ndpi_iforest_score_single(void *_forest, const double *sample);

ndpi_anomaly_model* ndpi_alloc_anomaly_model(u_int16_t n_features);
void ndpi_free_anomaly_model(ndpi_anomaly_model *m);
bool ndpi_train_anomaly_model(ndpi_anomaly_model *m, u_int32_t *training_data);
bool ndpi_compute_anomaly_score(ndpi_anomaly_model *m, u_int32_t *testing_data);
2026-03-22 16:53:17 +01:00
Ivan Nardi
15bac7a892
configure: remove --enable-tls-sigs option (#3119)
The same information is available via
`flow->protos.tls_quic.ja_client->signature_algorithm`
2026-02-17 15:00:09 +01:00
Chad Monroe
6755d3309a
ApplePush: rework detection (#3075)
Current ApplePush dissector only look for IP match and doesn't allow
full metadata extraction (see #3074).
Since all ApplePush flows are TLS ones, let TLS dissector do its job and
handle IP match as usual; with this change, the dissector itself is
useless: remove it.

Close #3074

Signed-off-by: Chad Monroe <chad@monroe.io>
Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2026-01-19 18:32:19 +01:00
Luca Deri
45e3213d7f
Reworked TLS dissector to export further metadata (#3066)
* Reworked TLS dissector to give users the ability to )optionnaly)
collect and export TLS metadata via "--cfg=tls,metadata.ja_data,1"
2025-12-20 17:33:09 +01:00
Toni Uhlig
285496d0b9 Add (generic) MsgPack protocol dissector.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-12-08 17:50:20 +01:00
Toni
aa3241e17b
Add (generic) JSON protocol dissector. (#2492)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-12-06 20:15:19 +01:00
Luca Deri
3f2f1f8ce4
Added ability to define protocol dissectors in shared libraries (#3047)
* Added ability to define protocol dissectors in shred libraries and load them at runtime

---------

Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2025-12-04 15:26:15 +01:00
Ivan Nardi
b93c2a8dbc
Fix some warnings when compiling with -pedantic (#3040) 2025-11-24 19:47:11 +01:00
Luca Deri
5c327aafa0
Added nDPI Configuration Export (#3022)
* In order to reduce ndpi_main.c file size:
- Removed nDPI configuration code from ndpi_main.c and placed into ndpi_config.c
- Moved some utils functions from ndpi_main.c to ndpi_utils.c

* Added
- ndpi_dump_host_based_protocol_id()
- ndpi_dump_host_based_category_id()

to enable users to dump protocolId and categoryId of host-based protocols

ndpiReader
- Added
--protos-dump <mode>       | Dump host-based protocolId (mode=1) and categoryId (mode=2)
2025-11-09 19:39:47 +01:00
kalinda
e1c0d8ba64
Add Matter protocol dissector (#2957)
Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2025-09-23 15:20:48 +02:00
Toni
6f05ddbcc4
Add Samsung SDP protocol dissector (#2966)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-09-15 08:40:17 +02:00
Toni
6eb9249f01
Add TriStation dissector (#2964)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-09-11 16:20:55 +02:00
Ivan Nardi
30cd98f978
croaring: update to 4.3.6 (from 3.0.0) (#2934)
Old compilers (example: gcc < 7, mingw or VS older than 2022) don't
work with latest croaring versions; note that we had this issue even
before this change...

We somehow try to autodect if we can use latest version (TODO: we can do
better!): otherwise we fallback to legacy code.
The user can force that via `--enable-old-croaring` option: that's the
option to use if you get any errors on `roaring.c` filw while compiling.

Remove `-AC_COMPILE_IFELSE` check which does nothing and provides
misleading output!

On CI, we always use legacy version on Windows (if we use VisualStudio)
and with Mingw compiler.

Please, note that before the recent code adding
`NDPI_UNRESOLVED_HOSTNAME` support, the croaring code, even if present
in the repository, was NEVER used!!
2025-09-02 15:50:03 +02:00
Toni
470d0d6323
Add Mudfish protocol dissector (#2932)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-08-06 21:07:27 +02:00
Toni
a913e914e5
Added EasyWeather protocol dissector (#2912)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-07-03 12:28:48 +02:00
Ivan Nardi
57d529f74f
No limits on the number of (custom) protocols (#2875)
The hard limit of total number of protocols (internal and custom) is ~65535,
because protocol ids are `u_int16_t`...

API changes:
1. From `NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS` to
`ndpi_get_num_protocols()` (after having called
`ndpi_finalize_initialization()`);

2. From `proto_id >= NDPI_MAX_SUPPORTED_PROTOCOLS` to
`ndpi_is_custom_protocol(proto_id)` (after having called
`ndpi_finalize_initialization()`);

Close #2136
Close #2545
2025-06-16 14:04:56 +02:00
Vladimir Gavrilov
aba60ac354
Add GLBP dissector (#2879)
GLBP is a Cisco proprietary first-hop redundancy protocol similar to HSRP and VRRP, but with additional load balancing capabilities.
2025-06-10 15:26:10 +02:00
Ivan Nardi
cbd7136b34
Remove NDPI_PROTOCOL_BITMASK; add a new generic bitmask data structure (#2871)
The main difference is that the memory is allocated at runtime

Typical usercase:
```
struct ndpi_bitmask b;

ndpi_bitmask_alloc(&b, ndpi_get_num_internal_protocols());

ndpi_bitmask_set(&b, $BIT);
ndpi_bitmask_is_set(&b, $BIT);
[...]

ndpi_bitmask_dealloc(&b);

```

See #2136
2025-06-09 09:00:17 +02:00
Ivan Nardi
70a72f1638
New API to enable/disable protocols; remove ndpi_set_protocol_detection_bitmask2() (#2853)
The main goal is not to have the bitmask depending on the total number
of protocols anymore: `NDPI_INTERNAL_PROTOCOL_BITMASK` depends only on
internal protocols, i.e. on `NDPI_MAX_INTERNAL_PROTOCOLS`, i.e.
custom-defined protocols are not counted.
See #2136

Keep the old data structure `NDPI_PROTOCOL_BITMASK` with the old
semantic.

Since we need to change the API (and all the application code...)
anyway, simplify the API: by default all the protocols are enabled.
If you need otherwise, please use `ndpi_init_detection_module_ext()`
instead of `ndpi_init_detection_module()` (you can find an example in
the `ndpiReader` code).

To update the application code you likely only need to remove these 3
lines from your code:
```
- NDPI_PROTOCOL_BITMASK all;
- NDPI_BITMASK_SET_ALL(all);
- ndpi_set_protocol_detection_bitmask2(ndpi_str, &all);
```

Removed an unused field and struct definition.
2025-06-03 09:45:46 +02:00
Vladimir Gavrilov
40fe26b2f1
Add Hamachi protocol detection support (#2860) 2025-06-02 14:00:31 +02:00
Ivan Nardi
0b641a62d9 Fix compilation on Windows 2025-05-26 20:27:11 +02:00
Ivan Nardi
78f4b60efe
A new interface for dissectors registration (#2843)
We use `registr_dissector()` instead of
`ndpi_set_bitmask_protocol_detection()`.

Every file in `src/lib/protocols/*.c` is a dissector.

Every dissector can handle multiple protocols.

The real goal is this small change:
```
 struct call_function_struct {
-  NDPI_PROTOCOL_BITMASK detection_bitmask;
```
i.e. getting rid of another protocol bitmask: this is mandatory to try
to fix #2136 (see also e845e8205b68752c997d05224d8b2fd45acde714)

As a nice side effect, we remove a bitmask comparison in the hot function
`check_ndpi_detection_func()`

TODO: change logging configuration from per-protocol to per-dissector
2025-05-24 13:17:46 +02:00
Vladimir Gavrilov
74cb03eb4c
Add MELSEC protocol support (#2846) 2025-05-23 11:13:52 +02:00
Vladimir Gavrilov
0a3c8f2464
Drop GW1 support and add basic GW2 detection (#2836) 2025-05-21 11:45:31 +02:00
Ivan Nardi
fd89c81b83
Flow: keep track of "dissectors" (#2828)
In the flow, we should keep track of state of "dissectors", not
"protocols". This way, flow structure doesn't depend anymore on
the max number of protocols.
This is also the first step into fixing #2136
2025-05-19 21:18:18 +02:00
Vladimir Gavrilov
31a8d4307e
Drop Warcraft 3 (pre Reforged) support (#2826) 2025-05-19 13:28:19 +02:00
Ivan Nardi
e7a0bef811
TLS: register TLS dissector only once (#2825)
This is the first, tiny, step into a better separation between
"protocols" and "dissectors"
2025-05-19 11:41:09 +02:00
0xA50C1A1
edcf3579f2 Remove Half-Life 2 support; improve Source Engine protocol detection 2025-05-16 21:58:48 +02:00
0xA50C1A1
af4af11afc Rename Lotus Notes to HCL Notes for product consistency 2025-05-15 21:43:34 +02:00
Vladimir Gavrilov
5e5758ad7c
Remove Vhua support (#2816) 2025-05-15 19:40:44 +02:00
Vladimir Gavrilov
5e2912770b
Remove World Of Kung Fu support (#2815) 2025-05-15 12:03:16 +02:00
Vladimir Gavrilov
6312e4c9aa
Add Microsoft Delivery Optimization protocol (#2799) 2025-04-28 13:40:21 +02:00
Ivan Nardi
092a6e10d0 WoW: update detection
Remove the specific dissector and use the Blizzard's generic one.
For the time being, keep `NDPI_PROTOCOL_WORLDOFWARCRAFT`
2025-03-30 20:22:09 +02:00
Ivan Nardi
56ac5bf48b
Rework the old Starcraft code to identify traffic from generic Blizzard games (#2776)
Remove `NDPI_PROTOCOL_STARCRAFT` and add a generic `NDPI_PROTOCOL_BLIZZARD`.
2025-03-25 17:16:10 +01:00