From ed51987e3a4838dd9aef27dfab2c0651f2f52836 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 18 Oct 2021 23:16:32 +0200 Subject: Fix broken fuzz_process_packet fuzzer by adding a call to ndpi_finalize_initialization(). (#1334) * fixed several memory errors (heap-overflow, unitialized memory, etc) * ability to build fuzz_process_packet with a main() allowing to replay crash data generated with fuzz_process_packet by LLVMs libfuzzer * temporarily disable fuzzing if `tests/do.sh` executed with env FUZZY_TESTING_ENABLED=1 Signed-off-by: Toni Uhlig --- tests/do.sh.in | 3 +++ tests/pcap/fuzz-2021-10-13.pcap | Bin 0 -> 239 bytes tests/result/fuzz-2021-10-13.pcap.out | 12 ++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 tests/pcap/fuzz-2021-10-13.pcap create mode 100644 tests/result/fuzz-2021-10-13.pcap.out (limited to 'tests') diff --git a/tests/do.sh.in b/tests/do.sh.in index 36b83b128..d04b483b6 100755 --- a/tests/do.sh.in +++ b/tests/do.sh.in @@ -3,6 +3,9 @@ cd "$(dirname "${0}")" FUZZY_TESTING_ENABLED=@BUILD_FUZZTARGETS@ +if [ "$NDPI_DISABLE_FUZZY" = "1" ]; then + FUZZY_TESTING_ENABLED=0 +fi #Remember: valgrind and *SAN are incompatible! VALGRIND="" diff --git a/tests/pcap/fuzz-2021-10-13.pcap b/tests/pcap/fuzz-2021-10-13.pcap new file mode 100644 index 000000000..751775397 Binary files /dev/null and b/tests/pcap/fuzz-2021-10-13.pcap differ diff --git a/tests/result/fuzz-2021-10-13.pcap.out b/tests/result/fuzz-2021-10-13.pcap.out new file mode 100644 index 000000000..e0d6e4c90 --- /dev/null +++ b/tests/result/fuzz-2021-10-13.pcap.out @@ -0,0 +1,12 @@ +Guessed flow protos: 1 + +DPI Packets (TCP): 1 (1.00 pkts/flow) + +TLS 1 197 1 + +JA3 Host Stats: + IP Address # JA3C + 1 3400:3a30:3035:2f75:706c:6f32:643f:6c3d 1 + + + 1 TCP [3400:3a30:3035:2f75:706c:6f32:643f:6c3d]:44288 -> [302e::3d00::8001]:0 [proto: 91/TLS][Encrypted][cat: Web/5][1 pkts/197 bytes -> 0 pkts/0 bytes][Goodput ratio: 75/0][< 1 sec][Risk: ** Known protocol on non standard port **** Obsolete TLS version (older than 1.2) **** TLS suspicious extension **][Risk Score: 160][TLS (0030)][JA3C: 7fd749763364ca3fe45ec98917f981f6][PLAIN TEXT (005/uplo2)][Plen Bins: 0,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] -- cgit v1.2.3