Added detection for WordPress exploits

Fixed ndpi_iph_is_valid_and_not_fragmented() that was bugged with non UDP traffic
This commit is contained in:
Luca Deri
2022-05-29 16:31:26 +02:00
parent 6b7b23b01d
commit 1093aafa5f
2 changed files with 24 additions and 5 deletions
+9 -4
View File
@@ -4604,12 +4604,17 @@ u_int8_t ndpi_iph_is_valid_and_not_fragmented(const struct ndpi_iphdr *iph, cons
1: not fragmented
*/
//#ifdef REQUIRE_FULL_PACKETS
if(ipsize < iph->ihl * 4 || ipsize < ntohs(iph->tot_len) || ntohs(iph->tot_len) < iph->ihl * 4 ||
(iph->frag_off & htons(0x1FFF)) != 0) {
return(0);
if(iph->protocol == IPPROTO_UDP) {
if((ipsize < iph->ihl * 4)
|| (ipsize < ntohs(iph->tot_len))
|| (ntohs(iph->tot_len) < iph->ihl * 4)
|| (iph->frag_off & htons(0x1FFF)) != 0) {
return(0);
}
}
//#endif
return(1);
}