Commit graph

1619 commits

Author SHA1 Message Date
Luca Deri
c28c0a5edc Updated test results 2025-10-18 00:43:18 +02:00
Luca Deri
f80aa7845d Updated results
Signed-off-by: Luca Deri <deri@ntop.org>
2025-10-18 00:03:54 +02:00
Luca Deri
d69446893d Added NDPI_MISMATCHING_PROTOCOL_WITH_IP flow risk
Fixed host protocol matching
Added NDPI_PROTOCOL_AKAMAI protocol
2025-10-17 23:48:44 +02:00
Ivan Nardi
9d22805954
Add statistics about hash data structures (#2995) 2025-10-17 20:39:15 +02:00
Luca Deri
cb9e63fc8c Improved Android classification 2025-10-16 15:44:06 +02:00
Toni
c67d8b63fa
Improved Telnet detection. Fixes #2936 (#2982)
* get rid of telnet stage's

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-10-07 16:01:17 +02:00
Ivan Nardi
a07d55005d
fuzz: try to improve fuzzing coverage (#2981) 2025-10-06 20:44:31 +02:00
Ivan Nardi
d06291d125
Add detection of ESPN traffic (#2980) 2025-10-05 21:03:53 +02:00
Ivan Nardi
ceb9a4e69c Workarounf for breed configuration with categories lists 2025-10-05 11:41:59 +02:00
Ivan Nardi
113170cca4
New protocols for Amazon/AWS sub-classification (#2975)
Add:
* Cognito
* API Gateway
* Kinesis
* EC2
* EMR
* S3
* Cloudfront
* DynamoDB

Keep `NDPI_PROTOCOL_AMAZON_AWS` for generic AWS traffic
2025-10-02 11:48:25 +02:00
Ivan Nardi
c9dfc946ff example: fix some proto ids in custom rules to ease unit test differences 2025-10-02 11:06:43 +02:00
Ivan Nardi
5aaab7f354
Fix ndpi_is_valid_hostname() (#2974)
It was completly broken.
Pay some attention to HTTP case where we might have Host header in the
"$DOMAIN:$PORT" form: we usually want to strip the port part

`memrchr` is not available on macOS and on Windows: create a wrapper
2025-09-29 12:27:21 +02:00
Ivan Nardi
a22083d100
WindowsUpdate: fix category and flow risk (over HTTP) (#2973) 2025-09-25 14:51:13 +02: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
Ivan Nardi
ddd277fc44
HTTP: add further configuration to enable/disable metadata extraction (#2972)
Rename existing configuration knobs, to better separate metadata from
requests, from metadata from responses
2025-09-23 15:11:25 +02:00
Ivan Nardi
05f9d96ec0 Sync unit tests results 2025-09-15 08:46:17 +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
043fe06c1b
Improved CryNetwork disector; detect "special" packets (#2965)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-09-15 08:33:29 +02:00
Luca Deri
43d9caac00 Modified protocol initialization so that built-in protocols can be overwritten via proto.txt files 2025-09-12 00:16:36 +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
906eab3863
Update every lists (#2962) 2025-09-09 17:18:47 +02:00
Ivan Nardi
8c81859467 Update "only_classification" configuration 2025-09-09 16:08:20 +02:00
Toni
1c1894720e
Update CryNetwork protocol dissector (#2959)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-09-08 09:43:11 +02:00
Ivan Nardi
8497b75394
SSDP: fix extraction of SNI (#2955)
Close #2953
2025-09-05 17:05:02 +02:00
Toni
1216ec6a27
Fixed risk typ0 (#2952)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-09-04 10:46:52 +02:00
Ivan Nardi
a2b9705fb9 An attempt to fix oss-fuzz introspector builds 2025-09-03 17:44:24 +02:00
Ivan Nardi
efccc7d5e4
Rework flow breed (#2926)
Right now, there is, in essence, a static mapping between flow protocols
and flow breeds.
Make it dynamic: allow to have different flows, with the same
classification but differents breeds. This is the same logic that we
already have for categories....

Preliminary work to support breed in category lists.

API change from the app POV: to get the flow breed don't use anymore
`ndpi_get_proto_breed()`, but access directly `struct ndpi_proto->breed`

The functions `ndpi_domain_classify_*()` and
`ndpi_get_host_domain_suffix()` now have a `u_int32_t` parameter as
`class_id` (instead of `u_int_16_t`), with the following logic:
```
class_id = (breed << 16) | category
```
instead of the old:
```
class_id = category
```
Please note that this change is back-compatible: if you are not
interested into breeds, you don't need to update the application code.
2025-09-02 16:54:34 +02:00
Ivan Nardi
c25c1be778 tests: add an example of custom rule with nDPI fingerprint 2025-08-31 19:10:05 +02:00
Ivan Nardi
f4995e5d5f Revert "Always compute nDPI fingerprint (#2950)"
This reverts commit 2531c2555e.
2025-08-31 19:07:13 +02:00
Ivan Nardi
2531c2555e
Always compute nDPI fingerprint (#2950) 2025-08-31 16:11:56 +02:00
Ivan Nardi
f293851eee
SSH: fix extraction of client identification string (#2949)
Close #2947
2025-08-31 11:53:31 +02:00
Ivan Nardi
1da8b85ee7
Fix compilation and unit tests (#2948)
```
ndpi_analyze.c: In function ‘ndpi_deserialize_ranking’:
ndpi_analyze.c:2244:3: warning: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2244 |   fread(&rank->header, sizeof(ndpi_ranking_header), 1, fd);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndpi_main.c: In function ‘ndpi_match_host_subprotocol’:
ndpi_main.c:11798:9: warning: ‘__builtin_strncpy’ output may be truncated copying between 0 and 63 bytes from a string of length 255 [-Wstringop-truncation]
11798 |         strncpy(str, string_to_match, ndpi_min(string_to_match_len, sizeof(str)-1));
      |         ^
ndpi_main.c:11811:7: warning: ‘__builtin_strncpy’ output may be truncated copying between 0 and 63 bytes from a string of length 255 [-Wstringop-truncation]
11811 |       strncpy(str, string_to_match, ndpi_min(string_to_match_len, sizeof(str)-1));

```
2025-08-30 21:05:40 +02:00
Luca Deri
0aca481a0a Tests update 2025-08-29 11:53:35 +02:00
Luca Deri
d403d900de
nDPI Fingerprint Changes (#2946)
* Modified boundary check
nDPI fingeprint now defaults on client only (it can be changed via runtime configuration)

* Undated testcases

* Added lenght check

* Typo
2025-08-21 14:58:20 +02:00
Luca Deri
7c53fcde85 Code cleanup
Added check in fingeprinting code
2025-08-21 12:30:40 +02:00
Luca Deri
11d74ea286 Implemented nDPI fingerprint that is computed using
- TCP fingerprint
- JA4 fingepriint
- TLS SHA1 certificate (if present), or JA3S fingerprint (is SHA1 is missing)

By default the fingerprint uses the client and server fingerprints (format 0)
and combines them. However you can chnge it format (eg. use only the client info,
format 1) with

--cfg NULL,metadata.ndpi_fingerprint_format,X

where X is the fingerprint format.

By default nDPI fingerprint is enabled but you can enable/disble it as follows

--cfg NULL,metadata.ndpi_fingerprint,0
2025-08-21 10:34:49 +02:00
Ivan Nardi
2279a011c8 Fix nBPF matches 2025-08-13 10:58:40 +02:00
Ivan Nardi
087c558202 Rework calling check_tcp_flags() and check_probing_attempt() 2025-08-13 10:58:40 +02:00
Ivan Nardi
29dde6c65d
Z39.50: avoid false positives (#2938)
Close #2540
2025-08-08 10:41:38 +02:00
Ivan Nardi
f25ffea432
HTTP: fix protocol stack for some proxy flows (#2935) 2025-08-07 16:44:43 +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
Ivan Nardi
c5c309708b Sync unit tests results 2025-08-06 20:07:40 +02:00
Ivan Nardi
aa78258425 Sync unit tests results 2025-08-05 20:06:04 +02:00
Ivan Nardi
b7cb6cf408
Follow-up of 8e1b17215: NDPI_UNRESOLVED_HOSTNAME (#2933)
Add fuzzing, documentation and unit tests
2025-08-05 11:32:29 +02:00
Ivan Nardi
8dd2220116
Add the concept of protocols stack: more than 2 protocols per flow (#2913)
The idea is to remove the limitation of only two protocols ("master" and
"app") in the flow classifcation.
This is quite handy expecially for STUN flows and, in general, for any
flows where there is some kind of transitionf from a cleartext protocol
to TLS: HTTP_PROXY -> TLS/Youtube; SMTP -> SMTPS (via STARTTLS msg).

In the vast majority of the cases, the protocol stack is simply
Master/Application.

Examples of real stacks (from the unit tests)  different from the standard
"master/app":
* "STUN.WhatsAppCall.SRTP": a WA call
* "STUN.DTLS.GoogleCall": a Meet call
* "Telegram.STUN.DTLS.TelegramVoip": a Telegram call
* "SMTP.SMTPS.Google": a SMTP connection to Google server started in
  cleartext and updated to TLS
* "HTTP.Google.ntop": a HTTP connection to a Google domain (match via
  "Host" header) and to a ntop server (match via "Server" header)

The logic to create the stack is still a bit coarse: we have a decade of
code try to push everything in only ywo protocols... Therefore, the
content of the stack is still **highly experimental** and might change
in the next future; do you have any suggestions?

It is quite likely that the legacy fields "master_protocol" and
"app_protocol" will be there for a long time.

Add some helper to use the stack:
```
ndpi_stack_get_upper_proto();
ndpi_stack_get_lower_proto();
bool ndpi_stack_contains(struct ndpi_proto_stack *s, u_int16_t proto_id);
bool ndpi_stack_is_tls_like(struct ndpi_proto_stack *s);
bool ndpi_stack_is_http_like(struct ndpi_proto_stack *s);

```

Be sure new stack logic is compatible with legacy code:
```
assert(ndpi_stack_get_upper_proto(&flow->detected_protocol.protocol_stack) ==
       ndpi_get_upper_proto(flow->detected_protocol));
assert(ndpi_stack_get_lower_proto(&flow->detected_protocol.protocol_stack) ==
       ndpi_get_lower_proto(flow->detected_protocol));
```
2025-08-01 10:05:50 +02:00
Ivan Nardi
79f0cbd32a
Whois/DAS: avoid false positives (#2925)
Close #2922
2025-07-30 20:11:07 +02:00
Ivan Nardi
44b9a2da81
ndpiReader: add breed to flow information (#2924) 2025-07-30 18:46:28 +02:00
Ivan Nardi
ade7c9fec7
Google, Signal: fix breed value (#2920)
Use the same breed value for both standard and content-matching
classification
2025-07-29 18:02:19 +02:00
Ivan Nardi
0a0b3f901b fuzz: without --with-only-libndpi we don't need to explicitly link to libpcap 2025-07-24 21:22:03 +02:00
Adam Korczynski
04cd23074f build tests in oss-fuzz
Signed-off-by: Adam Korczynski <adam@adalogics.com>
2025-07-24 21:22:03 +02:00