Updated DNS alert triggered only with TTL == 0

This commit is contained in:
Luca Deri
2022-06-14 00:13:05 +02:00
parent 831562c141
commit defe7d7f79
36 changed files with 228 additions and 232 deletions
+2 -6
View File
@@ -310,12 +310,8 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
rsp_type = get16(&x, packet->payload);
rsp_ttl = ntohl(*((u_int32_t*)&packet->payload[x+2]));
if(rsp_ttl < 300) {
char buf[64];
snprintf(buf, sizeof(buf), "Low DNS Record TTL %d", rsp_ttl);
ndpi_set_risk(ndpi_struct, flow, NDPI_DNS_SUSPICIOUS_TRAFFIC, buf);
}
if(rsp_ttl == 0)
ndpi_set_risk(ndpi_struct, flow, NDPI_DNS_SUSPICIOUS_TRAFFIC, "DNS Record with zero TTL");
#ifdef DNS_DEBUG
printf("[DNS] TTL = %u\n", rsp_ttl);