aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/protocols/bfcp.c7
-rw-r--r--tests/cfgs/default/pcap/bfcp.pcapngbin1468 -> 19600 bytes
-rw-r--r--tests/cfgs/default/result/bfcp.pcapng.out8
3 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/protocols/bfcp.c b/src/lib/protocols/bfcp.c
index 6aef3b766..fd71bc56d 100644
--- a/src/lib/protocols/bfcp.c
+++ b/src/lib/protocols/bfcp.c
@@ -50,7 +50,12 @@ static void ndpi_search_bfcp(struct ndpi_detection_module_struct *ndpi_struct,
}
u_int8_t primitive = packet->payload[1];
- if (primitive < 1 || primitive > 17) {
+ if (primitive < 1 || primitive > 18) {
+ goto not_bfcp;
+ }
+
+ u_int16_t bfcp_payload_len = packet->payload_packet_len - 12;
+ if (bfcp_payload_len != ntohs(get_u_int16_t(packet->payload, 2))) {
goto not_bfcp;
}
diff --git a/tests/cfgs/default/pcap/bfcp.pcapng b/tests/cfgs/default/pcap/bfcp.pcapng
index 7adeff525..98bd554cc 100644
--- a/tests/cfgs/default/pcap/bfcp.pcapng
+++ b/tests/cfgs/default/pcap/bfcp.pcapng
Binary files differ
diff --git a/tests/cfgs/default/result/bfcp.pcapng.out b/tests/cfgs/default/result/bfcp.pcapng.out
index e25fed896..2061a3590 100644
--- a/tests/cfgs/default/result/bfcp.pcapng.out
+++ b/tests/cfgs/default/result/bfcp.pcapng.out
@@ -21,9 +21,9 @@ Patricia risk IPv6: 0/0 (search/found)
Patricia protocols: 4/0 (search/found)
Patricia protocols IPv6: 0/0 (search/found)
-BFCP 13 874 2
+BFCP 32 2224 2
-Acceptable 13 874 2
+Acceptable 32 2224 2
- 1 TCP 127.0.0.1:44450 <-> 127.0.0.1:5070 [proto: 32/BFCP][IP: 0/Unknown][ClearText][Confidence: DPI][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 6][cat: Video/26][6 pkts/416 bytes <-> 5 pkts/350 bytes][Goodput ratio: 3/3][< 1 sec][bytes ratio: 0.086 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/0 0/0 0/0 0/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 69/70 78/78 5/5][TCP Fingerprint: 2_64_33280_db1b9381215d/Unknown][Plen Bins: 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,0,0,0]
- 2 UDP 127.0.0.1:47706 <-> 127.0.0.1:5070 [proto: 32/BFCP][IP: 0/Unknown][ClearText][Confidence: DPI][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 2][cat: Video/26][1 pkts/54 bytes <-> 1 pkts/54 bytes][Goodput ratio: 22/22][< 1 sec][Plen Bins: 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,0,0,0]
+ 1 TCP 127.0.0.1:58984 <-> 127.0.0.1:5070 [proto: 32/BFCP][IP: 0/Unknown][ClearText][Confidence: DPI][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 6][cat: Video/26][10 pkts/704 bytes <-> 6 pkts/512 bytes][Goodput ratio: 5/21][123.11 sec][bytes ratio: 0.158 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/0 12579/31975 92304/92304 30186/42684][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 70/85 78/150 5/29][TCP Fingerprint: 2_64_65495_db1b9381215d/Unknown][Plen Bins: 83,0,16,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,0]
+ 2 UDP 192.168.3.134:57020 <-> 192.168.9.100:16500 [proto: 32/BFCP][IP: 0/Unknown][ClearText][Confidence: DPI][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 2][cat: Video/26][7 pkts/470 bytes <-> 9 pkts/538 bytes][Goodput ratio: 34/30][16.68 sec][bytes ratio: -0.067 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 4/0 102/2377 449/16165 174/5631][Pkt Len c2s/s2c min/avg/max/stddev: 60/54 67/60 90/98 10/14][Plen Bins: 87,12,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,0,0]