Commit graph

6743 commits

Author SHA1 Message Date
Vitaly Lavrov
82eb9f8958 Fix oops. part 5
Some checks failed
CIFuzz / Fuzzing (address) (push) Has been cancelled
CIFuzz / Fuzzing (memory) (push) Has been cancelled
CIFuzz / Fuzzing (undefined) (push) Has been cancelled
Locking issue continue.
2026-11-27 12:45:01 +03:00
Vitaly Lavrov
474ed11b82 Fix oops. part 4
Some checks are pending
CIFuzz / Fuzzing (address) (push) Waiting to run
CIFuzz / Fuzzing (memory) (push) Waiting to run
CIFuzz / Fuzzing (undefined) (push) Waiting to run
locking issue
2026-11-26 16:29:37 +03:00
Vitaly Lavrov
58d6fe976c Fix oops. part 3
Some checks are pending
CIFuzz / Fuzzing (address) (push) Waiting to run
CIFuzz / Fuzzing (memory) (push) Waiting to run
CIFuzz / Fuzzing (undefined) (push) Waiting to run
A separate list has been created for new conntrack entries.
2026-11-25 20:53:03 +03:00
Vitaly Lavrov
6d08b8a3bb Fix oops. part 2
Fix memory leak.
2026-11-25 12:16:51 +03:00
Vitaly Lavrov
c75ec61594 Fix oops. part 1
Adding to flows only confirmed connections.
2026-11-24 15:10:01 +03:00
Vitaly Lavrov
30a757801e Fix after merge 2026-11-20 14:45:29 +03:00
Vitaly Lavrov
f84512cd2a Merge commit '6d2476c31b' into flow_info-4 2026-11-20 12:56:46 +03:00
Vitaly Lavrov
842798e990 Merge commit '6a85dd290a' into flow_info-4 2026-11-20 12:48:58 +03:00
Vitaly Lavrov
ad0f93c339 Merge commit 'b6bddaf79b' into flow_info-4 2026-11-20 12:44:45 +03:00
Vitaly Lavrov
a0b3a6fbee Merge commit '6b38c1c258' into flow_info-4 2026-11-20 12:42:41 +03:00
Vitaly Lavrov
4d3cb23dc8 Merge commit 'b17e3ae776' into flow_info-4 2026-11-20 12:36:39 +03:00
Vitaly Lavrov
a6f5031574 Merge commit 'ca9d819151' into flow_info-4 2026-11-20 12:35:21 +03:00
Vitaly Lavrov
c2b9a0f952 Merge commit 'd015ae84de' into flow_info-4 2026-11-20 12:33:01 +03:00
Vitaly Lavrov
20fb399023 Merge commit 'cdad1fce08' into flow_info-4 2026-11-20 12:31:37 +03:00
Vitaly Lavrov
b47b075978 Merge commit 'e5f8ec9541' into flow_info-4 2026-11-20 12:25:59 +03:00
Vitaly Lavrov
af99e6969d Small changes
Replace !(!ACCESS_OK() && !__copy_to_user()) by copy_to_user()
2026-11-20 12:12:27 +03:00
Vitaly Lavrov
35e45efcc1
Merge pull request #250 from netcons/flow_info-4
Some checks failed
CIFuzz / Fuzzing (address) (push) Has been cancelled
CIFuzz / Fuzzing (memory) (push) Has been cancelled
CIFuzz / Fuzzing (undefined) (push) Has been cancelled
Fix ndpi_debug.c make error and magic_ct typo
2026-11-19 12:59:23 +03:00
netcons
f8abf1f322 Fix ndpi_debug.c make error and magic_ct typo 2026-11-19 09:29:27 +02:00
Vitaly Lavrov
4e45ade429 Small changes.
Changed implementation for risks 28 (Malicious Fingerprint)
and 29 (Malicious SSL Cert/SHA1 Fingerprint).
Use files /proc/net/xt_ndpi/hash_{ja4,sha1}

Changed option ndpi_flow_opt.

Read INSTALL.
2026-11-18 15:35:13 +03:00
Ivan Nardi
6d2476c31b DNS: fixes 2026-11-16 09:35:23 +01:00
Vitaly Lavrov
75530e46c6 Fix for kernel oops and memory leak
Some checks failed
CIFuzz / Fuzzing (address) (push) Has been cancelled
CIFuzz / Fuzzing (memory) (push) Has been cancelled
CIFuzz / Fuzzing (undefined) (push) Has been cancelled
2026-11-16 11:02:34 +03:00
Ivan Nardi
bb583c6dc9 HTTP: improve detection of Connectivity-Checks flows 2026-11-15 17:36:06 +01:00
Luca
f267cef424 Improved DNS dissection 2026-11-15 07:20:07 +01:00
Ivan Nardi
0d213cd3bc Fix fp_tcp_win11.pcapng: use a single link type 2026-11-13 19:40:10 +01:00
John Earle
614f59a932
Merge commit from fork
* Kerberos: clamp the reply prefix copy to the buffer size (GHSA-3pvq-vj37-hfqg)

The reply-buffering branch of krb_process_packet() allocated
ndpi_min(kerberos_len, KRB_MAX_BUF_LEN)+4 bytes for pktbuf but then copied
payload_len+4 bytes into it. When 12000 < payload_len < kerberos_len <
1048576 the copy exceeds the clamped buffer, overflowing the heap with
attacker-controlled data (reachable via a Kerberos-classified TCP flow and a
crafted >12KB single-segment reply). pktbuf_currlen is u_int16_t, so the
unclamped payload_len+4 was also truncated on store.

Clamp both the copy length and pktbuf_currlen to pktbuf_maxlen, keeping only
the prefix the buffer can hold -- which is sufficient for the incremental
KRB_PARSE_PREFIX parsing performed just above. Verified under AddressSanitizer:
the PoC that previously overflowed now runs clean, and normal Kerberos traffic
still classifies.

* Kerberos: add a test for the reply prefix overflow (GHSA-3pvq-vj37-hfqg)

A TGS-REP whose padata keeps the client name out of a single 15000-byte
segment: the reply is buffered in a 12004-byte buffer. Without the fix,
AddressSanitizer reports a heap-buffer-overflow (WRITE of size 15004) in
krb_process_packet().
2026-11-13 18:21:19 +01:00
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
Alfredo Cardigliano
9f8e80ebf9
Extend Known Proto on Non Std Port description to include both ports (and proto) (#3326) 2026-11-13 16:27:27 +01:00
Ivan Nardi
15a686dbfa
HTTP: handle Byte Order Marks when checking for suspicious content (#3325)
Text bodies starting with a UTF-8 BOM (EF BB BF) were flagged as
NDPI_HTTP_SUSPICIOUS_CONTENT, since the check accepts only ASCII bytes.
Skip the UTF-8 BOM and check the text after it.

UTF-16 text can't be validated with an ASCII check: if the body starts
with a UTF-16 (LE/BE) BOM, consider it as acceptable.
2026-11-12 20:03:07 +01:00
Ivan Nardi
db103fd80c TLS: extend list of non-suspicious extensions 2026-11-12 18:34:41 +01:00
Luca Deri
fa863b53fb Compilation fixes 2026-11-12 16:29:00 +01:00
Luca Deri
5d9724ca04 HTTP subprotocols are not set only in case HTTP returns a positive response.
This is to avoid that probing attempts create invalid protocol detection
2026-11-12 12:47:04 +01:00
Ivan Nardi
51ca71649c
HTTP: skip chunk-size line when checking for suspicious content (#3323)
With "Transfer-Encoding: chunked", the body starts with the chunk-size
line, so the human-readable content check was inspecting "<hex>\r\n"
instead of the actual payload. This reported wrong bytes in the risk
info (e.g. "610D0A1F"), missed non-printable data when the chunk size
had 2+ digits, and flagged valid gzip-compressed chunked bodies.

For chunked responses, skip the chunk-size line (and any extension)
before running the check.
2026-11-12 12:35:10 +01:00
Ivan Nardi
64b1ad9e6c
utests: fix TLS blocks initializers, stale malware domain and TLS results (#3324)
TLS: remove leftover debug printf in handleTLSBlockStat().
2026-11-12 12:34:46 +01:00
Raja Muhammad Awais
0bff3aa1ae
SSH: fix obsolete cipher detection and KEX metadata reuse (#3319)
Co-authored-by: RajaMuhammadAwais <1.19938988e+08+RajaMuhammadAwais@users.noreply.github.com>
2026-11-12 09:13:33 +01:00
Luca Deri
2ed880c637 Implemented TLS block export in monitoring mode 2026-11-11 07:44:04 +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
Alfredo Cardigliano
c8d10df833
Fix Discord detection with request retransmission (#3321) 2026-11-10 11:16:59 +01:00
Alfredo Cardigliano
b5db1c7850 Fix Linux Cooked Capture v2 parsing 2026-11-10 09:39:10 +01:00
Ivan Nardi
95fc30c2bf
Protobuf: fix false positive on payloads parsed only partially (#3320)
The "weak" detection path (>= 4 packets, >= 2 elements, no LEN fields
required) didn't check that the whole payload had been parsed: the
dissector stops after PROTOBUF_MAX_ELEMENTS elements and returns a
non-zero offset anyway.

Require the parsed bytes to cover the entire payload on that path.

Add the trace to false_positives.pcapng.
2026-11-09 21:40:29 +01:00
Ivan Nardi
6a85dd290a Sync unit tests results 2026-11-09 13:26:54 +01:00
Alfredo Cardigliano
a2b54f8293 Reduce severity of TCP Issues to reduce noise (Probing Attempt is also set when it's about security) 2026-11-09 11:15:53 +01:00
Luca Deri
d0eeed4f4d
Update nDPI description and licensing details
Clarified licensing information for nDPI library.
2026-11-07 18:34:54 +01:00
Luca Deri
ed59c1fcda Enhanced FTP detection 2026-11-07 12:37:04 +01:00
Luca Deri
b0a8b13e27 Updated test results 2026-11-07 08:53:54 +01:00
Luca
b0a2310906 Implements detection of CVE-2026-98432 2026-11-06 19:04:28 +01:00
Luca
6c805efdfe Traffic forged using the script below to mimic CVE-2026-98432
--

from scapy.all import IP, TCP, IPOption, wrpcap

def generate_test_pcaps(output_filename="cve_2026_98432_test.pcap"):
    packets = []

    # Target and Source placeholders for the test trace
        src_ip = "192.168.1.50"
	    dst_ip = "192.168.1.100"
	        dst_port = 80

    print(f"[*] Generating synthetic test packets for CVE-2026-98432...")

    # Vector 1: TCP SYN packet carrying IPv4 Options (Triggers Rule 1)
        # Using the standard 'Record Route' option (option number 7)
	    ip_option = IPOption(b'\x07\x07\x04\x00\x00\x00\x00')

    syn_with_ip_opts = (
            IP(src=src_ip, dst=dst_ip, options=[ip_option]) /
	            TCP(sport=54321, dport=dst_port, flags="S", seq=1000)
		        )
			    packets.append(syn_with_ip_opts)
			        print(" [+] Added: TCP SYN with IPv4 Options")

    # Vector 2: TCP SYN packet carrying Multipath TCP (MPTCP) Options (Triggers Rule 2)
        # MPTCP uses TCP Option Kind 30 (\x1e).
	    # Subtype 0 (\x00) represents the MP_CAPABLE handshake signature.
	        mptcp_option = (30, b'\x00\x01\x02\x03\x04\x05\x06\x07')

    syn_with_mptcp = (
            IP(src=src_ip, dst=dst_ip) /
	            TCP(sport=54322, dport=dst_port, flags="S", seq=2000, options=[mptcp_option])
		        )
			    packets.append(syn_with_mptcp)
			        print(" [+] Added: TCP SYN with MPTCP Options")

    # Write the constructed array of packets to a standard PCAP file
        wrpcap(output_filename, packets)
	    print(f"[*] Successfully wrote {len(packets)} packets to '{output_filename}'.")

if __name__ == "__main__":
    generate_test_pcaps()
2026-11-06 19:04:28 +01:00
Alfredo Cardigliano
cfbf5fe45d
Do not trigger Known Proto on Non Std Port for mail protocols (e.g. STARTTLS flows on port 25, SMTP expected but protocol nogotiated to SMTPS) (#3318) 2026-11-06 17:30:32 +01:00
Raja Muhammad Awais
8a07936f2a
SSH: match negotiated algorithms by exact name (#3311) 2026-11-06 17:14:06 +01:00
Ivan Nardi
96a07277c0 TLS: better flow risk info 2026-11-06 16:54:48 +01:00
Ivan Nardi
2005d3af4f Bittorrent: avoid Known Proto on Non Std Port flow risk 2026-11-06 16:12:21 +01:00