Domain Generation Algorithm (DGA): Ways to Communicate

# Domain Generation Algorithm (DGA): Python Implementation 

Ways to disseminate the DGA seed:
(1) Spread inside the bot config (easy but insecure);
(2) Generate based on the GetSystemInfo & GetCurrentUser etc. (local environment) (more secure)
(3) Pull additional websites based off the seed websites’ HTML source code . Example,


# ROE is a marker for Base64-encoded

# -*- coding: utf-8 -*- 
import hashlib
def md5_dga(seed)
 var hashlib.md5() # hash the seed using the entry algorithm 
 var.hexdigest() # cut all the strings after the 10th one 
 part name[:10
 return “{}.xyz”.format(part

seed “cm9jayduJ3JvbGw=” # ASCII: rock’n’roll 
for in range(12)
 seed md5_dga(seed)
print seed

# -*- coding: utf-8 -*- 
import hashlib
dga_dictionary = [‘btc’‘love’‘bit’,‘rain’,‘drop’
def dictionary_dga(seed): 
 ln len(dga_dictionary# check the maximum length of the DGA dictionary
if ln ln <= seed
  return False # choose 2 words 
 first seed ln
 last seed ln # create an address concatenating variable 1 + variable 2 
 addr “{}{}.xyz”.format(dga_dictionary[first],dga_dictionary[last]
 return addr
for in range(20)
 print dictionary_dga(x)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: