예제 #1
0
	def __init__(self, *args, **kwargs):
		super(GlobalPlugin, self).__init__(*args, **kwargs)
		self.local_machine = local_machine.LocalMachine()
		self.slave_session = None
		self.master_session = None
		self.create_menu()
		self.connector = None
		self.control_connector_thread = None
		self.control_connector = None
		self.server = None
		self.hook_thread = None
		self.sending_keys = False
		self.key_modified = False
		self.sd_server = None
		cs = get_config()['controlserver']
		if cs['autoconnect']:

			if cs['autoconnect'] == 1: # self-hosted server
				self.server = server.Server(SERVER_PORT, cs['key'])
				server_thread = threading.Thread(target=self.server.run)
				server_thread.daemon = True
				server_thread.start()
				address = address_to_hostport('localhost')
			elif cs['autoconnect'] == '2':
				address = address_to_hostport(cs['host'])
			elif cs['autoconnect'] == True: # Previous version config, change value to 2 for external control server
				config = get_config()
				config['controlserver']['autoconnect'] = 2
				config.write()
				address = address_to_hostport(cs['host'])
			self.connect_control(address, cs['key']) # Connect to the server
		self.temp_location = os.path.join(shlobj.SHGetFolderPath(0, shlobj.CSIDL_COMMON_APPDATA), 'temp')
		self.ipc_file = os.path.join(self.temp_location, 'remote.ipc')
		self.sd_focused = False
		self.check_secure_desktop()
예제 #2
0
	def on_generate_key(self, evt):
		evt.Skip()
		address = socket_utils.address_to_hostport(self.host.GetValue())
		self.key_connector = transport.RelayTransport(address=address, serializer=serializer.JSONSerializer())
		self.key_connector.callback_manager.register_callback('msg_generate_key', self.handle_key_generated)
		t = threading.Thread(target=self.key_connector.run)
		t.start()
예제 #3
0
 def on_generate_key(self, evt):
     evt.Skip()
     address = socket_utils.address_to_hostport(self.host.GetValue())
     self.key_connector = transport.RelayTransport(
         address=address, serializer=serializer.JSONSerializer())
     self.key_connector.callback_manager.register_callback(
         'msg_generate_key', self.handle_key_generated)
     t = threading.Thread(target=self.key_connector.run)
     t.start()
예제 #4
0
	def perform_autoconnect(self):
		cs = get_config()['controlserver']
		channel = cs['key']
		if cs['self_hosted']:
			port = cs['port']
			address = ('localhost',port)
			self.start_control_server(port, channel)
		else:
			address = address_to_hostport(cs['host'])
		self.connect_control(address, channel)
예제 #5
0
 def perform_autoconnect(self):
     cs = configuration.get_config()['controlserver']
     channel = cs['key']
     if cs['self_hosted']:
         port = cs['port']
         address = ('localhost', port)
         self.start_control_server(port, channel)
     else:
         address = address_to_hostport(cs['host'])
     if cs['connection_type'] == 0:
         self.connect_as_slave(address, channel)
     else:
         self.connect_as_master(address, channel)
예제 #6
0
	def perform_autoconnect(self):
		cs = configuration.get_config()['controlserver']
		channel = cs['key']
		if cs['self_hosted']:
			port = cs['port']
			address = ('localhost',port)
			self.start_control_server(port, channel)
		else:
			address = address_to_hostport(cs['host'])
		if cs['connection_type']==0:
			self.connect_as_slave(address, channel)
		else:
			self.connect_as_master(address, channel)
예제 #7
0
    def __init__(self, *args, **kwargs):
        super(GlobalPlugin, self).__init__(*args, **kwargs)
        self.local_machine = local_machine.LocalMachine()
        self.slave_session = None
        self.master_session = None
        self.create_menu()
        self.connector = None
        self.control_connector_thread = None
        self.control_connector = None
        self.server = None
        self.hook_thread = None
        self.sending_keys = False
        self.key_modified = False
        self.sd_server = None
        cs = get_config()['controlserver']
        if cs['autoconnect']:

            if cs['autoconnect'] == 1:  # self-hosted server
                self.server = server.Server(SERVER_PORT, cs['key'])
                server_thread = threading.Thread(target=self.server.run)
                server_thread.daemon = True
                server_thread.start()
                address = address_to_hostport('localhost')
            elif cs['autoconnect'] == '2':
                address = address_to_hostport(cs['host'])
            elif cs['autoconnect'] == True:  # Previous version config, change value to 2 for external control server
                config = get_config()
                config['controlserver']['autoconnect'] = 2
                config.write()
                address = address_to_hostport(cs['host'])
            self.connect_control(address, cs['key'])  # Connect to the server
        self.temp_location = os.path.join(
            shlobj.SHGetFolderPath(0, shlobj.CSIDL_COMMON_APPDATA), 'temp')
        self.ipc_file = os.path.join(self.temp_location, 'remote.ipc')
        self.sd_focused = False
        self.check_secure_desktop()
예제 #8
0
		def handle_dlg_complete(dlg_result):
			if dlg_result != wx.ID_OK:
				return
			if dlg.client_or_server.GetSelection() == 0: #client
				server_addr = dlg.panel.host.GetValue()
				server_addr, port = address_to_hostport(server_addr)
				channel = dlg.panel.key.GetValue()
				if dlg.connection_type.GetSelection() == 0:
					self.connect_as_master((server_addr, port), channel)
				else:
					self.connect_as_slave((server_addr, port), channel)
			else: #We want a server
				channel = dlg.panel.key.GetValue()
				self.start_control_server(int(dlg.panel.port.GetValue()), channel)
				if dlg.connection_type.GetSelection() == 0:
					self.connect_as_master(('127.0.0.1', int(dlg.panel.port.GetValue())), channel)
				else:
					self.connect_as_slave(('127.0.0.1', int(dlg.panel.port.GetValue())), channel)
예제 #9
0
		def handle_dlg_complete(dlg_result):
			if dlg_result != wx.ID_OK:
				return
			if dlg.client_or_server.GetSelection() == 0: #client
				server_addr = dlg.panel.host.GetValue()
				server_addr, port = address_to_hostport(server_addr)
				channel = dlg.panel.key.GetValue()
				if dlg.connection_type.GetSelection() == 0:
					self.connect_slave((server_addr, port), channel)
				else:
					self.connect_control((server_addr, port), channel)
			else: #We want a server
				channel = dlg.panel.key.GetValue()
				self.server = server.Server(SERVER_PORT, channel)
				server_thread = threading.Thread(target=self.server.run)
				server_thread.daemon = True
				server_thread.start()
				if dlg.connection_type.GetSelection() == 0:
					self.connect_slave(('127.0.0.1', SERVER_PORT), channel)
				else:
					self.connect_control(('127.0.0.1', SERVER_PORT), channel)
예제 #10
0
 def handle_dlg_complete(dlg_result):
     if dlg_result != wx.ID_OK:
         return
     if dlg.client_or_server.GetSelection() == 0:  #client
         server_addr = dlg.panel.host.GetValue()
         server_addr, port = address_to_hostport(server_addr)
         channel = dlg.panel.key.GetValue()
         if dlg.connection_type.GetSelection() == 0:
             self.connect_as_master((server_addr, port), channel)
         else:
             self.connect_as_slave((server_addr, port), channel)
     else:  #We want a server
         channel = dlg.panel.key.GetValue()
         self.start_control_server(int(dlg.panel.port.GetValue()),
                                   channel)
         if dlg.connection_type.GetSelection() == 0:
             self.connect_as_master(
                 ('127.0.0.1', int(dlg.panel.port.GetValue())), channel)
         else:
             self.connect_as_slave(
                 ('127.0.0.1', int(dlg.panel.port.GetValue())), channel)
예제 #11
0
 def handle_dlg_complete(dlg_result):
     if dlg_result != wx.ID_OK:
         return
     if dlg.client_or_server.GetSelection() == 0:  #client
         server_addr = dlg.panel.host.GetValue()
         server_addr, port = address_to_hostport(server_addr)
         channel = dlg.panel.key.GetValue()
         if dlg.connection_type.GetSelection() == 0:
             self.connect_slave((server_addr, port), channel)
         else:
             self.connect_control((server_addr, port), channel)
     else:  #We want a server
         channel = dlg.panel.key.GetValue()
         self.server = server.Server(SERVER_PORT, channel)
         server_thread = threading.Thread(target=self.server.run)
         server_thread.daemon = True
         server_thread.start()
         if dlg.connection_type.GetSelection() == 0:
             self.connect_slave(('127.0.0.1', SERVER_PORT), channel)
         else:
             self.connect_control(('127.0.0.1', SERVER_PORT), channel)
예제 #12
0
	def __init__(self, *args, **kwargs):
		super(GlobalPlugin, self).__init__(*args, **kwargs)
		self.local_machine = local_machine.LocalMachine()
		self.slave_session = None
		self.master_session = None
		self.create_menu()
		self.connector = None
		self.control_connector_thread = None
		self.control_connector = None
		self.server = None
		self.hook_thread = None
		self.sending_keys = False
		self.key_modified = False
		self.sd_server = None
		cs = get_config()['controlserver']
		if cs['autoconnect']:
			address = address_to_hostport(cs['host'])
			self.connect_control(address, cs['key'])
		self.temp_location = os.path.join(shlobj.SHGetFolderPath(0, shlobj.CSIDL_COMMON_APPDATA), 'temp')
		self.ipc_file = os.path.join(self.temp_location, 'remote.ipc')
		self.sd_focused = False
		self.check_secure_desktop()
예제 #13
0
 def __init__(self, *args, **kwargs):
     super(GlobalPlugin, self).__init__(*args, **kwargs)
     self.local_machine = local_machine.LocalMachine()
     self.slave_session = None
     self.master_session = None
     self.create_menu()
     self.connector = None
     self.control_connector_thread = None
     self.control_connector = None
     self.server = None
     self.hook_thread = None
     self.sending_keys = False
     self.key_modified = False
     self.sd_server = None
     cs = get_config()['controlserver']
     if cs['autoconnect']:
         address = address_to_hostport(cs['host'])
         self.connect_control(address, cs['key'])
     self.temp_location = os.path.join(
         shlobj.SHGetFolderPath(0, shlobj.CSIDL_COMMON_APPDATA), 'temp')
     self.ipc_file = os.path.join(self.temp_location, 'remote.ipc')
     self.sd_focused = False
     self.check_secure_desktop()