diff options
author | Ivan Nardi <nardi.ivan@gmail.com> | 2025-04-05 14:22:05 +0200 |
---|---|---|
committer | Ivan Nardi <nardi.ivan@gmail.com> | 2025-04-05 14:22:05 +0200 |
commit | 3e2d69b92ad96315ec76f1e1a5a858f53ab831e8 (patch) | |
tree | e6f41c88b0e790276d7552ae68080a18adb954f4 | |
parent | dca1e54cf62cacb19039ddc2d2a7a27aa1331f7f (diff) |
Follow-up of latest Signal call change (see: 4d41588a7)
-rw-r--r-- | doc/configuration_parameters.md | 6 | ||||
-rw-r--r-- | fuzz/fuzz_config.cpp | 15 | ||||
-rw-r--r-- | src/lib/ndpi_utils.c | 2 | ||||
-rw-r--r-- | tests/cfgs/default/pcap/signal_audiocall_2.pcapng | bin | 0 -> 66284 bytes | |||
-rw-r--r-- | tests/cfgs/default/result/signal_audiocall_2.pcapng.out | 40 |
5 files changed, 59 insertions, 4 deletions
diff --git a/doc/configuration_parameters.md b/doc/configuration_parameters.md index d11a11868..34a7b8beb 100644 --- a/doc/configuration_parameters.md +++ b/doc/configuration_parameters.md @@ -27,9 +27,9 @@ List of the supported configuration options: | NULL | "flow_risk.crawler_bot.list.load" | 1 | NULL | NULL | Enable/disable loading of internal IP address list used to check `NDPI_HTTP_CRAWLER_BOT` flow risk | | NULL | "filename.config" | NULL | NULL | NULL | Name of the file containing a list of configuration knobs itself (one per line)!. Useful to configure nDPI via text file instead of via API | | NULL | "log.level" | 0 | 0 | 3 | Configure the log/debug level. Possible values: 0 = error, 1 = trace, 2 = debug, 3 = extra debug | -| NULL | "lru.$CACHE_NAME.size" | See description | 0 | 16777215 | Set the size (in number of elements) of the specified LRU cache (0 = the cache is disabled). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns. The default value is "32768" for the bittorrent cache and "1024" for all the other caches | -| NULL | "lru.$CACHE_NAME.ttl" | See description | 0 | 16777215 | Set the TTL (in seconds) for the elements of the specified LRU cache (0 = the elements never explicitly expire). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns. The default value is "120" for the ookla cache, "60" for the msteams and fpc_dns caches and "0" for all the other caches | -| NULL | "lru.$CACHE_NAME.scope" | 0 | 0 | 1 | Set the scope of the specified LRU cache (0 = the cache is local, 1 = the cache is global). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns. The global scope con be set only if a global context has been initialized | +| NULL | "lru.$CACHE_NAME.size" | See description | 0 | 16777215 | Set the size (in number of elements) of the specified LRU cache (0 = the cache is disabled). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns, signal. The default value is "32768" for the bittorrent and signal cache and "1024" for all the other caches | +| NULL | "lru.$CACHE_NAME.ttl" | See description | 0 | 16777215 | Set the TTL (in seconds) for the elements of the specified LRU cache (0 = the elements never explicitly expire). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns, signal. The default value is "120" for the ookla cache, "60" for the msteams and fpc_dns caches and "300" for all the other caches | +| NULL | "lru.$CACHE_NAME.scope" | 0 | 0 | 1 | Set the scope of the specified LRU cache (0 = the cache is local, 1 = the cache is global). The keyword "$CACHE_NAME" is a placeholder for the cache name and the possible values are: ookla, bittorrent, stun, tls_cert, mining, msteams, fpc_dns, signal. The global scope con be set only if a global context has been initialized | | "http" | "metadata.request_content_type" | enable | NULL | NULL | Enable/disable export of Request Content Type header for HTTP flows. | | "http" | "metadata.referer" | enable | NULL | NULL | Enable/disable export of Referer header for HTTP flows. | | "http" | "metadata.host" | enable | NULL | NULL | Enable/disable export of Host header for HTTP flows. | diff --git a/fuzz/fuzz_config.cpp b/fuzz/fuzz_config.cpp index c3d4b4715..5dc1d23d4 100644 --- a/fuzz/fuzz_config.cpp +++ b/fuzz/fuzz_config.cpp @@ -623,6 +623,21 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { snprintf(cfg_value, sizeof(cfg_value), "%d", value); ndpi_set_config(ndpi_info_mod, NULL, "lru.fpc_dns.scope", cfg_value); } + if(fuzzed_data.ConsumeBool()) { + value = fuzzed_data.ConsumeIntegralInRange(0, 16777215 / 2); /* max / 2 instead of max + 1 to avoid oom on oss-fuzzer */ + snprintf(cfg_value, sizeof(cfg_value), "%d", value); + ndpi_set_config(ndpi_info_mod, NULL, "lru.signal.size", cfg_value); + } + if(fuzzed_data.ConsumeBool()) { + value = fuzzed_data.ConsumeIntegralInRange(0, 16777215 + 1); + snprintf(cfg_value, sizeof(cfg_value), "%d", value); + ndpi_set_config(ndpi_info_mod, NULL, "lru.signal.ttl", cfg_value); + } + if(fuzzed_data.ConsumeBool()) { + value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1); + snprintf(cfg_value, sizeof(cfg_value), "%d", value); + ndpi_set_config(ndpi_info_mod, NULL, "lru.signal.scope", cfg_value); + } /* Configure one cache via index */ if(fuzzed_data.ConsumeBool()) { idx = fuzzed_data.ConsumeIntegralInRange(0, static_cast<int>(NDPI_LRUCACHE_MAX)); diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index fc171d5e7..926cf16d6 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -3860,7 +3860,7 @@ const char *ndpi_lru_cache_idx_to_name(lru_cache_type idx) { const char *names[NDPI_LRUCACHE_MAX] = { "ookla", "bittorrent", "stun", "tls_cert", "mining", "msteams", - "fpc_dns" }; + "fpc_dns", "signal" }; if(idx < 0 || idx >= NDPI_LRUCACHE_MAX) return "unknown"; diff --git a/tests/cfgs/default/pcap/signal_audiocall_2.pcapng b/tests/cfgs/default/pcap/signal_audiocall_2.pcapng Binary files differnew file mode 100644 index 000000000..ec8e7ee31 --- /dev/null +++ b/tests/cfgs/default/pcap/signal_audiocall_2.pcapng diff --git a/tests/cfgs/default/result/signal_audiocall_2.pcapng.out b/tests/cfgs/default/result/signal_audiocall_2.pcapng.out new file mode 100644 index 000000000..c8577c968 --- /dev/null +++ b/tests/cfgs/default/result/signal_audiocall_2.pcapng.out @@ -0,0 +1,40 @@ +DPI Packets (TCP): 12 (6.00 pkts/flow) +DPI Packets (UDP): 21 (7.00 pkts/flow) +Confidence DPI (cache) : 2 (flows) +Confidence DPI : 3 (flows) +Num dissector calls: 15 (3.00 diss/flow) +LRU cache ookla: 0/0/0 (insert/search/found) +LRU cache bittorrent: 0/0/0 (insert/search/found) +LRU cache stun: 6/6/2 (insert/search/found) +LRU cache tls_cert: 0/0/0 (insert/search/found) +LRU cache mining: 0/0/0 (insert/search/found) +LRU cache msteams: 0/0/0 (insert/search/found) +LRU cache fpc_dns: 0/2/0 (insert/search/found) +Automa host: 2/2 (search/found) +Automa domain: 2/0 (search/found) +Automa tls cert: 0/0 (search/found) +Automa risk mask: 0/0 (search/found) +Automa common alpns: 2/2 (search/found) +Patricia risk mask: 0/0 (search/found) +Patricia risk mask IPv6: 0/0 (search/found) +Patricia risk: 0/0 (search/found) +Patricia risk IPv6: 0/0 (search/found) +Patricia protocols: 7/3 (search/found) +Patricia protocols IPv6: 0/0 (search/found) + +Signal 91 23664 2 +SignalVoip 167 33543 3 + +Acceptable 167 33543 3 +Fun 91 23664 2 + +JA Host Stats: + IP Address # JA4C + 1 192.168.12.67 1 + + + 1 UDP 192.168.12.67:43281 <-> 93.40.63.219:49514 [proto: 78.269/STUN.SignalVoip][IP: 0/Unknown][ClearText][Confidence: DPI (cache)][FPC: 78.269/STUN.SignalVoip, Confidence: DPI][DPI packets: 7][cat: VoIP/10][60 pkts/14090 bytes <-> 56 pkts/12427 bytes][Goodput ratio: 82/81][13.15 sec][bytes ratio: 0.063 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 2/0 186/219 2270/2310 468/503][Pkt Len c2s/s2c min/avg/max/stddev: 72/71 235/222 337/337 101/104][Mapped IP/Port: 93.35.168.238:53644][Risk: ** Known Proto on Non Std Port **][Risk Score: 50][Risk Info: Expected on port 3478][PLAIN TEXT (BrLBhObLLTQUS)][Plen Bins: 4,7,15,15,0,0,0,0,44,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 2 TCP 192.168.12.67:47466 <-> 76.223.92.165:443 [proto: 91.39/TLS.Signal][IP: 265/AmazonAWS][Encrypted][Confidence: DPI][FPC: 265/AmazonAWS, Confidence: IP address][DPI packets: 6][cat: Chat/9][23 pkts/5658 bytes <-> 24 pkts/6632 bytes][Goodput ratio: 73/76][50.34 sec][Hostname/SNI: chat.signal.org][(Advertised) ALPNs: http/1.1][TLS Supported Versions: TLSv1.3;TLSv1.2][bytes ratio: -0.079 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/0 2766/2622 29913/29945 7261/7101][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 246/276 1090/1514 305/407][TCP Fingerprint: 2_64_65535_685ad951a756/Android][TLSv1.3][JA4: t13d0912ht_f91f431d341e_40271e0a5736][JA3S: 15af977ce25de452b96affa2addb1036][Cipher: TLS_AES_256_GCM_SHA384][Plen Bins: 0,4,36,0,4,0,8,4,8,0,0,4,0,0,0,4,0,0,0,0,0,4,0,0,4,0,0,0,0,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0] + 3 TCP 192.168.12.67:47464 <-> 76.223.92.165:443 [proto: 91.39/TLS.Signal][IP: 265/AmazonAWS][Encrypted][Confidence: DPI][FPC: 265/AmazonAWS, Confidence: IP address][DPI packets: 6][cat: Chat/9][21 pkts/2675 bytes <-> 23 pkts/8699 bytes][Goodput ratio: 48/82][39.35 sec][Hostname/SNI: chat.signal.org][(Advertised) ALPNs: http/1.1][TLS Supported Versions: TLSv1.3;TLSv1.2][bytes ratio: -0.530 (Download)][IAT c2s/s2c min/avg/max/stddev: 2/0 2426/2168 30454/30482 7465/7083][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 127/378 530/1514 118/492][TCP Fingerprint: 2_64_65535_685ad951a756/Android][TLSv1.3][JA4: t13d0912ht_f91f431d341e_40271e0a5736][JA3S: 15af977ce25de452b96affa2addb1036][Cipher: TLS_AES_256_GCM_SHA384][Plen Bins: 4,18,18,13,0,0,4,0,9,0,0,4,0,0,4,0,0,0,0,0,0,0,0,0,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,9,0,0] + 4 UDP 192.168.12.67:43281 <-> 141.101.90.1:3478 [proto: 78.269/STUN.SignalVoip][IP: 220/Cloudflare][ClearText][Confidence: DPI][FPC: 78/STUN, Confidence: DPI][DPI packets: 7][cat: VoIP/10][14 pkts/1980 bytes <-> 14 pkts/1872 bytes][Goodput ratio: 70/69][10.04 sec][Hostname/SNI: turn.cloudflare.com][bytes ratio: 0.028 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/0 834/834 4001/4000 1265/1264][Pkt Len c2s/s2c min/avg/max/stddev: 62/82 141/134 274/178 98/45][Mapped IP/Port: 93.35.168.238:53643][Relayed IP/Port: 104.30.149.151:29665][PLAIN TEXT (000001957)][Plen Bins: 32,21,3,0,25,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 5 UDP 192.168.12.67:43281 -> 10.219.164.8:50017 [proto: 78.269/STUN.SignalVoip][IP: 0/Unknown][ClearText][Confidence: DPI (cache)][FPC: 78.269/STUN.SignalVoip, Confidence: DPI][DPI packets: 7][cat: VoIP/10][23 pkts/3174 bytes -> 0 pkts/0 bytes][Goodput ratio: 70/0][13.35 sec][bytes ratio: 1.000 (Upload)][IAT c2s/s2c min/avg/max/stddev: 49/0 616/0 1013/0 278/0][Pkt Len c2s/s2c min/avg/max/stddev: 138/0 138/0 138/0 0/0][Risk: ** Known Proto on Non Std Port **** Unidirectional Traffic **][Risk Score: 60][Risk Info: No server to client traffic / Expected on port 3478][PLAIN TEXT (BcOWkhDT)][Plen Bins: 0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |