Esempio n. 1
0
    def __init__(self, serverhandler, servercmdhandler):
        """Constructor"""
        self.srvhandler = ServerHandler()
        self.srvhandler = serverhandler

        self.cmdhandler = ServerCommandHandler(serverhandler)
        self.cmdhandler = servercmdhandler
Esempio n. 2
0
    def start(self):
        # Инициализация потока, работающего с сокетами
        self.handler = ServerHandler(
            host=socket.gethostname(),
            port=self.port.value()
        )
        self.handler.start()  # Запуск потока

        self.block_controls(True)
Esempio n. 3
0
    def __init__(self, serverhandler):
        """Constructor"""
        self.srvhandler = ServerHandler()
        self.srvhandler = serverhandler

        self.commands = {
            'luarun': self.command_luarun,
            'rcon': self.command_rcon,
            'sendfile': self.command_sendfile,
        }
Esempio n. 4
0
    def __init__(self, sock, rsakey):
        self._socket = sock
        # self._client_address
        try:
            self._transport = paramiko.Transport(self._socket)

            rsakey = paramiko.RSAKey(filename=rsakey)
            
            self._transport.add_server_key(rsakey)
            self._server = ServerHandler()
            self._transport.start_server(server=self._server)
        except paramiko.SSHException:
            raise RuntimeError("ssh negotiation failed.")
        except Exception:
            raise RuntimeError("failed to init client")
Esempio n. 5
0
    def __init__(self, socket, address):

        self._socket = socket
        self._hostname = address[0]
        self._port = address[1]
        try:
            self._transport = paramiko.Transport(self._socket)

            self._transport.add_server_key(load_host_key())
            self._server = ServerHandler()

            self._transport.start_server(server=self._server)
        except paramiko.SSHException:
            raise Exception("ssh negotiation failed.")
        except:
            raise Exception("failed to init client")
Esempio n. 6
0
    def __init__(self, *args, **kwargs):
        QtWidgets.QMainWindow.__init__(self, *args, **kwargs)

        # Cargar GUI
        self.setupUi(self)

        # Determinar OS
        self.determine_os()
        
        # QMessageBox
        self.msg_box = QtWidgets.QMessageBox

        # Virus Total Handler
        try:
            self.server_handler = ServerHandler()
        except ValueError:
            self.msg_box.critical(self, 'Error', 'No se detectó una API Key válida de Virus Total.')
            os._exit(1)

        # Thread
        self.thread = QtCore.QThread()
        self.worker = self.server_handler
        self.worker.moveToThread(self.thread)
        self.thread.started.connect(partial(self.server_handler.get_analysis, ""))
        self.worker.progress.connect(self.update_progress)
        self.worker.finished.connect(self.thread.quit)

        # Ocultar items
        self.uploadPb.setVisible(False)
        self.checkHarmlessLbl.setVisible(False)
        self.crossHarmlessLbl.setVisible(False)
        self.checkMaliciousLbl.setVisible(False)
        self.crossMaliciousLbl.setVisible(False)
        self.checkSuspiciousLbl.setVisible(False)
        self.crossSuspiciousLbl.setVisible(False)
        self.uploadBtn.clicked.connect(self.open_file_dialog)
Esempio n. 7
0
 def __init__(self, server_address, handler, handler_class=Serv):
     super().__init__(server_address, handler_class)
     self.srvhandler = ServerHandler()
     self.srvhandler = handler