Improved DGA detection algoritm
This commit is contained in:
@@ -9341,7 +9341,7 @@ static const char *ndpi_en_popular_bigrams[] = {
|
|||||||
static const char *ndpi_en_impossible_bigrams[] = {
|
static const char *ndpi_en_impossible_bigrams[] = {
|
||||||
"bk", "bq", "bx", "cb", "cf", "cg", "cj", "cp", "cv", "cw", "cx", "dx", "fk", "fq", "fv", "fx", /* "ee", removed it can be found in 'meeting' */
|
"bk", "bq", "bx", "cb", "cf", "cg", "cj", "cp", "cv", "cw", "cx", "dx", "fk", "fq", "fv", "fx", /* "ee", removed it can be found in 'meeting' */
|
||||||
"fz", "gq", "gv", "gx", "hh", "hk", "hv", "hx", "hz", "iy", "jb", /* "jc", jcrew.com */ "jd", "jf", "jg", "jh", "jk",
|
"fz", "gq", "gv", "gx", "hh", "hk", "hv", "hx", "hz", "iy", "jb", /* "jc", jcrew.com */ "jd", "jf", "jg", "jh", "jk",
|
||||||
"jl", "jm", "jn", "jp", "jq", /* "jr",*/ /* "js", */ "jt", "jv", "jw", "jx", "jy", "jz", "kg", "kq", "kv", "kx",
|
"jl", "jm", "jn", "jp", "jq", /* "jr",*/ /* "js", */ "jt", "jv", "jw", "jx", "jy", "jz", /* "kg", */ "kq", "kv", "kx",
|
||||||
"kz", "lq", "lx", /* "mg" tamgrt.com , */ "mj", /* "mq", mqtt */ "mx", "mz", "pq", "pv", "px", "qb", "qc", "qd", "qe", "qf", "ii",
|
"kz", "lq", "lx", /* "mg" tamgrt.com , */ "mj", /* "mq", mqtt */ "mx", "mz", "pq", "pv", "px", "qb", "qc", "qd", "qe", "qf", "ii",
|
||||||
"qg", "qh", "qj", "qk", "ql", "qm", "qn", "qo", "qp", "qr", "qs", "qt", "qv", "qw", "qx", "qy", "uu",
|
"qg", "qh", "qj", "qk", "ql", "qm", "qn", "qo", "qp", "qr", "qs", "qt", "qv", "qw", "qx", "qy", "uu",
|
||||||
"qz", "sx", "sz", "tq", "tx", "vb", "vc", "vd", "vf", "vg", "vh", "vj", "vm", "vn", /* "vp", Removed for vpbank.com */ "bw", /* "vk", "zr" Removed for kavkazr */
|
"qz", "sx", "sz", "tq", "tx", "vb", "vc", "vd", "vf", "vg", "vh", "vj", "vm", "vn", /* "vp", Removed for vpbank.com */ "bw", /* "vk", "zr" Removed for kavkazr */
|
||||||
|
|||||||
+9
-11
@@ -6579,7 +6579,7 @@ static int enough(int a, int b) {
|
|||||||
|
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
|
|
||||||
// #define DGA_DEBUG 1
|
/* #define DGA_DEBUG 1 */
|
||||||
|
|
||||||
int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,
|
int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
@@ -6656,18 +6656,16 @@ int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,
|
|||||||
printf("-> Checking %c%c\n", word[i], word[i+1]);
|
printf("-> Checking %c%c\n", word[i], word[i+1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(ndpi_match_bigram(ndpi_str, &ndpi_str->bigrams_automa, &word[i])) {
|
if(ndpi_match_bigram(ndpi_str,
|
||||||
num_found++;
|
&ndpi_str->impossible_bigrams_automa,
|
||||||
} else {
|
&word[i])) {
|
||||||
if(ndpi_match_bigram(ndpi_str,
|
|
||||||
&ndpi_str->impossible_bigrams_automa,
|
|
||||||
&word[i])) {
|
|
||||||
#ifdef DGA_DEBUG
|
#ifdef DGA_DEBUG
|
||||||
printf("IMPOSSIBLE %s\n", &word[i]);
|
printf("IMPOSSIBLE %s\n", &word[i]);
|
||||||
#endif
|
#endif
|
||||||
num_impossible++;
|
num_impossible++;
|
||||||
}
|
} else if(ndpi_match_bigram(ndpi_str, &ndpi_str->bigrams_automa, &word[i])) {
|
||||||
}
|
num_found++;
|
||||||
|
}
|
||||||
} /* for */
|
} /* for */
|
||||||
} /* for */
|
} /* for */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user