Commit graph

1936 commits

Author SHA1 Message Date
Zied Aouini
66350ec0bf
bump version 2026-02-16 00:47:15 +01:00
Zied Aouini
89f4029221
fix version publishing 2026-02-16 00:42:24 +01:00
Zied Aouini
b503c0314e
Update README.md 2026-02-15 22:52:05 +01:00
Zied Aouini
5f5ce282fd
Update README 2026-02-15 22:51:01 +01:00
Adrian Pekar
0b619eb72a Update README client_fingerprint example to JA4 format 2026-02-15 22:40:03 +01:00
Adrian Pekar
3e73168543 Add libmingw32.a to Windows link args for nDPI 5.0 math functions 2026-02-15 21:54:14 +01:00
Adrian Pekar
ca5a660337 Disable nDPI global context support on Windows build 2026-02-15 21:28:19 +01:00
Adrian Pekar
68dfdb6120
Upgrade nDPI from 4.7.0 to 5.0 with Windows libpcap fix (#235)
* Upgrade nDPI from 4.7.0 to 5.0 with Windows build fix (#230)


- Upgrade nDPI submodule from 4.7.0 to 5.0
- Fix all 9 nDPI 5.0 API breaking changes:
  * Protocol structure: .app_protocol -> .proto.app_protocol
  * Protocol structure: .master_protocol -> .proto.master_protocol
  * ndpi_protocol2name() signature change
  * ndpi_detection_giveup() signature change (removed enable_guess/guessed params)
  * ndpi_extra_dissection_possible() replaced with state check
  * ndpi_init_detection_module() now expects NULL
  * Protocol bitmask removed (all protocols enabled by default)
  * TCP/UDP struct size checks removed
  * Fingerprint extraction: ja3_client -> ja4_client

- Maintain backward compatibility by keeping field names:
  * client_fingerprint: Now JA4 (TLS), HASSH client (SSH), DHCP fingerprint
  * server_fingerprint: Now JA3S (TLS), HASSH server (SSH)

- Update build system for nDPI 5.0:
  * Add --with-only-libndpi flag to build.sh
  * Make CFFI marker extraction optional in engine_build.py

- Update tests for nDPI 5.0:
  * Update fingerprint assertions (JA3 MD5 -> JA4 format)
  * Regenerate all 228 baseline test results
  * Remove invalid test file (memcached.cap)

- All 29 tests passing

* Fix memcpy buffer overreads and enable DNS subclassification

- Fix buffer overread in fingerprint memcpy calls by using source size
  instead of destination size:
  - HASSH client/server: 33 bytes (was reading 48)
  - JA4 client: 37 bytes (was reading 48)
  - JA3 server: 33 bytes (was reading 48)
  - DHCP: 48 bytes (consistent with others)

- Enable DNS subclassification (disabled by default in nDPI 5.0)
  to restore detection of DNS.Apple, DNS.Google, etc.

- Regenerate test baselines with fixes applied

* Replace outdated Steam test pcaps with nDPI 5.0 version

- Remove steam.pcap and steam_datagram_relay_ping.pcapng (obsolete)
- Add steam.pcapng from nDPI 5.0 test suite
- nDPI 5.0 reworked Steam detection (ntop/nDPI#2264)

* Fix Windows build: add missing configure step for nDPI 5.0

The Windows build script was missing the ./configure --with-only-libndpi
step before make, causing nDPI headers to not be properly installed.
This resulted in the CFFI preprocessing marker //CFFI.NDPI_PACKED_STRUCTURES
being absent from ndpi_cdefinitions_packed.h, crashing engine_build.py.

Aligns build_windows.sh with build.sh which already had this step.

* Fix Windows build: install libpcap-dev for nDPI 5.0 configure

nDPI 5.0 configure requires libpcap when --with-only-libndpi is used
on MinGW (see ntop/nDPI#3114). Install mingw-w64-x86_64-libpcap via
pacman to satisfy this dependency.
2026-02-15 20:30:16 +01:00
Zied Aouini
3cb5f6cac8
Revert "Upgrade nDPI from 4.7.0 to 5.0 with Windows build fix (#230)" (#234)
This reverts commit b1b2ee87e2.
2026-02-14 21:34:30 +01:00
Adrian Pekar
b1b2ee87e2
Upgrade nDPI from 4.7.0 to 5.0 with Windows build fix (#230)
* Upgrade nDPI from 4.7.0 to 5.0 with backward compatibility

- Upgrade nDPI submodule from 4.7.0 to 5.0
- Fix all 9 nDPI 5.0 API breaking changes:
  * Protocol structure: .app_protocol -> .proto.app_protocol
  * Protocol structure: .master_protocol -> .proto.master_protocol
  * ndpi_protocol2name() signature change
  * ndpi_detection_giveup() signature change (removed enable_guess/guessed params)
  * ndpi_extra_dissection_possible() replaced with state check
  * ndpi_init_detection_module() now expects NULL
  * Protocol bitmask removed (all protocols enabled by default)
  * TCP/UDP struct size checks removed
  * Fingerprint extraction: ja3_client -> ja4_client

- Maintain backward compatibility by keeping field names:
  * client_fingerprint: Now JA4 (TLS), HASSH client (SSH), DHCP fingerprint
  * server_fingerprint: Now JA3S (TLS), HASSH server (SSH)

- Update build system for nDPI 5.0:
  * Add --with-only-libndpi flag to build.sh
  * Make CFFI marker extraction optional in engine_build.py

- Update tests for nDPI 5.0:
  * Update fingerprint assertions (JA3 MD5 -> JA4 format)
  * Regenerate all 228 baseline test results
  * Remove invalid test file (memcached.cap)

- All 29 tests passing

* Fix memcpy buffer overreads and enable DNS subclassification

- Fix buffer overread in fingerprint memcpy calls by using source size
  instead of destination size:
  - HASSH client/server: 33 bytes (was reading 48)
  - JA4 client: 37 bytes (was reading 48)
  - JA3 server: 33 bytes (was reading 48)
  - DHCP: 48 bytes (consistent with others)

- Enable DNS subclassification (disabled by default in nDPI 5.0)
  to restore detection of DNS.Apple, DNS.Google, etc.

- Regenerate test baselines with fixes applied

* Replace outdated Steam test pcaps with nDPI 5.0 version

- Remove steam.pcap and steam_datagram_relay_ping.pcapng (obsolete)
- Add steam.pcapng from nDPI 5.0 test suite
- nDPI 5.0 reworked Steam detection (ntop/nDPI#2264)

* Fix Windows build: add missing configure step for nDPI 5.0

The Windows build script was missing the ./configure --with-only-libndpi
step before make, causing nDPI headers to not be properly installed.
This resulted in the CFFI preprocessing marker //CFFI.NDPI_PACKED_STRUCTURES
being absent from ndpi_cdefinitions_packed.h, crashing engine_build.py.

Aligns build_windows.sh with build.sh which already had this step.
2026-02-14 17:48:00 +01:00
Adrian Pekar
85ab78ee40
Fix PyPy segfault caused by pandas 3.0 incompatibility (#232)
pandas 3.0.0 (released Jan 21, 2026) segfaults on import when running
under PyPy. Cap pandas to <3 for PyPy installations while allowing
any version for CPython using environment markers.
2026-02-14 17:46:30 +01:00
Zied Aouini
8a13708698
Revert "Upgrade nDPI from 4.7.0 to 5.0 (#220)" (#228)
This reverts commit 22cd213550.
2026-02-13 22:16:13 +01:00
Adrian Pekar
22cd213550
Upgrade nDPI from 4.7.0 to 5.0 (#220)
* Upgrade nDPI from 4.7.0 to 5.0 with backward compatibility

- Upgrade nDPI submodule from 4.7.0 to 5.0
- Fix all 9 nDPI 5.0 API breaking changes:
  * Protocol structure: .app_protocol -> .proto.app_protocol
  * Protocol structure: .master_protocol -> .proto.master_protocol
  * ndpi_protocol2name() signature change
  * ndpi_detection_giveup() signature change (removed enable_guess/guessed params)
  * ndpi_extra_dissection_possible() replaced with state check
  * ndpi_init_detection_module() now expects NULL
  * Protocol bitmask removed (all protocols enabled by default)
  * TCP/UDP struct size checks removed
  * Fingerprint extraction: ja3_client -> ja4_client

- Maintain backward compatibility by keeping field names:
  * client_fingerprint: Now JA4 (TLS), HASSH client (SSH), DHCP fingerprint
  * server_fingerprint: Now JA3S (TLS), HASSH server (SSH)

- Update build system for nDPI 5.0:
  * Add --with-only-libndpi flag to build.sh
  * Make CFFI marker extraction optional in engine_build.py

- Update tests for nDPI 5.0:
  * Update fingerprint assertions (JA3 MD5 -> JA4 format)
  * Regenerate all 228 baseline test results
  * Remove invalid test file (memcached.cap)

- All 29 tests passing

* Fix memcpy buffer overreads and enable DNS subclassification

- Fix buffer overread in fingerprint memcpy calls by using source size
  instead of destination size:
  - HASSH client/server: 33 bytes (was reading 48)
  - JA4 client: 37 bytes (was reading 48)
  - JA3 server: 33 bytes (was reading 48)
  - DHCP: 48 bytes (consistent with others)

- Enable DNS subclassification (disabled by default in nDPI 5.0)
  to restore detection of DNS.Apple, DNS.Google, etc.

- Regenerate test baselines with fixes applied

* Replace outdated Steam test pcaps with nDPI 5.0 version

- Remove steam.pcap and steam_datagram_relay_ping.pcapng (obsolete)
- Add steam.pcapng from nDPI 5.0 test suite
- nDPI 5.0 reworked Steam detection (ntop/nDPI#2264)
2026-02-13 22:03:42 +01:00
ramateur
ab77f029d9
fix: Memory leaks in lib_engine (#224) 2026-02-13 21:40:00 +01:00
Adrian Pekar
7939a983fc
Enhance CSV export with safer data handling (#222)
- Replace manual string concatenation with csv.writer() for RFC 4180 compliance
- Update open_file() to use text mode with proper encoding and newline handling
- Remove manual quoting from csv_converter() as csv.writer() handles this properly

This addresses potential data corruption with special characters (commas, quotes,
newlines) in network flow data by using Python's standard CSV module instead
of manual string formatting.
2025-11-25 01:06:28 +01:00
Zied Aouini
8873098228
Merge pull request #221 from drnpkr/ipv6-accounting-fix
Fix IPv6 accounting mode consistency with IPv4
2025-11-25 01:03:48 +01:00
Adrian Pekar
01767cd905 Fix IPv6 accounting mode consistency with IPv4
Make IPv6 ip_size calculation consistent with IPv4 for unified accounting modes.
IPv6 ip6_un1_plen field excludes the IPv6 header (per RFC), while IPv4 tot_len
includes the IPv4 header. This caused inconsistent accounting behavior between
IPv4 and IPv6 flows.

Updated packet_get_ipv6_info() to include IPv6 header size in total length
calculation for consistent accounting semantics:
- Before: iph.tot_len = iph6->ip6_hdr.ip6_un1_plen (payload only)
- After: iph.tot_len = htons(sizeof(struct ndpi_ipv6hdr) + ntohs(iph6->ip6_hdr.ip6_un1_plen))

This ensures unified accounting behavior across IPv4 and IPv6:
- Mode 0: Raw packet (all headers + data)
- Mode 1: IP packet (IP header + transport + data)
- Mode 2: Transport segment (transport header + data)
- Mode 3: Application payload (data only)

Previously IPv6 Mode 1 and Mode 2 were identical, now they differ by 40 bytes.
2025-11-24 15:03:47 +01:00
Zied Aouini
3ee4638873
build wheels on release creation only 2025-11-20 00:48:38 +01:00
Zied Aouini
087a522c17
fix publishing job 2025-11-18 12:53:24 +01:00
Zied Aouini
4dc661b2ae
trigger CI 2025-11-18 08:21:45 +01:00
Zied Aouini
58f8b956bf
release wheels 2025-11-17 19:14:25 +01:00
Zied Aouini
42c0a610b0
fix 2025-11-17 19:07:28 +01:00
Zied Aouini
fee060357c
fix license 2025-11-17 18:56:59 +01:00
Zied Aouini
1546c67deb
test linux 2025-11-17 18:54:31 +01:00
Zied Aouini
f4b1d658de
fix metadata 2025-11-17 18:09:14 +01:00
Zied Aouini
babbca660f
attempt to fix deps 2025-11-17 09:41:45 +01:00
Zied Aouini
892b71af12
fix license metadata 2025-11-17 09:11:38 +01:00
Zied Aouini
528ad7fc3d
drop wheel upload as artefact 2025-11-17 02:22:10 +01:00
Zied Aouini
962f5f5211
fix with auto dtect arch 2025-11-17 01:29:33 +01:00
Zied Aouini
53530486ba
fix lib dir on arm 64 2025-11-17 01:22:12 +01:00
Zied Aouini
26e447efdd
fix pypi upload 2025-11-17 00:30:54 +01:00
Zied Aouini
eb007930de
fix debug 2025-11-17 00:22:55 +01:00
Zied Aouini
82f54d4dfe
update 2025-11-17 00:17:08 +01:00
Zied Aouini
c3a84988d3
debug 2025-11-17 00:13:29 +01:00
Zied Aouini
4f3295c37a
fix macos build 2025-11-16 23:09:12 +01:00
Zied Aouini
f4ad05d643
enable publish on pypi 2025-11-16 22:38:19 +01:00
Zied Aouini
422be54725
fix generated versions 2025-11-16 22:23:12 +01:00
Zied Aouini
53a1ae6bac
fix deps 2025-11-16 21:45:50 +01:00
Zied Aouini
7b606f1a5c
fix wheels 2025-11-16 21:19:42 +01:00
Zied Aouini
fd2404b8d9
fix versions 2025-11-16 19:45:25 +01:00
Zied Aouini
a41a84970a
trigger CI 2025-11-16 19:30:12 +01:00
Zied Aouini
6de3ce56d7
wheel on release 2025-11-16 19:25:48 +01:00
Zied Aouini
30e533aebc
minor fix 2025-11-16 19:21:26 +01:00
Zied Aouini
c834174843
fix typo 2025-11-16 19:09:02 +01:00
Zied Aouini
4e2c935b06
fix wheel generation 2025-11-16 19:01:28 +01:00
Zied Aouini
781c6fa0a3
fix wheels 2025-11-16 18:45:36 +01:00
Zied Aouini
4a6f99dcc1
debug wheel generation 2025-11-16 18:38:36 +01:00
Zied Aouini
e4f165fca7
Merge pull request #192 from jogecodes/master
Added JA4/S support as an NFStream Plugin
2025-11-16 18:28:34 +01:00
Zied Aouini
66b577abda
minor fixes 2025-11-16 18:26:16 +01:00
Zied Aouini
b2a52c2b6e
Merge branch 'master' into master 2025-11-16 18:18:47 +01:00