Add an heuristic to detect fully encrypted flows (#2058)

A fully encrypted session is a flow where every bytes of the
payload is encrypted in an attempt to “look like nothing”.
The heuristic needs only the very first packet of the flow.
See: https://www.usenix.org/system/files/sec23fall-prepub-234-wu-mingshi.pdf

A basic, but generic, inplementation of the popcpunt alg has been added
This commit is contained in:
Ivan Nardi
2023-07-26 09:09:12 +02:00
committed by GitHub
parent 2b230e28e0
commit 3326fa258e
17 changed files with 280 additions and 105 deletions
+6
View File
@@ -2,11 +2,17 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
u_char hash[16];
struct ndpi_popcount popcount;
/* No memory allocations involved */
/* Used for crc32, md5 and popcount algs */
ndpi_crc32(data, size);
ndpi_md5(data, size, hash);
ndpi_popcount_init(&popcount);
ndpi_popcount_count(&popcount, data, size);
return 0;
}