Add ICMP checksum check and set risk if mismatch detected. (#1464)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -3066,6 +3066,12 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
|
||||
if (NDPI_ENTROPY_ENCRYPTED_OR_RANDOM(flow->entropy) != 0) {
|
||||
ndpi_set_risk(ndpi_str, flow, NDPI_SUSPICIOUS_ENTROPY);
|
||||
}
|
||||
|
||||
struct ndpi_icmphdr * const icmphdr = (struct ndpi_icmphdr *)packet->payload;
|
||||
u_int16_t chksm = ndpi_calculate_icmp4_checksum(packet->payload, packet->payload_packet_len);
|
||||
if (icmphdr->checksum != chksm) {
|
||||
ndpi_set_risk(ndpi_str, flow, NDPI_MALFORMED_PACKET);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user