Commit graph

116 commits

Author SHA1 Message Date
netcons
eda68ccc93
Ambiguous data in GitHub domain lists (#3293)
GitHub downloaded lists are converted by ipaddr2list.py, which strips leading "*."
If "*.domain" and "domain" exists in these lists.
It causes "domain" to exist in multiple converted lists.
2026-10-23 13:21:59 +02:00
Ivan Nardi
c8443f9747 Temporary workaround since mining list is no more directly available 2026-09-15 08:51:14 +02:00
Luca Deri
d7c97ba097 Improved dual-license wording 2026-08-25 16:58:08 +02:00
Ivan Nardi
1f2606902c
License: non-commercial vs commercial applications (#3220)
* WIP

* Fix compilation of fuzzing

* Fix fuzzing compilation

* Cleaned up old quic contributed code (#3222)

Recode commits 713cdd0, 26df140

* QUIC: refactoring

* WIP

* WIP

* Revert "QUIC: refactoring"

This reverts commit 50afd07f28.

* QUIC: refactoring original Wireshark code (#3224)

* Added ability to specify in protocol definition, when a (partial) protocol
can change. This can be queries using a new APi call
named ndpi_can_partial_proto_classification_change()

* TLS: minor changes and remove same stale comments

* Fix out-of-bounds read of TLS certificate dates (#3225)

notBefore and notAfter are u_int32_t, but ndpi_tls2json() passed their
address to ndpi_gmtime_r() as a time_t *. Wherever time_t is 8 bytes this
reads 4 bytes past the field, picking up the adjacent member, so the value
handed to gmtime_r() is notBefore | (notAfter << 32) on little-endian.

gmtime_r() then fails on that out-of-range value and returns NULL, leaving
before/after NULL, so the "notbefore" and "notafter" fields are silently
dropped from the JSON output. On architectures that require aligned access
the 8-byte load traps instead of merely being wrong.

Convert to a real time_t instead of casting the address. The temporaries
are named not_before/not_after because notBefore/notAfter are already
char[32] buffers in the same function.

* WIP

* fuzz: fix compilation

---------

Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
Co-authored-by: Luca Deri <deri@ntop.org>
Co-authored-by: shalseth <33956011+shalseth@users.noreply.github.com>
2026-08-22 17:57:28 +02:00
Ivan Kapranov
54c3192279
fix urls for downloading google crawlers (#3191) 2026-07-07 19:17:21 +02:00
Ivan Nardi
70b7d941cf
build: improve cross-compilation support and tests (#3185)
Cross-compilation: add s390x script, fix libtool cross-tools warning

- utils/cross-compile-test-s390x.sh: new script mirroring the aarch64
  one but targeting IBM s390x; full mode installs s390x multiarch libs,
  builds examples+tests and runs the full test suite via QEMU binfmt_misc.
- utils/cross-compile-test.sh (aarch64): add pkgconf to COMMON_PKGS,
  remove stale src/include/ndpi_config.h before VPATH build,
  add full binfmt_misc test-suite section matching the s390x script.
- .github/workflows/build_crosscompilation.yml: add s390x CI job alongside
  the existing aarch64 job; both use the respective scripts in full mode.
- configure.ac: pre-set FILECMD and MANIFEST_TOOL via AC_PATH_PROG before
  LT_INIT so libtool's AC_CHECK_TOOL finds them already resolved and does
  not search for ${host}-file / ${host}-mt, eliminating the spurious
  "using cross tools not prefixed with host triplet" autoconf warning.
- cross-compilation scripts: add --tests mode, keep ndpiReader -H in --full

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 21:22:54 +02:00
Ivan Nardi
6dcb262236
configure: fix cross-compilation best practices (#3183)
- Move Darwin clang/clang++ preference (`: ${CC:=clang}`) before
  AC_PROG_CC so the hint actually takes effect; previously it ran after
  CC was already chosen.
- Remove global AC_LANG_WERROR; it caused false-negative feature checks
  with strict cross-compilers.
- Add cross-compilation warning block (fires when build != host) that
  alerts the user when PKG_CONFIG_SYSROOT_DIR / PKG_CONFIG_LIBDIR are
  unset and when build-host paths (Homebrew, DPDK, PCAP_HOME+PF_RING)
  may not apply to the target.
- Guard Homebrew include/lib injection with `test "$cross_compiling" != yes`
  so it is skipped when cross-compiling from a macOS host.
- Make pfring_config execution conditional on the binary being present
  and executable (guards against absent or target-arch binary).
- Save and restore PKG_CONFIG_PATH around the custom libpcap pkg-config
  lookup to prevent it leaking into subsequent checks; also quote
  $PKG_CONFIG in the shell interpolation.
- Quote previously unquoted variables in test expressions: $OS_TYPE,
  $HOMEBREW_DIR, $HOME/DPDK, $PCAP_HOME.
- Replace BSD-only `date -r FILE` with `stat -c`/`stat -f` fallback
  chain that works on both GNU/Linux and macOS.
- Move AC_CANONICAL_HOST before PKG_PROG_PKG_CONFIG so the source-level
ordering matches the required expansion order (PKG_PROG_PKG_CONFIG uses
AC_PATH_TOOL which requires AC_CANONICAL_HOST).
- Remove AC_PROG_CPP_WERROR: it makes all AC_CHECK_HEADERS calls use
-Werror on the preprocessor, which can produce false negatives when
cross-compiling with a stricter cross-compiler. Same rationale as the
earlier removal of AC_LANG_WERROR.

Also add utils/cross-compile-test.sh: a self-contained script that
exercises the cross-compilation path on Ubuntu x86-64 targeting
AArch64 (aarch64-linux-gnu).  Supports a fast --library-only mode and
a --full mode that installs arm64 multiarch dev libraries, configures
with PKG_CONFIG_SYSROOT_DIR, builds examples and unit tests, and runs
ndpiReader -H under QEMU user-mode emulation to verify the resulting
binary executes correctly on the build host.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 10:22:06 +02:00
Ivan Nardi
24d88cf784
CI: rework jobs (#3180) 2026-05-11 18:11:33 +02:00
Ivan Nardi
307643d4ee
Remove Whatsapp IPs list: Meta doesn't provide it anymore (#3153) 2026-04-16 13:32:27 +02:00
Ivan Nardi
c89fe74812
utils: follow redirect when using curl (#3117) 2026-02-17 09:59:35 +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
Luca Deri
37ca034697 (C) update 2026-01-01 10:31:40 +01:00
Luca Deri
8aaff75ede
Fixes protocol inconsistencies (#3069)
* Added code to address inconsistencies
* Added check for discarding dig errors
* Temporarily disabled whatsapp script: an update is required. See https://developers.facebook.com/docs/whatsapp/on-premises/sunset
2025-12-31 20:54:35 +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
b2357c29c3
Build system: Standardize and improve clean/distclean targets (#3039)
This commit improves the nDPI build system by standardizing cleanup
targets, improving portability, and ensuring complete removal of
generated files during `make distclean`.

Changes:

1. Standardize clean targets (replace /bin/rm with portable $(RM))

2. Add distclean-local targets for complete cleanup

3. Add missing clean/distclean targets

4. Remove obsolete commented-out curl detection code

5. fuzz/Makefile.am: Fix out-of-tree build compatibility by replacing hardcoded
   relative paths (../example/fuzz_*.o) with proper $(top_builddir) variables.
   Add distclean-local target.
2025-11-24 18:42:03 +01:00
Ivan Nardi
19ee4f6c33
Build system: minor fixes about flag compilation and example dependencies (#3038)
- always use `-Wextra` compilation flag; it was already used in CI
- always compile `ndpiSimpleIntegration` when building examples
- don't mess with optimization flags: `CFLAGS` default value is "-g -O2"
  and the user can change it

Try to test -O1,2,3,s flags in CI.

Fix some warnings.
2025-11-21 15:51:29 +01:00
Ivan Nardi
e22a434709
Rework API to set custom memory allocator functions (#3023)
Full accounting of memory used by the library.

Change `ndpi_realloc()` prototype to be compatible with standard
`realloc()`.
Be compatible with croaring allocation logic.

Note that aligned allocations are used only by croaring code.
Note that flow allocations are used only by the application, not by the
library.

API changes:
* remove `set_ndpi_malloc()` and `set_ndpi_free()`; use
  `ndpi_set_memory_alloction_functions()` instead
2025-11-09 13:11:55 +01:00
Ivan Nardi
6ab338928c
Add support for out-of-tree builds (#2993)
Initial work to support out-of-tree builds
```
./autogen.sh
mkdir build
cd build
../configure
make
make check
```
IMPORTANT: `autogen.sh` doesn't call `configure` automatically anymore!!

You have to do: `./autogen.sh && ./configure --$OPTIONS`.
A little bit annoying but the pattern `autogen && configure && make` is
very common on Linux.

Known issues:
* `make doc` doesn't work in out-of-tree builds, yet
* Windows/MinGW/DPDK (out-of-tree) builds have not been tested, so it is unlikely they work

See: #2992
2025-11-03 11:58:59 +01:00
Luca Deri
6001c9f34c Akamai IP address download 2025-10-18 12:25:16 +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
17879f40dc
Automatically update the ip list of ChatGPT bots (#2977) 2025-10-02 20:18:09 +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
Luca Deri
3358fb5516 Code cleanup 2025-09-27 23:01:54 +02:00
Luca Deri
d20f4bb1c0 Added utility to print content of rank files 2025-09-12 11:27:53 +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
Ivan Nardi
1dd6d4c30c
MS domain lists: avoid duplicates (#2928)
Update all MS domains lists.

Close #2927
2025-08-02 19:11:40 +02:00
Luca Deri
16f332eb41 Added simple tool hosts2domains used to extract domain names from hostnames written on a text file
(one host per line)
2025-07-21 19:02:25 +02:00
JH
ebb47c9a84
Add auto-updating cryptocurrency mining pool lists (#2891)
Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2025-07-01 20:27:22 +02:00
Luca Deri
38cc4ac22b Added IMO and Badoo files 2025-06-06 16:48:41 +02:00
Ivan Nardi
f0eb0ed1d8 Update url to download malicious sites 2025-06-05 14:26:25 +02:00
0xA50C1A1
b49b7eb45f Rename NDPI_PROTOCOL_UBUNTUONE protocol ID to NDPI_PROTOCOL_CANONICAL 2025-05-15 21:43:34 +02:00
Toni
470a479eb2
Remove ProtonVPN IP address fetch (#2811)
* not available w/o an API token anymore

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2025-05-12 13:28:51 +02:00
Luca Deri
8d45dfaf73 Update Threema and VK ASN lists 2025-05-06 14:48:10 +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
Ivan Nardi
e2ed61524b
Avoid duplicated Microsoft domains (#2770)
Update the list

Close #2767
2025-03-18 11:56:50 +01:00
Ivan Nardi
678d284a25
TOR: fix ip lists (#2748)
One list is from ingress nodes (used for protocol classification) and
the second one is from exit nodes (used for flow risk check)
2025-02-27 10:55:54 +01:00
Luca Deri
050ea7e229 Improved Tor exit node download and added IPv6 support 2025-02-24 19:57:46 +01:00
Luca Deri
501ff5841d Added additional VK ASNs 2025-02-05 15:27:59 +01:00
Ivan Nardi
62d64afde7
Auto-generate Microsoft-related list of domains (#2688) 2025-01-31 15:44:28 +01:00
Fábio Depin
aacade6d95
Force English content in whatsapp_ip_addresses_download.sh (#2701)
Add the Accept-Language header in the cURL command to ensure the fetched page is in English, improving consistency and clarity in the script output.
2025-01-30 11:09:24 +01:00
Ivan Nardi
f3532f0bad
Unify "Skype" and "Teams" ids (#2687)
* Rename `NDPI_PROTOCOL_SKYPE_TEAMS_CALL` ->
  `NDPI_PROTOCOL_MSTEAMS_CALL`

* Rename ip list from "Skype/Teams" to "Teams"
2025-01-20 18:06:56 +01:00
Luca Deri
511228d36d Added DigitalOcean protocol 2025-01-17 18:26:27 +01:00
Ivan Nardi
6f82e485dc
Update script to download Azure IP list ranges (#2640) 2024-12-11 13:59:31 +01:00
Luca Deri
1c4ae434ab Improved statistics 2024-10-16 23:55:21 +02:00
Luca Deri
97ce729392 Parser for ndpiReader JSON files 2024-10-15 22:25:02 +02:00
Nardi Ivan
5b0374c28b Add detection of SurfShark VPN 2024-09-05 16:36:50 +02:00
Nardi Ivan
f350379e95 Add detection of NordVPN 2024-09-05 16:36:50 +02:00
Ivan Nardi
7558bcd39f
Fix url for downloading X/Twitter crawler IPs (#2526) 2024-08-22 15:35:33 +02:00
Petr
2a3f4dc8b4
Performed some grammar and typo fixes (#2511) 2024-07-19 11:22:35 +02:00
Petr
be0b2c2d90
ipaddr2list.py, ndpi2timeline.py: reformatted (#2509) 2024-07-18 20:35:47 +02:00