User agent detection improvements
This commit is contained in:
@@ -262,12 +262,18 @@ static void ndpi_check_user_agent(struct ndpi_detection_module_struct *ndpi_stru
|
||||
char *ua) {
|
||||
if((!ua) || (ua[0] == '\0')) return;
|
||||
|
||||
// printf("[%s:%d] ==> '%s'\n", __FILE__, __LINE__, ua);
|
||||
|
||||
// printf("***** [%s:%d] ==> '%s'\n", __FILE__, __LINE__, ua);
|
||||
// printf("***** %u\n", ndpi_check_dga_name(ndpi_struct, NULL, "uclient-fetch]"));
|
||||
|
||||
if((strlen(ua) < 4)
|
||||
|| (!strcmp(ua, "test"))
|
||||
|| (!strcmp(ua, "<?"))
|
||||
|| ndpi_match_bigram(ndpi_struct, &ndpi_struct->bigrams_automa, ua)) {
|
||||
|| (!strncmp(ua, "test", 4))
|
||||
|| (!strncmp(ua, "<?", 2))
|
||||
|| strchr(ua, ';')
|
||||
|| strchr(ua, '{')
|
||||
|| strchr(ua, '}')
|
||||
|| ndpi_check_dga_name(ndpi_struct, NULL, ua)
|
||||
// || ndpi_match_bigram(ndpi_struct, &ndpi_struct->impossible_bigrams_automa, ua)
|
||||
) {
|
||||
NDPI_SET_BIT(flow->risk, NDPI_HTTP_SUSPICIOUS_USER_AGENT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user