Commits

Joshua Bonsink committed f978973

Continued work on GUI

Comments (0)

Files changed (3)

 KEYLOGGER = 4
 SPAMMING = 5
 
+SCENARIOS = { 
+    DDOS_FLOODING : 'ddos_flooding',
+    FILE_EXFILTRATION: 'file_exfiltration',
+    KEYLOGGER: 'keylogger',
+    SPAMMING: 'spamming',
+    }
+
 # Common Settings
 CLIENT = "ClientDescription"
 BOTMASTER = "BotmasterDescription"
 TCP_SYN_CMD = "TcpSynFloodCmd"
 
 # File Exfiltration
-INITIAL_CMD = "InitialCmd"
 FILE_FILTER_CMD = "FileFilterCmd"
 SEARCH_UPLOAD_CMD = "SearchAndUploadCmd"
 FTP_CMD = "FtpCmd"
 # Spamming
 CRAWL_CMD = "CrawlCmd"
 
+# Modes
+EMULATION = "Emulation"
+NETNS3 = "Netns3 Simulation"
+PURE_SIM = "Pure Simulation"
+
 def choseCorrectFile(settings_type):
     if settings_type == COMMON_SETTINGS:                    
         return 'core/cmd/description.py'
         tab_file_exfiltration = QtGui.QWidget()
         tab_keylogger = QtGui.QWidget()
         tab_spamming = QtGui.QWidget()
-             
+        tab_topology = QtGui.QWidget()
+        
         tab_widget.addTab(tab_common, "Common settings")
+        tab_widget.addTab(tab_topology, "Topology Editor")
         tab_widget.addTab(tab_ddos_flooding, "DDOS Flooding")
         tab_widget.addTab(tab_file_exfiltration, "File Exfiltration")
         tab_widget.addTab(tab_keylogger, "Keylogger")
         ping_flood.setGeometry(QtCore.QRect(0, 0, 660, 386))                
         hbox_ping_flood = QtGui.QHBoxLayout(ping_flood)        
         groupbox_ping_flood = QtGui.QGroupBox()      
-        groupbox_ping_flood.setTitle("Common ping_flood settings")
+        groupbox_ping_flood.setTitle("Ping Flood attack parameters")
         hbox_ping_flood.addWidget(groupbox_ping_flood)        
         grid_groupbox_ping_flood = QtGui.QGridLayout()                        
         hbox_groupbox_ping_flood = QtGui.QHBoxLayout(groupbox_ping_flood)
         label_3.setText("Hostname")        
         grid_groupbox_ping_flood.addWidget(label_3, 0, 0, 1, 2)   
         spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_ping_flood.addItem(spacerItem3, 0, 1, 1, 2)                
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, PING_CMD, "self.hostname", groupbox_ping_flood)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
         lineEdit_4.setText(current_value)
         grid_groupbox_ping_flood.addWidget(lineEdit_4, 3, 2, 1, 2)          
         
-        current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.num_packets"))
-        print current_value
+        current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.num_packets"))        
         label_4 = QtGui.QLabel(groupbox_ping_flood)
         label_4.setText("Number of packets")
         grid_groupbox_ping_flood.addWidget(label_4, 4, 0, 1, 2)       
         preload.setValue(current_value)
         grid_groupbox_ping_flood.addWidget(preload, 6, 2, 1, 2)       
         
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, PING_CMD))                     
+        grid_groupbox_ping_flood.addWidget(button, 7, 0, 1, 2)
+        
+        # --- HTTP Get Flood settings --- #
+        http_get_flood.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_http_get = QtGui.QHBoxLayout(http_get_flood)        
+        groupbox_http_get = QtGui.QGroupBox()      
+        groupbox_http_get.setTitle("HTTP GET attack parameters")
+        hbox_http_get.addWidget(groupbox_http_get)        
+        grid_groupbox_http_get = QtGui.QGridLayout()                        
+        hbox_groupbox_http_get = QtGui.QHBoxLayout(groupbox_http_get)
+        hbox_groupbox_http_get.addLayout(grid_groupbox_http_get)
+
+        current_value = searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.hostname")        
+        label_3 = QtGui.QLabel(groupbox_http_get)
+        label_3.setText("Hostname")        
+        grid_groupbox_http_get.addWidget(label_3, 0, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_http_get.addItem(spacerItem3, 0, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.hostname", groupbox_http_get)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_http_get.addWidget(lineEdit_4, 0, 2, 1, 2)
+         
+        current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.port"))
+        label_4 = QtGui.QLabel(groupbox_http_get)
+        label_4.setText("Port")
+        grid_groupbox_http_get.addWidget(label_4, 1, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_http_get.addItem(spacerItem4, 1, 1, 1, 2)        
+        port = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.port", groupbox_http_get)            
+        port.setValue(current_value)
+        port.setMinimum(0)
+        port.setMaximum(99999)
+        port.setSingleStep(1) 
+        grid_groupbox_http_get.addWidget(port, 1, 2, 1, 2)       
+        
+        current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.num_requests"))        
+        label_4 = QtGui.QLabel(groupbox_http_get)
+        label_4.setText("Number of requests")
+        grid_groupbox_http_get.addWidget(label_4, 2, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_http_get.addItem(spacerItem4, 2, 1, 1, 2)        
+        num_requests = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.num_requests", groupbox_http_get)                    
+        num_requests.setMinimum(0)
+        num_requests.setMaximum(99999999)        
+        num_requests.setSingleStep(1)
+        num_requests.setValue(current_value) 
+        grid_groupbox_http_get.addWidget(num_requests, 2, 2, 1, 2)       
+        
+        current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.num_threads"))
+        label_4 = QtGui.QLabel(groupbox_http_get)
+        label_4.setText("Number of threads")
+        grid_groupbox_http_get.addWidget(label_4, 3, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_http_get.addItem(spacerItem4, 3, 1, 1, 2)        
+        num_threads = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.num_threads", groupbox_http_get)                    
+        num_threads.setMinimum(0)
+        num_threads.setMaximum(99999999)
+        num_threads.setSingleStep(1) 
+        num_threads.setValue(current_value)
+        grid_groupbox_http_get.addWidget(num_threads, 3, 2, 1, 2)       
+        
+        current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.speed"))
+        label_4 = QtGui.QLabel(groupbox_http_get)
+        label_4.setText("Speed")
+        grid_groupbox_http_get.addWidget(label_4, 4, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_http_get.addItem(spacerItem4, 4, 1, 1, 2)        
+        speed = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.speed", groupbox_http_get)                    
+        speed.setMinimum(0)
+        speed.setMaximum(100)        
+        speed.setSingleStep(1) 
+        speed.setValue(current_value)
+        grid_groupbox_http_get.addWidget(speed, 4, 2, 1, 2)       
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, HTTP_GET_CMD))                     
+        grid_groupbox_http_get.addWidget(button, 5, 0, 1, 2)
+        
+        # --- TCP Syn Flood settings --- #
+        tcp_syn_flood.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_tcp_syn = QtGui.QHBoxLayout(tcp_syn_flood)        
+        groupbox_tcp_syn = QtGui.QGroupBox()      
+        groupbox_tcp_syn.setTitle("TCP Syn Flood attack parameters")
+        hbox_tcp_syn.addWidget(groupbox_tcp_syn)        
+        grid_groupbox_tcp_syn = QtGui.QGridLayout()                        
+        hbox_groupbox_tcp_syn = QtGui.QHBoxLayout(groupbox_tcp_syn)
+        hbox_groupbox_tcp_syn.addLayout(grid_groupbox_tcp_syn)
+
+        current_value = searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.hostname")        
+        label_3 = QtGui.QLabel(groupbox_tcp_syn)
+        label_3.setText("Hostname")        
+        grid_groupbox_tcp_syn.addWidget(label_3, 0, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_tcp_syn.addItem(spacerItem3, 0, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.hostname", groupbox_tcp_syn)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_tcp_syn.addWidget(lineEdit_4, 0, 2, 1, 2)
+         
+        current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.port"))
+        label_4 = QtGui.QLabel(groupbox_tcp_syn)
+        label_4.setText("Port")
+        grid_groupbox_tcp_syn.addWidget(label_4, 1, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_tcp_syn.addItem(spacerItem4, 1, 1, 1, 2)        
+        port = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.port", groupbox_tcp_syn)            
+        port.setValue(current_value)
+        port.setMinimum(0)
+        port.setMaximum(99999)
+        port.setSingleStep(1) 
+        grid_groupbox_tcp_syn.addWidget(port, 1, 2, 1, 2)       
+        
+        current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.num_packets"))        
+        label_4 = QtGui.QLabel(groupbox_tcp_syn)
+        label_4.setText("Number of packets")
+        grid_groupbox_tcp_syn.addWidget(label_4, 2, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_tcp_syn.addItem(spacerItem4, 2, 1, 1, 2)        
+        num_requests = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.num_packets", groupbox_tcp_syn)                    
+        num_requests.setMinimum(0)
+        num_requests.setMaximum(99999999)        
+        num_requests.setSingleStep(1)
+        num_requests.setValue(current_value) 
+        grid_groupbox_tcp_syn.addWidget(num_requests, 2, 2, 1, 2)       
+        
+        current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.num_threads"))
+        label_4 = QtGui.QLabel(groupbox_tcp_syn)
+        label_4.setText("Number of threads")
+        grid_groupbox_tcp_syn.addWidget(label_4, 3, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_tcp_syn.addItem(spacerItem4, 3, 1, 1, 2)        
+        num_threads = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.num_threads", groupbox_tcp_syn)                    
+        num_threads.setMinimum(0)
+        num_threads.setMaximum(99999999)
+        num_threads.setSingleStep(1) 
+        num_threads.setValue(current_value)
+        grid_groupbox_tcp_syn.addWidget(num_threads, 3, 2, 1, 2)   
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, TCP_SYN_CMD))                     
+        grid_groupbox_tcp_syn.addWidget(button, 4, 0, 1, 2)
+        
+        self.setCentralWidget(tab_widget)
+
+        # --- File Exfiltration scenario --- #
+        tab_file_exfiltration_layout = QtGui.QVBoxLayout(tab_file_exfiltration)     
+        tool_box_file_exfiltration = QtGui.QToolBox(tab_file_exfiltration)
+        tab_file_exfiltration_layout.addWidget(tool_box_file_exfiltration)     
+
+        ftp = QtGui.QWidget()
+        file_filter = QtGui.QWidget()
+        search_and_upload = QtGui.QWidget()
+
+        tool_box_file_exfiltration.addItem(ftp, "FTP Command")
+        tool_box_file_exfiltration.addItem(file_filter, "File Filter Command")           
+        
+        # --- FTP Command settings --- #
+        ftp.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_ftp = QtGui.QHBoxLayout(ftp)        
+        groupbox_ftp = QtGui.QGroupBox()      
+        groupbox_ftp.setTitle("Parameters")
+        hbox_ftp.addWidget(groupbox_ftp)        
+        grid_groupbox_ftp = QtGui.QGridLayout()                        
+        hbox_groupbox_ftp = QtGui.QHBoxLayout(groupbox_ftp)
+        hbox_groupbox_ftp.addLayout(grid_groupbox_ftp)
+
+        current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.hostname")        
+        label_3 = QtGui.QLabel(groupbox_ftp)
+        label_3.setText("Hostname")        
+        grid_groupbox_ftp.addWidget(label_3, 0, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_ftp.addItem(spacerItem3, 0, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.hostname", groupbox_ftp)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 0, 2, 1, 2)
+        
+        current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.user")        
+        label_3 = QtGui.QLabel(groupbox_ftp)
+        label_3.setText("User")        
+        grid_groupbox_ftp.addWidget(label_3, 1, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_ftp.addItem(spacerItem3, 1, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.user", groupbox_ftp)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 1, 2, 1, 2)
+        
+        current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.password")        
+        label_3 = QtGui.QLabel(groupbox_ftp)
+        label_3.setText("Password")        
+        grid_groupbox_ftp.addWidget(label_3, 2, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_ftp.addItem(spacerItem3, 2, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.password", groupbox_ftp)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 2, 2, 1, 2)
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(FILE_EXFILTRATION, FTP_CMD))                     
+        grid_groupbox_ftp.addWidget(button, 3, 0, 1, 2)
+        
+        # --- File Filter Command settings --- #
+        file_filter.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_file_filter = QtGui.QHBoxLayout(file_filter)        
+        groupbox_file_filter = QtGui.QGroupBox()      
+        groupbox_file_filter.setTitle("Parameters")
+        hbox_file_filter.addWidget(groupbox_file_filter)        
+        grid_groupbox_file_filter = QtGui.QGridLayout()                        
+        hbox_groupbox_file_filter = QtGui.QHBoxLayout(groupbox_file_filter)
+        hbox_groupbox_file_filter.addLayout(grid_groupbox_file_filter)
+
+        current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.suffix")        
+        label_3 = QtGui.QLabel(groupbox_file_filter)
+        label_3.setText("Suffix")        
+        grid_groupbox_file_filter.addWidget(label_3, 0, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_file_filter.addItem(spacerItem3, 0, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.suffix", groupbox_file_filter)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 0, 2, 1, 2)
+        
+        current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.pattern")        
+        label_3 = QtGui.QLabel(groupbox_file_filter)
+        label_3.setText("Pattern")        
+        grid_groupbox_file_filter.addWidget(label_3, 1, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_file_filter.addItem(spacerItem3, 1, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.pattern", groupbox_file_filter)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 1, 2, 1, 2)
+        
+        current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.directory")        
+        label_3 = QtGui.QLabel(groupbox_file_filter)
+        label_3.setText("Directory")        
+        grid_groupbox_file_filter.addWidget(label_3, 2, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_file_filter.addItem(spacerItem3, 2, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.directory", groupbox_file_filter)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 2, 2, 1, 2)
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(FILE_EXFILTRATION, FTP_CMD))                     
+        grid_groupbox_file_filter.addWidget(button, 3, 0, 1, 2)
+        
+        # --- Keylogger scenario --- #
+        tab_keylogger.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_keylogger = QtGui.QHBoxLayout(tab_keylogger)        
+        groupbox_keylogger = QtGui.QGroupBox()      
+        groupbox_keylogger.setTitle("Parameters")
+        hbox_keylogger.addWidget(groupbox_keylogger)        
+        grid_groupbox_keylogger = QtGui.QGridLayout()                        
+        hbox_groupbox_keylogger = QtGui.QHBoxLayout(groupbox_keylogger)
+        hbox_groupbox_keylogger.addLayout(grid_groupbox_keylogger)               
+        
+        current_value = int(searchAndGet(KEYLOGGER, KEYLOG_CMD, "self.duration"))
+        label_4 = QtGui.QLabel(groupbox_keylogger)
+        label_4.setText("Duration")
+        grid_groupbox_keylogger.addWidget(label_4, 0, 0, 1, 2)       
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_keylogger.addItem(spacerItem4, 0, 1, 1, 2)        
+        duration = MySpinBox(current_value, KEYLOGGER, KEYLOG_CMD, "self.duration", groupbox_keylogger)                    
+        duration.setMinimum(0)
+        duration.setMaximum(100)        
+        duration.setSingleStep(1) 
+        duration.setValue(current_value)
+        grid_groupbox_keylogger.addWidget(duration, 0, 2, 1, 2)       
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(KEYLOGGER, KEYLOG_CMD))                     
+        grid_groupbox_keylogger.addWidget(button, 1, 0, 1, 2)
+        
+        # --- Spamming scenario --- #
+        tab_spamming.setGeometry(QtCore.QRect(0, 0, 660, 386))                        
+        hbox_spamming = QtGui.QHBoxLayout(tab_spamming)        
+        groupbox_spamming = QtGui.QGroupBox()      
+        groupbox_spamming.setTitle("Parameters")
+        hbox_spamming.addWidget(groupbox_spamming)        
+        grid_groupbox_spamming = QtGui.QGridLayout()                        
+        hbox_groupbox_spamming = QtGui.QHBoxLayout(groupbox_spamming)
+        hbox_groupbox_spamming.addLayout(grid_groupbox_spamming)               
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.start_url")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Start url")        
+        grid_groupbox_spamming.addWidget(label_3, 0, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 0, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.start_url", groupbox_spamming)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 0, 2, 1, 2)
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.subject")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Subject")        
+        grid_groupbox_spamming.addWidget(label_3, 1, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 1, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.subject", groupbox_spamming)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 1, 2, 1, 2)
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.content")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Content")        
+        grid_groupbox_spamming.addWidget(label_3, 2, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 2, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.content", groupbox_spamming)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 2, 2, 1, 2)
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.max_iterations")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Maximum iterations")        
+        grid_groupbox_spamming.addWidget(label_3, 3, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 3, 1, 1, 2)        
+        max_iterations = MySpinBox(current_value, SPAMMING, CRAWL_CMD, "self.max_iterations", groupbox_spamming)            
+        max_iterations.setValue(0)
+        max_iterations.setMinimum(0)
+        max_iterations.setMaximum(9999)
+        max_iterations.setSingleStep(1)
+        grid_groupbox_spamming.addWidget(max_iterations, 3, 2, 1, 2)
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.gmail_user")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Gmail username")        
+        grid_groupbox_spamming.addWidget(label_3, 4, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 4, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.gmail_user", groupbox_spamming)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 4, 2, 1, 2)
+        
+        current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.gmail_pwd")        
+        label_3 = QtGui.QLabel(groupbox_spamming)
+        label_3.setText("Gmail password")        
+        grid_groupbox_spamming.addWidget(label_3, 5, 0, 1, 2)   
+        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_spamming.addItem(spacerItem3, 5, 1, 1, 2)        
+        lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.gmail_pwd", groupbox_spamming)
+        lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
+        lineEdit_4.setText(current_value)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 5, 2, 1, 2)
+        
+        button = QtGui.QPushButton('Start', self)
+        button.clicked.connect(lambda: self.startScenario(SPAMMING, CRAWL_CMD))                     
+        grid_groupbox_keylogger.addWidget(button, 6, 0, 1, 2)
+        
         # --- Common settings --- #
         tab_common_layout = QtGui.QVBoxLayout(tab_common)     
         tool_box = QtGui.QToolBox(tab_common)
         grid_groupbox_mode.addWidget(label, 0, 0, 1, 1)        
         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
         grid_groupbox_mode.addItem(spacerItem, 0, 1, 1, 1)        
-        comboBox = QtGui.QComboBox(groupbox_mode)            
-        comboBox.addItem("Select a mode")
-        comboBox.addItem("Emulation")
-        comboBox.addItem("Netns3 Simulation")
-        comboBox.addItem("Pure Simulation")        
-        comboBox.activated['QString'].connect(self.modeSelected)        
-        grid_groupbox_mode.addWidget(comboBox, 0, 0, 1, 2)        
+        self.mode = QtGui.QComboBox(groupbox_mode)            
+        self.mode.addItem("Select a mode")
+        self.mode.addItem(EMULATION)
+        self.mode.addItem(NETNS3)
+        self.mode.addItem(PURE_SIM)        
+        self.mode.activated['QString'].connect(self.modeSelected)        
+        grid_groupbox_mode.addWidget(self.mode, 0, 0, 1, 2)        
 
         # --- Emulation Settings --- #
         self.groupbox_emulation = QtGui.QGroupBox()      
         grid_groupbox_emulation.addWidget(label_1, 0, 0, 1, 2)        
         spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
         grid_groupbox_emulation.addItem(spacerItem1, 0, 1, 1, 2)        
-        spinBox_1 = QtGui.QSpinBox(self.groupbox_emulation)            
-        spinBox_1.setValue(0)
-        spinBox_1.setMinimum(0)
-        spinBox_1.setMaximum(10)
-        spinBox_1.setSingleStep(1)
-        grid_groupbox_emulation.addWidget(spinBox_1, 0, 2, 1, 2)
+        self.emulation_clients = QtGui.QSpinBox(self.groupbox_emulation)            
+        self.emulation_clients.setValue(1)
+        self.emulation_clients.setMinimum(0)
+        self.emulation_clients.setMaximum(10)
+        self.emulation_clients.setSingleStep(1)
+        grid_groupbox_emulation.addWidget(self.emulation_clients, 0, 2, 1, 2)
 
         # --- NetNS3 Settings --- #             
         self.groupbox_netns3 = QtGui.QGroupBox()      
         grid_groupbox_netns3 = QtGui.QGridLayout()                        
         hbox_groupbox_netns3 = QtGui.QHBoxLayout(self.groupbox_netns3)
         hbox_groupbox_netns3.addLayout(grid_groupbox_netns3)        
-        comboBox = QtGui.QComboBox(self.groupbox_netns3)            
-        comboBox.addItem("Select an experiment")
-        comboBox.addItem("Complex Network Experiment")
-        comboBox.addItem("Manual Topology Background Traffic Experiment")
-        comboBox.addItem("Manual Topology Experiment")                        
-        comboBox.activated['QString'].connect(self.experimentSelected)    
-        grid_groupbox_netns3.addWidget(comboBox, 0, 0, 1, 2)        
+        self.netns3_exp = QtGui.QComboBox(self.groupbox_netns3)            
+        self.netns3_exp.addItem("Select an experiment")
+        self.netns3_exp.addItem("Complex Network Experiment")
+        self.netns3_exp.addItem("Manual Topology Background Traffic Experiment")
+        self.netns3_exp.addItem("Manual Topology Experiment")                        
+        self.netns3_exp.activated['QString'].connect(self.experimentSelected)    
+        grid_groupbox_netns3.addWidget(self.netns3_exp, 0, 0, 1, 2)        
 
         # --- Pure Simulation Settings --- #
         self.groupbox_pure = QtGui.QGroupBox()      
         grid_groupbox_pure = QtGui.QGridLayout()                        
         hbox_groupbox_pure = QtGui.QHBoxLayout(self.groupbox_pure)
         hbox_groupbox_pure.addLayout(grid_groupbox_pure)        
-        comboBox = QtGui.QComboBox(self.groupbox_pure)    
-        comboBox.addItem("Select an experiment")
-        comboBox.addItem("Complex Network Experiment")
-        comboBox.addItem("Manual Topology Background Traffic Experiment")
-        comboBox.addItem("Manual Topology Experiment")
-        comboBox.addItem("Static Route Experiment")
-        comboBox.addItem("Topology Experiment")                                
-        comboBox.activated['QString'].connect(self.experimentSelected)    
-        grid_groupbox_pure.addWidget(comboBox, 0, 0, 1, 2)        
+        self.pure_exp = QtGui.QComboBox(self.groupbox_pure)    
+        self.pure_exp.addItem("Select an experiment")
+        self.pure_exp.addItem("Complex Network Experiment")
+        self.pure_exp.addItem("Manual Topology Background Traffic Experiment")
+        self.pure_exp.addItem("Manual Topology Experiment")
+        self.pure_exp.addItem("Static Route Experiment")
+        self.pure_exp.addItem("Topology Experiment")                                
+        self.pure_exp.activated['QString'].connect(self.experimentSelected)    
+        grid_groupbox_pure.addWidget(self.pure_exp, 0, 0, 1, 2)        
 
         self.groupbox_emulation.hide()
         self.groupbox_netns3.hide()
         self.groupbox_topo.hide()
         self.groupbox_static_route.hide()  
         
+    def startScenario(self, settings_type, attack):        
+        open_f = choseCorrectFile(settings_type)
+        
+        mode = self.mode.itemText( self.mode.currentIndex() )
+        
+        if mode == EMULATION:
+            old_value = searchAndGet(settings_type, BOTMASTER, "self.command")           
+            searchAndReplace(settings_type, BOTMASTER, "self.command", old_value, attack+'()')
+            scenario = SCENARIOS[settings_type]
+            startEmulation(scenario)
+            
+        #elif mode == NETNS3:
+        #elif mode == PURE_SIM:
+       
+def startEmulation(scenario):       
+    cmd = 'sudo ./emulate.py -s ' + scenario + ' -r server'   
+    os.system("gnome-terminal -e 'bash -c \"" + cmd + "; exec bash\"'")
+    for _ in range(self.emulation_clients):        
+        cmd = 'sudo ./emulate.py -s ' + scenario + ' -r client'    
+        os.system("gnome-terminal -e 'bash -c \"" + cmd + "; exec bash\"'")
+    cmd = 'sudo ./emulate.py -s ' + scenario + ' -r botmaster'    
+    os.system("gnome-terminal -e 'bash -c \"" + cmd + "; exec bash\"'")
+            
 def main():
     
     app = QtGui.QApplication(sys.argv)

scenario/ddos_flooding/config.py

     self.master_password = '1234'
     self.interval = 2 
     self.num_commands = 1
-    self.command = None
-    
-    There are three types of flooding attacks:
+    self.command =PingFloodCmd()
+There are three types of flooding attacks:
     Ping flooding - PingFloodCmd
     Http get request flooding - HttpGetFloodCmd
     Tcp syn flooding - TcpSynFloodCmd

scenario/file_exfiltration/config.py

     def __init__(self):
         """Specify the settings here."""
         self.event = 'set_ftp_info'
-        self.host = 'thales.bu.edu'
+        self.hostname = 'thales.bu.edu'
         self.user = 'imalse-ftp'
         self.password = 'imalse'
     
     
     def __init__(self):
         """Initialize the command."""
-        self.event = 'search_and_upload'
+        self.event = 'search_and_upload'