aboutsummaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-06-07 13:12:04 +0200
committerGitHub <noreply@github.com>2024-06-07 13:12:04 +0200
commitb90d39c4ac039464798a323ef96dc92262504852 (patch)
tree9e027c4631b2aa5cacf9447a6626b86b569675fc /fuzz
parent070a0908b30c055bf0590fb0d10557c1acf70401 (diff)
RTP/STUN: look for STUN packets after RTP/RTCP classification (#2465)
After a flow has been classified as RTP or RTCP, nDPI might analyse more packets to look for STUN/DTLS packets, i.e. to try to tell if this flow is a "pure" RTP/RTCP flow or if the RTP/RTCP packets are multiplexed with STUN/DTLS. Useful for proper (sub)classification when the beginning of the flows are not captured or if there are lost packets in the the captured traffic. Disabled by default
Diffstat (limited to 'fuzz')
2 files changed, 6 insertions, 0 deletions
diff --git a/fuzz/fuzz_config.cpp b/fuzz/fuzz_config.cpp
index 8ce14bfdd..94b250e64 100644
--- a/fuzz/fuzz_config.cpp
+++ b/fuzz/fuzz_config.cpp
@@ -219,6 +219,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
ndpi_set_config(ndpi_info_mod, "zoom", "max_packets_extra_dissection", cfg_value);
}
if(fuzzed_data.ConsumeBool()) {
+ value = fuzzed_data.ConsumeIntegralInRange(0, 0x01 + 1);
+ snprintf(cfg_value, sizeof(cfg_value), "%d", value);
+ ndpi_set_config(ndpi_info_mod, "rtp", "search_for_stun", 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, "any", "log", cfg_value);
diff --git a/fuzz/fuzz_ndpi_reader.c b/fuzz/fuzz_ndpi_reader.c
index 5bd0662f1..9d061e5ca 100644
--- a/fuzz/fuzz_ndpi_reader.c
+++ b/fuzz/fuzz_ndpi_reader.c
@@ -72,6 +72,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
ndpi_set_config(workflow->ndpi_struct, NULL, "tcp_ack_payload_heuristic", "1");
ndpi_set_config(workflow->ndpi_struct, "tls", "application_blocks_tracking", "1");
ndpi_set_config(workflow->ndpi_struct, "stun", "max_packets_extra_dissection", "255");
+ ndpi_set_config(workflow->ndpi_struct, "rtp", "search_for_stun", "1");
ndpi_finalize_initialization(workflow->ndpi_struct);