Source

imalse / scenario / file_exfiltration / config.py

Full commit
"""

This file is used to configure the botmaster, clients and server in the file
exfiltration scenario.

"""

from core.cmd.description import ServerDescription, ClientDescription 
from core.cmd.description import BotmasterDescription 

class Botmaster(BotmasterDescription):
    
    """
    
    This class is the subclass of the default botmaster description. The
    default settings are:
    
    server_address = '127.0.0.1'
    server_port = 3333
    request_timeout = 10
    initial = 'waiting'
    start_action = 'request_connect'
    self.master_password = '1234'
    self.interval = 2 
    self.num_commands = 1
    self.command = None
    
    """
    
    def __init__(self):
        """Initialize the botmaster description."""
        BotmasterDescription.__init__(self)
        self.command = InitialCmd()

class Client(ClientDescription):
    
    """
    
    This class is the subclass of the default client description. The
    default settings are:
    
    server_address = '127.0.0.1'
    server_port = 3333
    request_timeout = 10    
    initial = 'waiting'
    start_action = 'initialize'
    self.master_password = '1234'
    
    """
    
    def __init__(self):
        """Initialize the client description."""
        ClientDescription.__init__(self)
        
class Server(ServerDescription):
    
    """
    
    This class is the subclass of the default client description. The
    default settings are:
    
    server_address = '127.0.0.1'
    server_port = 3333
    request_timeout = 10    
    initial = 'waiting'
    start_action = 'initialize'
    
    """
    
    def __init__(self):
        """
        
        Initialize the server description. The member variable interval defines
        the interval length between the distribution of the different commands.
        
        """
        ServerDescription.__init__(self)
        self.interval = 2
                  
class FtpCmd(object):
    
    """
    
    This class specifies the ftp command that is send to the bots connected
    to the server.
    
    """    
    
    def __init__(self):
        """Specify the settings here."""
        self.event = 'set_ftp_info'
        self.host = 'thales.bu.edu'
        self.user = 'imalse-ftp'
        self.password = 'imalse'
    
class FileFilterCmd(object):
    
    """
    
    This class specifies the set file filter command that is send to the bots 
    connected to the server.
    
    """
      
    def __init__(self):
        """Specify the settings here."""
        self.event = 'set_file_filter'
        self.suffix = '.txt'
        self.pattern =  'assword'
        self.directory = '.'

class InitialCmd(object):
    
    """
    
    This class specifies initial command that is send to the bots 
    connected to the server.
    
    """
    
    def __init__(self):
        """Initialize the command."""
        self.event = 'file_exfiltration'
        
class SearchAndUploadCmd(object):
    
    """
    
    This class specifies search and upload command that is send to the bots 
    connected to the server.
    
    """
    
    def __init__(self):
        """Initialize the command."""
        self.event = 'search_and_upload'