Source

imalse / scenario / spamming / config.py

"""

This file is used to configure the botmaster, clients and server in the file
spamming 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
    inital = '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 = CrawlCmd()    

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 = 'disconn'
    start_action = 'request_connect'
    
    """
    
    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'
    self.master_password = '1234'
    
    """
    
    def __init__(self):
        """Initialize the server description."""
        ServerDescription.__init__(self)
        
class CrawlCmd(object):
   
    """
    
    This class specifies the ping command that is send to the bots connected
    with the server.
    
    """
    
    def __init__(self):
        """Specify the settings here."""
        self.event = 'send_to_bot'
        self.bot_event = 'spam'
        self.bot_addr = ''
        self.start_url = 'http://dd710.com/email.htm'
        self.subject = 'You have won the lotery!'
        self.content = \
        """Hi,
        
        Congratulations with your prize!
        """
        self.max_iterations = 2
        
        self.gmail_user = 'USER_NAME'
        self.gmail_pwd = 'PASS_WORD'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.