aboutsummaryrefslogtreecommitdiff
path: root/tests/dga
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-03-03 19:30:01 +0100
committerLuca Deri <deri@ntop.org>2021-03-03 19:30:01 +0100
commit0f8a9948415bceac84148e1965e12e3f19c5050e (patch)
treee0615fc8fbf465178d29c78472638fb56b6ba5e3 /tests/dga
parent49843509e54aa70dc69005dab5f02f32df7866e2 (diff)
Improved DGA detection
Before Accuracy 66%, Precision 86%, Recall 38% After Accuracy 71%, Precision 89%, Recall 49%
Diffstat (limited to 'tests/dga')
-rw-r--r--tests/dga/dga_evaluate.c13
-rw-r--r--tests/dga/test_dga.csv4
2 files changed, 10 insertions, 7 deletions
diff --git a/tests/dga/dga_evaluate.c b/tests/dga/dga_evaluate.c
index 4dfda8df5..fb32075db 100644
--- a/tests/dga/dga_evaluate.c
+++ b/tests/dga/dga_evaluate.c
@@ -39,12 +39,15 @@ void help() {
/* *********************************************** */
+extern int ndpi_verbose_dga_detection;
+
int main(int argc, char **argv) {
FILE *fd;
char buffer[512];
int verbose = 0;
+ int num_detections = 0;
- if(argc != 2) help();
+ if(argc < 2) help();
fd = fopen(argv[1], "r");
if(fd == NULL) {
@@ -52,7 +55,12 @@ int main(int argc, char **argv) {
exit(0);
}
- if(argv[1] != NULL) verbose = 1;
+ if(argv[2] != NULL) {
+ verbose = 1;
+
+ if(argv[3] != NULL)
+ ndpi_verbose_dga_detection = 1;
+ }
if (ndpi_get_api_version() != NDPI_API_VERSION) {
printf("nDPI Library version mismatch: please make sure this code and the nDPI library are in sync\n");
@@ -67,7 +75,6 @@ int main(int argc, char **argv) {
ndpi_set_protocol_detection_bitmask2(ndpi_str, &all);
ndpi_finalize_initialization(ndpi_str);
assert(ndpi_str != NULL);
- int num_detections = 0;
while(fgets(buffer, sizeof(buffer), fd) != NULL) {
diff --git a/tests/dga/test_dga.csv b/tests/dga/test_dga.csv
index f85515e58..9aa9261ae 100644
--- a/tests/dga/test_dga.csv
+++ b/tests/dga/test_dga.csv
@@ -33717,8 +33717,6 @@ kicirtug.ru
eolkbcmid.cx
mmn6zi3zdfz8nqhrww.ru
geiqiwob.ru
-singles-organizations.sc
-rentirondetailcontestfinance.com
hutdkvppdcncx.com
sonicengineer.net
gekawes6wi02.org
@@ -33728,7 +33726,6 @@ vkmtavbovakpffagww.bz
eiyiccuaymmauyqc.org
egimlecwet.com
jstwviptingp.nf
-workout-mainly.vn
dominisanctimor.com
cysnsnnsqwckphatu.net
d1x38ulx2x7r4yepis.biz
@@ -33737,7 +33734,6 @@ azyynmud.cc
iqswfjiobzeiv.com
tallsgcpajgmiu.com
kvlfocrimjvk.com
-shore-hunger.az
gasto.es
kmbmfbkdmmabanbc.org
hedcynpchaek.pro