DGADetective
Check if a domain has been created using a Domain Generation Algorithm.
Usefull to discover malware and trackers.
How Works
Algorithm to detect DGA:
- Check if length > 10
- Check if domain is Hex
- Check if domain is Hash
- Check if more than 3 numbers in domain
- Check if low frecuency letters are contained
- Check if more than 4 consonants together
- Check if a char is repeated more than 4 times
- Check if high entropy (with length > 10)
- Check if records in Ecosia (Only in the asynchronous version)
Install
npm install dgadetective
How to use
The function checkDGA(DOMAIN)
will return a promise that will return a value. If this value is greater than 100, probably the domain was created using DGA.
Asynchronous
const dgadetective = require('dgadetective');
dgadetective.checkDGA("malwareworld").then(function(result){
console.log(result);
}, function(err) {
console.log(err);
});
dgadetective.checkDGA("google").then(function(result){
console.log(result);
}, function(err) {
console.log(err);
});
dgadetective.checkDGA("facebook").then(function(result){
console.log(result);
}, function(err) {
console.log(err);
});
dgadetective.checkDGA("ikaxbvtyuagnsub").then(function(result){
console.log(result);
}, function(err) {
console.log(err);
});
dgadetective.checkDGA("1ro5huh1gh8ilh1823i081rkpgd5").then(function(result){
console.log(result);
}, function(err) {
console.log(err);
});
Synchronous
const dgadetective = require('dgadetective');
console.log(dgadetective.checkDGASync("malwareworld"));
console.log(dgadetective.checkDGASync("google"));
console.log(dgadetective.checkDGASync("facebook"));
console.log(dgadetective.checkDGASync("ikaxbvtyuagnsub"));
console.log(dgadetective.checkDGASync("1ro5huh1gh8ilh1823i081rkpgd5"));
console.log(dgadetective.isDGAlowSync("ikaxbvtyuagnsub"));
console.log(dgadetective.isDGAmediumSync("ikaxbvtyuagnsub"));
console.log(dgadetective.isDGAhighSync("ikaxbvtyuagnsub"));