Commit graph

4028 commits

Author SHA1 Message Date
Ivan Nardi
8a3aa62f5f
USDT probes: add two new probes for detecting IP fragments (#3134) 2026-03-14 21:46:09 +01:00
Ivan Nardi
9db9a7f8b9
usdt probes: pass flow pointer to probes for flexible field access (#3133)
`flow_classified` gains a 5th argument (`arg4 = ndpi_flow_struct *`) so
scripts can access any flow field (risk, num_processed_pkts, etc.)
while still using the fast scalar args (arg0-arg3) in predicates.

`hostname_set` is redesigned from three scalars to two args: arg0 keeps
the hostname string for zero-friction str() access, arg1 is the flow
pointer replacing the two separate protocol IDs.

Documentation is updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 14:48:30 +01:00
Ivan Nardi
e637cdd108
Add USDT static tracing probes for zero-overhead runtime observability (#3130)
Add opt-in USDT (User-level Statically Defined Tracing) support via
--enable-usdt-probes. When enabled, probes compile to single NOP
instructions with zero runtime cost; external tools like bpftrace and
perf can attach dynamically without restarting the application.

Two probes are added:
- flow_classified: fires once per flow at classification finalization,
  exposing master/app protocol, confidence, and category
- hostname_set: fires when a hostname/SNI is extracted, exposing the
  hostname string and master/app protocol

Includes CI job that builds with USDT, verifies probes via readelf, and
runs live bpftrace tracing against ndpiReader on test pcaps.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:10:48 +01:00
Ivan Nardi
d4ea2be1b7
build: plugins: fix missing header dependencies causing stale rebuilds (#3132) 2026-03-08 20:08:56 +01:00
Ivan Nardi
8a13702094
HTTP: remove ndpi_check_http_header() (#3131)
The origin of this list is not clear: remove this check about
suspicious HTTP headers.
If someone is really interested into that or provides a better/updated
list, we can always revert this change
2026-03-08 19:58:25 +01:00
Ivan Nardi
b4103a7f80 HTTP: calculate the entropy according to the config (ndpi_struct->cfg.compute_entropy) 2026-03-04 18:27:58 +01:00
Ivan Nardi
f0ae9abd1e Increase buffer in log messages; try to avoid truncated messages 2026-03-04 18:27:58 +01:00
Ivan Nardi
30e699e349 TLS: remove superfluous code
The removed logic is already there in the generic code, in
`ndpi_search_tls_tcp()`
2026-03-04 18:27:58 +01:00
Ivan Nardi
b7db8cda8e Another attempt to better identify TCP retransmissions 2026-03-04 16:21:35 +01:00
Ivan Nardi
cce0a15c5c Minor fix to an SSDP header name 2026-03-04 16:21:35 +01:00
Ivan Nardi
df5e8b56b6 HTTP: fix NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK category via URL matching 2026-03-04 16:21:35 +01:00
Ivan Nardi
de0109ec30 Remove flow.direction_detection configuration option
Never used; its value has been lost in the mists of time...
2026-03-04 16:21:35 +01:00
Luca
bdcaaddf76 Reworked tlc blocks code and extended to ndpi fingerprint 2026-03-03 14:51:19 +01:00
Luca Deri
896ded6106 Fixed JA4 not matching QUIC flows
Minor TLS matching API change (simplified code)
2026-02-26 18:35:34 +01:00
Luca Deri
11807612e2
Extended ja4 protocol rule with the ability to specify tls blocks (#3125) 2026-02-20 23:15:02 +01:00
Luca Deri
7e30f1f1e8 Minor tls_blocks utility function changes 2026-02-17 22:12:09 +01:00
Ivan Nardi
afe8cf28ad
custom categories: more unit tests and minor changes to the API (#3123) 2026-02-17 15:14:02 +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
Ivan Nardi
1e159b8e50
Fix patricia tree stats (#3121) 2026-02-17 11:58:17 +01:00
Ivan Nardi
f6795625c6
Update list of domains (#3120) 2026-02-17 11:31:10 +01:00
Luca Deri
036ddcfd38 Added new API calls:
- char* ndpi_encode_tls_blocks(struct ndpi_tls_block *tls_blocks, u_int8_t num_tls_blocks);
- struct ndpi_tls_block* ndpi_decode_tls_blocks(u_char *encoded_blocks, u_int encoded_blocks_len, u_int8_t *num_tls_blocks);
2026-02-15 23:06:10 +01:00
Luca Deri
8ef80ca013 Fixed invalid domain 2026-02-15 10:30:53 +01:00
Luca Deri
863c2ee31f Fixes partial match when suffixed are loaded 2026-02-14 14:44:00 +01:00
Ivan Kapranov
ac4cc91cea
GitHub: (sub-)classification improvement (#3108)
Add specific protocol ids for Copilot, GitHub Actions and GitHub Packages.

There is some overlapping between the addresses in the Github list and in the Azure one.
Not sure about the best action here: add a (temporary?) workaround to avoid collisions.

Close #2976

---------

Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2026-02-08 21:08:02 +01:00
Ivan Nardi
6b4814401c
Fix domain encoding (in ndpi_encode_domain()) on big-endian systems (#3110)
Add loading of public suffix list on unit tests
2026-02-08 13:37:49 +01:00
Ivan Kapranov
766ec15036
Removed device-specific ssdp fields (#3109) 2026-02-05 14:13:01 +01:00
Ivan Nardi
6606b35c6e
NTP: add configuration for metadata extraction (#3107) 2026-02-04 09:00:30 +01:00
Ivan Kapranov
ea6d9a35c1
NTP metadata export (#2768) 2026-02-04 08:15:46 +01:00
Ivan Nardi
5c4b307e6a
TLS: fix blocks analysis (#3106)
Fix the case where there are multiple Handshake messages, in the same
record, after CH/SH/Certificate.

Completely disable it for DTLS (even for DTLS over TCP) because it never
worked: with DTLS we process only Handshake records.
2026-02-03 14:43:37 +01:00
Luca Deri
d42739176b Added ndpi_tls_blocks_len_compare() API call 2026-01-28 22:03:53 +01:00
Luca Deri
44a2463c54 Fix for TLS blocks lenght calculation 2026-01-27 00:49:03 +01:00
Ivan Nardi
a096a3ca87
TLS: fix dissection stop when block analysis is enabled (#3103)
Use the proper variable; remove the unused parameter
`skip_tls_blocks_until_change_cipher`.
2026-01-26 19:10:05 +01:00
Luca Deri
89151eb8e8 Fixed TLS blocks size/type handling 2026-01-26 16:20:33 +01:00
Ivan Nardi
349f4568a7
fuzz: make fuzzing of config parameters more generic (#3102)
That means that we need to somehow export the parameters list
2026-01-26 12:36:44 +01:00
Luca Deri
5e93917718 Further separator changes 2026-01-24 10:08:41 +01:00
Luca Deri
23d7910a30 Changed SlowDoS risk message: better formt 2026-01-23 21:03:19 +01:00
Luca Deri
f60079183a Fixed variable declaration 2026-01-23 20:55:00 +01:00
Luca
5f082e0e58 Raised number of DNS resposnes in metadata from 4 to 8 2026-01-21 16:02:06 +01:00
Luca Deri
ef248a5eb7 Fix custom protocol category/breed export 2026-01-20 21:09:20 +01:00
Ivan Nardi
d998113180
TLS: improve parsing of TLS (record) messages (#3096)
* on non-warning alert msg, stop dissection
* unify check of record layer header
* better separation about processing of different record messages
2026-01-20 16:27:33 +01:00
Ivan Nardi
c5a76cdff9 fuzz: update pl7m code (fix a Use-of-uninitialized-value error) 2026-01-19 20:33:57 +01:00
Ivan Nardi
009a85ef53
TLS: better handling of encrypted/cleartext alert messages (#3095) 2026-01-19 18:33:01 +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
Ivan Nardi
fd6c234356 Syncthing and RTSP can be "app"-type protocols 2026-01-19 12:49:54 +01:00
Luca Deri
4d61e0127b Improved nDPI fingerprint calculation 2026-01-18 23:54:37 +01:00
Luca Deri
b28bbd994a
Reworked nDPI fingerprint to avoid affecting JA4 in case of configuration nDPI options set (#3094) 2026-01-18 22:03:50 +01:00
Ivan Nardi
36b79954d9
Rename register_dissector() into ndpi_register_dissector() (#3093)
Try to avoid collisions with similar Wireshark function: see #3063.
Note that this function is now used by plugins, so it is somehow part
of the public API anyway.

Close #3063
2026-01-18 12:48:50 +01:00
Luca Deri
851703b8bb Exteded Slowloris detection to TLS/QUIC
DoS latency reported in sec (used to be ms)
2026-01-18 11:44:39 +01:00
Luca Deri
dc29d855d3 Added Slowloris detection via SLOW_DOS risk 2026-01-17 19:13:56 +01:00
Luca Deri
eae701516f Added check for slowDoS detection in case of packets out-of-order 2026-01-17 18:11:52 +01:00